]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - glibc/glibc.nm
glibc: Make sure that all subpackages are the same version.
[people/ms/ipfire-3.x.git] / glibc / glibc.nm
CommitLineData
166a6c21 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
166a6c21
MT
4###############################################################################
5
802ea3af 6name = glibc
08884d73 7version = 2.16.0
1262a291 8release = 2
802ea3af
MT
9
10maintainer = Michael Tremer <michael.tremer@ipfire.org>
11groups = System/Base
12url = http://sources.redhat.com/glibc/
13license = GPLv2+ LGPLv2+
14summary = The GNU libc libraries.
15
16description
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
166a6c21 23 Linux system will not function.
802ea3af
MT
24end
25
e4c5e530 26# The version of the ports addon.
08884d73 27ports_version = 2.16.0
e4c5e530 28
802ea3af 29source_dl = http://ftp.gnu.org/gnu/glibc/
08884d73 30sources = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz
802ea3af
MT
31
32build
16cbb54b
MT
33 # Optimize glibc for kernel
34 OPTIMIZED_KERNEL = 2.6.32
35
802ea3af 36 requires
eec2ad4c 37 audit-devel
7f98fc96
MT
38 autoconf
39 automake
eec2ad4c 40 gettext
16cbb54b 41 kernel-headers>=%{OPTIMIZED_KERNEL}
802ea3af
MT
42 libcap-devel
43 libselinux-devel
eec2ad4c 44 nss-devel
7f98fc96 45 texinfo
802ea3af
MT
46 end
47
48 # Build glibc with custom cflags
706fb4da 49 GLIBC_FLAGS = -O3 -g -fasynchronous-unwind-tables -DNDEBUG -fPIC -DPIC
802ea3af
MT
50
51 if "%{DISTRO_ARCH}" == "i686"
52 GLIBC_FLAGS += -march=i686 -mtune=generic
706fb4da
MT
53 end
54
55 if "%{DISTRO_ARCH}" == "x86_64"
802ea3af
MT
56 GLIBC_FLAGS += -mtune=generic
57 end
58
59 export CFLAGS = %{GLIBC_FLAGS}
60 export CXXFLAGS = %{GLIBC_FLAGS}
61
802ea3af
MT
62 export QUALITY_AGENT_RPATH_ALLOW_ORIGIN=yes
63
a778217f
MT
64 prepare
65 # Extract source tarballs.
66 %{MACRO_EXTRACT_TARBALL}
67
68 # Create link for ports addon.
e4c5e530
MT
69 ln -svf ../glibc-ports-%{ports_version} ports
70
a778217f
MT
71 # Apply the patches.
72 %{MACRO_PATCHES}
73
802ea3af
MT
74 # In the vi_VN.TCVN locale, bash enters an infinite loop at startup. It is
75 # unknown whether this is a bash bug or a Glibc problem. Disable
76 # installation of this locale in order to avoid the problem.
77 sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED
78
79 # The ldd shell script contains Bash-specific syntax. Change its default
80 # program interpreter to /bin/bash in case another /bin/sh is installed.
81 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
82
83 # We don't install pt_chown(1) on the final system, so why install it to
84 # $(TOOLS_DIR):
85 sed -e "/^install.*pt_chown/d" -i login/Makefile
86
87 # Build nscd with -fstack-protector-all, instead of -fstack-protector:
88 sed -e "s/fstack-protector/&-all/" -i nscd/Makefile
89
90 cat %{DIR_SOURCE}/glibc-stack_chk_fail.c > debug/stack_chk_fail.c
91
92 # Use gnu hash style
93 sed -i Makeconfig \
94 -e "s/-Wl,--hash-style=both/-Wl,--hash-style=gnu -Wl,-O1/"
95
96 # stdlib/tst-putenvmod is not linked against libc.
97 sed -i stdlib/Makefile \
98 -e "s/^CFLAGS-tst-putenvmod.c.*/& -fno-stack-protector/g"
99
100 # stdio-common/bug22 hits timeout.
101 sed -i stdio-common/bug22.c \
102 -e "s/#define TIMEOUT.*/#define TIMEOUT 300/"
103
104 # These tests don't work or need more investigation:
105 sed -i dlfcn/Makefile -e "s/default //g"
106
107 sed -i nptl/Makefile \
108 -e "s/tst-mutex5 //g" \
109 -e "s/tst-mutex5a //g" \
110 -e "s/tst-cond11 //g" \
111 -e "s/tst-rwlock6 //g" \
112 -e "s/tst-rwlock7 //g" \
113 -e "s/tst-sem5 //g" \
114 -e "s/tst-cancelx4 //g" \
115 -e "s/tst-cancelx5 //g" \
116 -e "s/tst-cancelx10 //g" \
117 -e "s/tst-cancelx18 //g" \
118 -e "s/tst-signal1 //g"
119
120 # These are known to fail on x86:
121 sed -i rt/Makefile \
122 -e "s/tst-cpuclock1 //g" \
123 -e "s/tst-cpuclock2 //g"
124
125 sed -i elf/Makefile \
126 -e "s/tst-tls1 //g" \
127 -e "s/tst-tls1-static //g" \
128 -e "s/tst-tls2 //g" \
129 -e "s/tst-tls2-static //g" \
130 -e "s/tst-tls3 //g" \
131 -e "s/resolvfail //g" \
132 -e "s/constload1 //g" \
133 -e "s/order //g" \
134 -e "s/lateglobal //g" \
135 -e "s/dblload //g" \
136 -e "s/dblunload //g" \
137 -e "s/reldep6 //g" \
138 -e "s/circleload1 //g" \
139 -e "s/tst-global1 //g" \
140 -e "s/tst-audit2 //g" \
141 -e "s/check-localplt //g" \
142 -e "s/check-localplt.out$$//g"
143
144 sed -i signal/Makefile \
145 -e "s/tst-sigset2//g"
146 end
147
e4c5e530
MT
148 configure_options = \
149 --build=%{DISTRO_BUILDTARGET} \
e4c5e530 150 --prefix=/usr \
706fb4da 151 --libexecdir=%{libdir}/glibc \
e4c5e530
MT
152 --disable-profile \
153 --enable-add-ons \
154 --enable-kernel=%{OPTIMIZED_KERNEL} \
155 --with-selinux \
156 --disable-werror \
eec2ad4c
MT
157 --enable-bind-now \
158 --enable-nss-crypt
e4c5e530
MT
159
160 if "%{DISTRO_ARCH}" == "armv5tel"
161 # Disable hardware FP for ARM.
162 configure_options += \
163 --without-fp
164 end
165
802ea3af 166 build
e4c5e530 167 mkdir -p %{DIR_SRC}/glibc-build
802ea3af
MT
168 cd %{DIR_SRC}/glibc-build
169
170 CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables" \
171 ../%{thisapp}/configure \
e4c5e530 172 %{configure_options}
70b63715 173
802ea3af
MT
174 sed -i config.make \
175 -e "s/^build-pic-default=.*/build-pic-default=yes/"
176
177 # Our GCC is already passing -fPIC, and that's all we want for the libraries.
178 # LDFLAGS.so is appended to so we don't build shared libraries with
179 # DT_TEXTREL (and to tell us if something goes wrong). For now we only build
180 # the libraries, not the programs:
181 echo "build-programs=no" >> configparms
182
183 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
184 CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
185 CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
186
187 # Then build the programs with hardening, so everything possible in
188 # is hardened:
189 echo "# Nothing in here :D" > configparms
190 make PARALLELMFLAGS=%{PARALLELISMFLAGS} \
191 CFLAGS="%{CFLAGS}" CXXFLAGS="%{CXXFLAGS}"
192 end
193
194 #test
195 # cd $(DIR_SRC)/glibc-build
196 # make check TIMEOUTFACTOR=16 \
197 # CFLAGS="%{CFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE" \
198 # CXXFLAGS="%{CXXFLAGS} -fno-stack-protector -U_FORTIFY_SOURCE"
199 #end
200
201 install
202 cd %{DIR_SRC}/glibc-build
203 make install install_root=%{BUILDROOT}
204
205 # Locales
206 mkdir -pv %{BUILDROOT}/usr/lib/locale
207 # This would install all locales that are supported
208 make localedata/install-locales install_root=%{BUILDROOT}
209
802ea3af
MT
210 # Configuration
211 cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc
212 mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d}
213 install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss
214
08884d73
MT
215 if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then
216 ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3
217 fi
218
802ea3af
MT
219 # Remove unused binaries
220 rm -vf %{BUILDROOT}/sbin/sln \
221 %{BUILDROOT}/usr/bin/rpcinfo
222
223 # Don't distribute linker cache
224 rm -vf %{BUILDROOT}/etc/ld.so.cache
225
226 # Include /usr/lib/gconv/gconv-modules.cache
706fb4da
MT
227 > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
228 chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache
802ea3af 229
706fb4da 230 strip -g %{BUILDROOT}%{libdir}/*.o
802ea3af
MT
231
232 # Move some libs to correct place
706fb4da 233 mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir}
4b31eadd
MT
234
235 # Fix library permissions.
236 chmod 755 %{BUILDROOT}%{libdir}/lib*.so*
802ea3af 237 end
8a3a777f
MT
238
239 keep_libraries
706fb4da
MT
240 %{libdir}/libc_nonshared.a
241 %{libdir}/libpthread_nonshared.a
8a3a777f 242 end
802ea3af
MT
243end
244
245packages
246 package glibc
1262a291 247 requires = glibc-common = %{thisver}
08884d73
MT
248
249 if "%{DISTRO_ARCH}" == "armv7hl"
250 provides += ld-linux.so.3
251 provides += ld-linux.so.3(GLIBC_2.4)
252 end
802ea3af
MT
253 end
254
255 package glibc-common
256 # XXX description and summary are missing
257
1262a291
MT
258 requires
259 glibc = %{thisver}
260 tzdata
261 end
b0f38bbb 262
802ea3af
MT
263 files
264 /usr/bin
265 /usr/sbin
266 /usr/share
20580800 267 /usr/lib/locale
802ea3af
MT
268 !/usr/share/zoneinfo
269 end
270 end
271
272 package glibc-devel
273 summary = Object files for development using standard C libraries.
274 description
275 The glibc-devel package contains the object files necessary
276 for developing programs which use the standard C libraries (which are
277 used by nearly all programs). If you are developing programs which
278 will use the standard C libraries, your system needs to have these
279 standard object files available in order to create the
280 executables.
281
282 Install glibc-devel if you are going to develop programs which will
283 use the standard C libraries.
284 end
285 group = Development/Libraries
286
1262a291
MT
287 requires
288 glibc = %{thisver}
289 glibc-headers = %{thisver}
290 end
802ea3af 291
08884d73
MT
292 files
293 %{includedir}
294 %{libdir}/*.a
295 %{libdir}/*.o
296 end
802ea3af
MT
297 end
298
299 package glibc-headers
300 description
301 The glibc-headers package contains the header files necessary
302 for developing programs which use the standard C libraries (which are
303 used by nearly all programs). If you are developing programs which
304 will use the standard C libraries, your system needs to have these
305 standard header files available in order to create the
306 executables.
307
308 Install glibc-headers if you are going to develop programs which will
309 use the standard C libraries.
310 end
311
1262a291
MT
312 requires
313 glibc = %{thisver}
314 kernel-headers >= %{OPTIMIZED_KERNEL}
315 end
802ea3af
MT
316
317 files
318 /usr/include
319 !/usr/include/linuxthreads
320 !/usr/include/gnu/stubs-[32164]*.h
321 end
322 end
323
324 package nscd
325 summary = A Name Service Caching Daemon (nscd).
326 description
327 Nscd caches name service lookups and can dramatically improve
328 performance with NIS+, and may help with DNS as well.
329 end
330 group = System/Daemons
331
332 files
333 /usr/sbin/nscd
334 end
335 end
336
337 package %{name}-utils
338 summary = Development utilities from GNU C library.
339 description
340 The glibc-utils package contains memusage, a memory usage profiler,
341 mtrace, a memory leak tracer and xtrace, a function call tracer
342 which can be helpful during program debugging.
343 end
344 group = Development/Tools
345
346 files
347 /usr/bin/memusage
348 /usr/bin/memusagestat
349 /usr/bin/mtrace
350 /usr/bin/pcprofiledump
351 /usr/bin/xtrace
706fb4da
MT
352 %{libdir}/libmemusage.so
353 %{libdir}/libpcprofile.so
802ea3af
MT
354 end
355 end
1f9bc2f0
MT
356
357 package %{name}-debuginfo
358 template DEBUGINFO
359 end
802ea3af 360end