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