]>
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 |
08884d73 | 7 | version = 2.16.0 |
4834f4e8 | 8 | release = 4 |
802ea3af MT |
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 | |
166a6c21 | 23 | Linux system will not function. |
802ea3af MT |
24 | end |
25 | ||
e4c5e530 | 26 | # The version of the ports addon. |
08884d73 | 27 | ports_version = 2.16.0 |
e4c5e530 | 28 | |
802ea3af | 29 | source_dl = http://ftp.gnu.org/gnu/glibc/ |
08884d73 | 30 | sources = %{thisapp}.tar.xz glibc-ports-%{ports_version}.tar.xz |
802ea3af MT |
31 | |
32 | build | |
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 | 157 | --enable-bind-now \ |
4834f4e8 MT |
158 | --enable-nss-crypt \ |
159 | --enable-obsolete-rpc | |
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 | ||
802ea3af MT |
211 | # Configuration |
212 | cp -vf %{DIR_SOURCE}/{ld.so.conf,nsswitch.conf} %{BUILDROOT}/etc | |
213 | mkdir -pv %{BUILDROOT}/etc/{default,ld.so.conf.d} | |
214 | install -p -m644 %{DIR_APP}/nis/nss %{BUILDROOT}/etc/default/nss | |
215 | ||
08884d73 MT |
216 | if [ "%{DISTRO_ARCH}" = "armv7hl" ]; then |
217 | ln -svf ld-linux-armhf.so.3 %{BUILDROOT}/lib/ld-linux.so.3 | |
218 | fi | |
219 | ||
802ea3af MT |
220 | # Remove unused binaries |
221 | rm -vf %{BUILDROOT}/sbin/sln \ | |
222 | %{BUILDROOT}/usr/bin/rpcinfo | |
223 | ||
224 | # Don't distribute linker cache | |
225 | rm -vf %{BUILDROOT}/etc/ld.so.cache | |
226 | ||
227 | # Include /usr/lib/gconv/gconv-modules.cache | |
706fb4da MT |
228 | > %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache |
229 | chmod 644 %{BUILDROOT}%{libdir}/gconv/gconv-modules.cache | |
802ea3af | 230 | |
706fb4da | 231 | strip -g %{BUILDROOT}%{libdir}/*.o |
802ea3af MT |
232 | |
233 | # Move some libs to correct place | |
706fb4da | 234 | mv -v %{BUILDROOT}/%{lib}/lib{memusage,pcprofile}.so %{BUILDROOT}%{libdir} |
4b31eadd MT |
235 | |
236 | # Fix library permissions. | |
237 | chmod 755 %{BUILDROOT}%{libdir}/lib*.so* | |
802ea3af | 238 | end |
8a3a777f MT |
239 | |
240 | keep_libraries | |
706fb4da MT |
241 | %{libdir}/libc_nonshared.a |
242 | %{libdir}/libpthread_nonshared.a | |
8a3a777f | 243 | end |
802ea3af MT |
244 | end |
245 | ||
246 | packages | |
247 | package glibc | |
1262a291 | 248 | requires = glibc-common = %{thisver} |
08884d73 MT |
249 | |
250 | if "%{DISTRO_ARCH}" == "armv7hl" | |
251 | provides += ld-linux.so.3 | |
252 | provides += ld-linux.so.3(GLIBC_2.4) | |
3bece620 | 253 | provides += ld-linux.so.3(GLIBC_PRIVATE) |
08884d73 | 254 | end |
802ea3af MT |
255 | end |
256 | ||
257 | package glibc-common | |
258 | # XXX description and summary are missing | |
259 | ||
1262a291 MT |
260 | requires |
261 | glibc = %{thisver} | |
262 | tzdata | |
263 | end | |
b0f38bbb | 264 | |
802ea3af MT |
265 | files |
266 | /usr/bin | |
267 | /usr/sbin | |
268 | /usr/share | |
20580800 | 269 | /usr/lib/locale |
802ea3af MT |
270 | !/usr/share/zoneinfo |
271 | end | |
272 | end | |
273 | ||
274 | package glibc-devel | |
275 | summary = Object files for development using standard C libraries. | |
276 | description | |
277 | The glibc-devel package contains the object files necessary | |
278 | for developing programs which use the standard C libraries (which are | |
279 | used by nearly all programs). If you are developing programs which | |
280 | will use the standard C libraries, your system needs to have these | |
281 | standard object files available in order to create the | |
282 | executables. | |
283 | ||
284 | Install glibc-devel if you are going to develop programs which will | |
285 | use the standard C libraries. | |
286 | end | |
287 | group = Development/Libraries | |
288 | ||
1262a291 MT |
289 | requires |
290 | glibc = %{thisver} | |
291 | glibc-headers = %{thisver} | |
292 | end | |
802ea3af | 293 | |
08884d73 MT |
294 | files |
295 | %{includedir} | |
296 | %{libdir}/*.a | |
297 | %{libdir}/*.o | |
298 | end | |
802ea3af MT |
299 | end |
300 | ||
301 | package glibc-headers | |
302 | description | |
303 | The glibc-headers package contains the header files necessary | |
304 | for developing programs which use the standard C libraries (which are | |
305 | used by nearly all programs). If you are developing programs which | |
306 | will use the standard C libraries, your system needs to have these | |
307 | standard header files available in order to create the | |
308 | executables. | |
309 | ||
310 | Install glibc-headers if you are going to develop programs which will | |
311 | use the standard C libraries. | |
312 | end | |
313 | ||
1262a291 MT |
314 | requires |
315 | glibc = %{thisver} | |
316 | kernel-headers >= %{OPTIMIZED_KERNEL} | |
317 | end | |
802ea3af MT |
318 | |
319 | files | |
320 | /usr/include | |
321 | !/usr/include/linuxthreads | |
322 | !/usr/include/gnu/stubs-[32164]*.h | |
323 | end | |
324 | end | |
325 | ||
326 | package nscd | |
327 | summary = A Name Service Caching Daemon (nscd). | |
328 | description | |
329 | Nscd caches name service lookups and can dramatically improve | |
330 | performance with NIS+, and may help with DNS as well. | |
331 | end | |
332 | group = System/Daemons | |
333 | ||
334 | files | |
335 | /usr/sbin/nscd | |
336 | end | |
337 | end | |
338 | ||
339 | package %{name}-utils | |
340 | summary = Development utilities from GNU C library. | |
341 | description | |
342 | The glibc-utils package contains memusage, a memory usage profiler, | |
343 | mtrace, a memory leak tracer and xtrace, a function call tracer | |
344 | which can be helpful during program debugging. | |
345 | end | |
346 | group = Development/Tools | |
347 | ||
348 | files | |
349 | /usr/bin/memusage | |
350 | /usr/bin/memusagestat | |
351 | /usr/bin/mtrace | |
352 | /usr/bin/pcprofiledump | |
353 | /usr/bin/xtrace | |
706fb4da MT |
354 | %{libdir}/libmemusage.so |
355 | %{libdir}/libpcprofile.so | |
802ea3af MT |
356 | end |
357 | end | |
1f9bc2f0 MT |
358 | |
359 | package %{name}-debuginfo | |
360 | template DEBUGINFO | |
361 | end | |
802ea3af | 362 | end |