############################################################################### # IPFire.org - An Open Source Firewall Solution # # Copyright (C) - IPFire Development Team # ############################################################################### name = glibc version = 2.29 release = 1 maintainer = Michael Tremer groups = System/Base url = http://www.gnu.org/software/libc/libc.html 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 = https://ftp.gnu.org/gnu/glibc/ sources = %{thisapp}.tar.xz build # Optimize glibc for kernel OPTIMIZED_KERNEL = 3.2 requires autoconf automake binutils >= 2.29 bison gcc >= 8 gettext kernel-headers >= %{OPTIMIZED_KERNEL} libcap-devel libstdc++-static make >= 4.0 python3 >= 3.4 texinfo end # Build glibc with custom cflags GLIBC_FLAGS = -O2 -g -DNDEBUG -pipe 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 sed -e "/^install.*pt_chown/d" -i login/Makefile # Build nscd with -fstack-protector-all, instead of -fstack-protector: sed -e "s/fstack-protector/&-strong/" -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 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} \ --disable-werror \ --enable-stack-protector=strong \ --enable-bind-now \ --enable-obsolete-rpc \ --with-bugurl=http://bugtracker.ipfire.org \ --enable-lock-elision \ --enable-cet 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} 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}/libmvec_nonshared.a %{libdir}/libpthread_nonshared.a end end packages package glibc 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 requires tzdata end conflicts kernel < %{OPTIMIZED_KERNEL} end obsoletes glibc-common < %{thisver} end end package glibc-devel template DEVEL requires glibc = %{thisver} glibc-headers = %{thisver} kernel-headers >= %{OPTIMIZED_KERNEL} end provides glibc-headers = %{thisver} end obsoletes glibc-headers < %{thisver} end files += %{libdir}/*.[ao] 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