1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 maintainer = Michael Tremer <michael.tremer@ipfire.org>
12 url = http://sources.redhat.com/glibc/
13 license = GPLv2+ LGPLv2+
14 summary = The GNU libc libraries.
17 The glibc package contains standard libraries which are used by
18 multiple programs on the system. In order to save disk space and
19 memory, as well as to make upgrading easier, common system code is
20 kept in one place and shared between programs. This particular package
21 contains the most important sets of shared libraries: the standard C
22 library and the standard math library. Without these two libraries, a
23 Linux system will not function.
26 source_dl = http://ftp.gnu.org/gnu/glibc/
27 sources = %{thisapp}.tar.xz
30 # Optimize glibc for kernel
31 OPTIMIZED_KERNEL = 2.6.32
38 kernel-headers >= %{OPTIMIZED_KERNEL}
45 # Build glibc with custom cflags
46 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -fPIC -DPIC
48 if "%{DISTRO_ARCH}" == "i686"
49 GLIBC_FLAGS += -march=i686 -mtune=generic
52 if "%{DISTRO_ARCH}" == "x86_64"
53 GLIBC_FLAGS += -mtune=generic
56 export CFLAGS = %{GLIBC_FLAGS}
57 export CXXFLAGS = %{GLIBC_FLAGS}
59 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
62 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
63 # unknown whether this is a bash bug or a Glibc problem. Disable
64 # installation of this locale in order to avoid the problem.
65 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
67 # The ldd shell script contains Bash-specific syntax. Change its default
68 # program interpreter to /bin/bash in case another /bin/sh is installed.
69 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
71 # We don't install pt_chown(1) on the final system, so why install it to
73 sed -e "/^install.*pt_chown/d" -i login/Makefile
75 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
76 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
78 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
82 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
84 # http://sourceware.org/ml/libc-ports/2011-09/msg00018.html
85 sed -e "s/PIC/SHARED/g" -i ports/sysdeps/arm/{set,__long}jmp.S
89 --build=%{DISTRO_BUILDTARGET} \
91 --libexecdir=%{libdir}/glibc \
94 --enable-kernel=%{OPTIMIZED_KERNEL} \
99 --enable-obsolete-rpc \
100 --with-bugurl=http://bugtracker.ipfire.org
102 if "%{DISTRO_ARCH}" == "armv5tel"
103 # Disable hardware FP for ARM.
104 configure_options += \
109 mkdir -p %{DIR_SRC}/glibc-build
110 cd %{DIR_SRC}/glibc-build
112 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
113 ../%{thisapp}/configure \
117 -e "s/^build-pic-default=.*/build-pic-default=yes/"
119 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
120 # LDFLAGS.so is appended to so we don't build shared libraries with
121 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
122 # the libraries, not the programs:
123 echo "build-programs=no" >> configparms
125 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
126 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
127 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
129 # Then build the programs with hardening, so everything possible in
131 echo "# Nothing in here :D" > configparms
132 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
133 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
137 cd %{DIR_SRC}/glibc-build
138 make install install_root=%{BUILDROOT}
141 mkdir -pv %{BUILDROOT}/usr/lib/locale
142 # This would install all locales that are supported
143 make localedata/install-locales install_root=%{BUILDROOT}
146 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
147 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
148 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
150 if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then
151 ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3
154 # Remove unused binaries
155 rm -vf %{BUILDROOT}/sbin/sln \
156 %{BUILDROOT}/usr/bin/rpcinfo
158 # Don't distribute linker cache
159 rm -vf %{BUILDROOT}/etc/ld.so.cache
161 # Include /usr/lib/gconv/gconv-modules.cache
162 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
163 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
165 strip -g %{BUILDROOT}%{libdir}/*.o
167 # Move some libs to correct place
168 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
170 # Fix library permissions.
171 chmod 755 %{BUILDROOT}%{libdir}/lib*.so*
175 %{libdir}/libc_nonshared.a
176 %{libdir}/libpthread_nonshared.a
182 requires = glibc-common = %{thisver}
184 if "%{DISTRO_ARCH}" == "armv7hl"
185 provides += ld-linux.so.3
186 provides += ld-linux.so.3(GLIBC_2.4)
187 provides += ld-linux.so.3(GLIBC_PRIVATE)
192 # XXX description and summary are missing
209 summary = Object files for development using standard C libraries.
211 The glibc-devel package contains the object files necessary
212 for developing programs which use the standard C libraries (which are
213 used by nearly all programs). If you are developing programs which
214 will use the standard C libraries, your system needs to have these
215 standard object files available in order to create the
218 Install glibc-devel if you are going to develop programs which will
219 use the standard C libraries.
221 group = Development/Libraries
225 glibc-headers = %{thisver}
235 package glibc-headers
237 The glibc-headers package contains the header files necessary
238 for developing programs which use the standard C libraries (which are
239 used by nearly all programs). If you are developing programs which
240 will use the standard C libraries, your system needs to have these
241 standard header files available in order to create the
244 Install glibc-headers if you are going to develop programs which will
245 use the standard C libraries.
250 kernel-headers >= %{OPTIMIZED_KERNEL}
255 !/usr/include/linuxthreads
256 !/usr/include/gnu/stubs-[32164]*.h
261 summary = A Name Service Caching Daemon (nscd).
263 Nscd caches name service lookups and can dramatically improve
264 performance with NIS+, and may help with DNS as well.
266 group = System/Daemons
273 package %{name}-utils
274 summary = Development utilities from GNU C library.
276 The glibc-utils package contains memusage, a memory usage profiler,
277 mtrace, a memory leak tracer and xtrace, a function call tracer
278 which can be helpful during program debugging.
280 group = Development/Tools
284 /usr/bin/memusagestat
286 /usr/bin/pcprofiledump
288 %{libdir}/libmemusage.so
289 %{libdir}/libpcprofile.so
293 package %{name}-debuginfo