############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = glibc version = 2.19 release = 1 maintainer = Michael Tremer groups = System/Base url = http://sources.redhat.com/glibc/ license = GPLv2+ LGPLv2+ summary = The GNU libc libraries. description The glibc package contains standard libraries which are used by multiple programs on the system. In order to save disk space and memory, as well as to make upgrading easier, common system code is kept in one place and shared between programs. This particular package contains the most important sets of shared libraries: the standard C library and the standard math library. Without these two libraries, a Linux system will not function. end source_dl = http://ftp.gnu.org/gnu/glibc/ sources = %{thisapp}.tar.xz build # Optimize glibc for kernel OPTIMIZED_KERNEL = 2.6.32 requires audit-devel autoconf automake gettext kernel-headers >= %{OPTIMIZED_KERNEL} libcap-devel libselinux-devel texinfo end # Build glibc with custom cflags GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -fPIC -DPIC if "%{DISTRO_ARCH}" == "i686" GLIBC_FLAGS += -march=i686 -mtune=generic end if "%{DISTRO_ARCH}" == "x86_64" GLIBC_FLAGS += -mtune=generic end export CFLAGS = %{GLIBC_FLAGS} export CXXFLAGS = %{GLIBC_FLAGS} export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes prepare_cmds # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is # unknown whether this is a bash bug or a Glibc problem. Disable # installation of this locale in order to avoid the problem. sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED # The ldd shell script contains Bash-specific syntax. Change its default # program interpreter to /bin/bash in case another /bin/sh is installed. sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in # We don't install pt_chown(1) on the final system, so why install it to # $(TOOLS_DIR): sed -e "/^install.*pt_chown/d" -i login/Makefile # Build nscd with -fstack-protector-all, instead of -fstack-protector: sed -e "s/fstack-protector/&-all/" -i nscd/Makefile # Use gnu hash style sed -i Makeconfig \ -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/" # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html sed -e "s/PIC/SHARED/g" -i ports/sysdeps/arm/{set,__long}jmp.S end configure_options = \ --build=%{DISTRO_BUILDTARGET} \ --prefix=/usr \ --libexecdir=%{libdir}/glibc \ --disable-profile \ --enable-add-ons \ --enable-kernel=%{OPTIMIZED_KERNEL} \ --with-selinux \ --disable-werror \ --enable-bind-now \ --enable-obsolete-rpc \ --with-bugurl=http://bugtracker.ipfire.org \ --enable-lock-elision if "%{DISTRO_ARCH}" == "armv5tel" # Disable hardware FP for ARM. configure_options += \ --without-fp end build mkdir -p %{DIR_SRC}/glibc-build cd %{DIR_SRC}/glibc-build CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \ ../%{thisapp}/configure \ %{configure_options} sed -i config.make \ -e "s/^build-pic-default=.*/build-pic-default=yes/" # Our GCC is already passing -fPIC, and that's all we want for the libraries. # LDFLAGS.so is appended to so we don't build shared libraries with # DT_TEXTREL (and to tell us if something goes wrong). For now we only build # the libraries, not the programs: echo "build-programs=no" >> configparms make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \ CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" # Then build the programs with hardening, so everything possible in # is hardened: echo "# Nothing in here :D" > configparms make PARALLELMFLAGS=%{PARALLELISMFLAGS} \ CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}" end install cd %{DIR_SRC}/glibc-build make install install_root=%{BUILDROOT} # Locales mkdir -pv %{BUILDROOT}/usr/lib/locale # This would install all locales that are supported make localedata/install-locales install_root=%{BUILDROOT} # Configuration cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d} install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3 fi # Remove unused binaries rm -vf %{BUILDROOT}/sbin/sln \ %{BUILDROOT}/usr/bin/rpcinfo # Don't distribute linker cache rm -vf %{BUILDROOT}/etc/ld.so.cache # Include /usr/lib/gconv/gconv-modules.cache > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache strip -g %{BUILDROOT}%{libdir}/*.o # Move some libs to correct place mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir} # Fix library permissions. chmod 755 %{BUILDROOT}%{libdir}/lib*.so* # rquota.x and rquota.h are now provided by quota rm -vf %{BUILDROOT}%{includedir}/rpcsvc/rquota.[hx] end keep_libraries %{libdir}/libc_nonshared.a %{libdir}/libpthread_nonshared.a end end packages package glibc requires = glibc-common = %{thisver} if "%{DISTRO_ARCH}" == "armv7hl" provides += ld-linux.so.3 provides += ld-linux.so.3(GLIBC_2.4) provides += ld-linux.so.3(GLIBC_PRIVATE) end end package glibc-common # XXX description and summary are missing requires glibc = %{thisver} tzdata end files /usr/bin /usr/sbin /usr/share /usr/lib/locale !/usr/share/zoneinfo end end package glibc-devel summary = Object files for development using standard C libraries. description The glibc-devel package contains the object files necessary for developing programs which use the standard C libraries (which are used by nearly all programs). If you are developing programs which will use the standard C libraries, your system needs to have these standard object files available in order to create the executables. Install glibc-devel if you are going to develop programs which will use the standard C libraries. end group = Development/Libraries requires glibc = %{thisver} glibc-headers = %{thisver} end files %{includedir} %{libdir}/*.a %{libdir}/*.o end end package glibc-headers description The glibc-headers package contains the header files necessary for developing programs which use the standard C libraries (which are used by nearly all programs). If you are developing programs which will use the standard C libraries, your system needs to have these standard header files available in order to create the executables. Install glibc-headers if you are going to develop programs which will use the standard C libraries. end requires glibc = %{thisver} kernel-headers >= %{OPTIMIZED_KERNEL} end files /usr/include !/usr/include/linuxthreads !/usr/include/gnu/stubs-[32164]*.h end end package nscd summary = A Name Service Caching Daemon (nscd). description Nscd caches name service lookups and can dramatically improve performance with NIS+, and may help with DNS as well. end group = System/Daemons files /usr/sbin/nscd end end package %{name}-utils summary = Development utilities from GNU C library. description The glibc-utils package contains memusage, a memory usage profiler, mtrace, a memory leak tracer and xtrace, a function call tracer which can be helpful during program debugging. end group = Development/Tools files /usr/bin/memusage /usr/bin/memusagestat /usr/bin/mtrace /usr/bin/pcprofiledump /usr/bin/xtrace %{libdir}/libmemusage.so %{libdir}/libpcprofile.so end end package %{name}-debuginfo template DEBUGINFO end end