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