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