1 |
# RH 2.2.4-20, SuSE 2.3.1-32 |
2 |
|
3 |
# <epoch>:<version>-<release> tags for glibc main package |
4 |
%define glibcversion 2.20 |
5 |
%define __glibcrelease 24 |
6 |
%define glibcepoch 6 |
7 |
|
8 |
# CVS snapshots of glibc |
9 |
%define RELEASE 1 |
10 |
%if %{RELEASE} |
11 |
%define source_package glibc-%{glibcversion} |
12 |
%define source_dir glibc-%{glibcversion} |
13 |
%define _glibcrelease %{__glibcrelease} |
14 |
%else |
15 |
%define snapshot 20081113 |
16 |
%define source_package glibc-%{glibcversion}-%{snapshot} |
17 |
%define source_dir glibc-%{glibcversion} |
18 |
%define _glibcrelease 0.%{snapshot}.%{__glibcrelease} |
19 |
%endif |
20 |
|
21 |
%define glibcrelease %mkrel %{_glibcrelease} |
22 |
|
23 |
# crypt blowfish support |
24 |
%define crypt_bf_ver 1.2 |
25 |
|
26 |
# Define "cross" to an architecture to which glibc is to be |
27 |
# cross-compiled |
28 |
%define build_cross 0 |
29 |
%{expand: %{?cross: %%global build_cross 1}} |
30 |
|
31 |
%if %{build_cross} |
32 |
%define target_cpu %{cross} |
33 |
%define cross_prefix cross-%{target_cpu}- |
34 |
%define _prefix /usr/%{target_cpu}-%{_real_vendor}-linux%{gnuext} |
35 |
%define cross_program_prefix %{target_cpu}-%{_real_vendor}-linux%{gnuext}- |
36 |
%define _exec_prefix %{_prefix} |
37 |
# brain damage alert: should not be needed imho |
38 |
# overriding _prefix and _exec_prefix should be enough |
39 |
%define _bindir %{_exec_prefix}/bin |
40 |
%define _sbindir %{_exec_prefix}/sbin |
41 |
%define _libexecdir %{_exec_prefix}/libexec |
42 |
%define _datadir %{_prefix}/share |
43 |
%define _sharedstatedir %{_prefix}/com |
44 |
%define _localstatedir %{_prefix}/var |
45 |
%define _lib lib |
46 |
%define _libdir %{_exec_prefix}/%{_lib} |
47 |
%define _slibdir %{_exec_prefix}/%{_lib} |
48 |
%define _slibdir32 %{_exec_prefix}/lib |
49 |
%define _includedir %{_prefix}/include |
50 |
%else |
51 |
%define gnuext %{_gnu} |
52 |
%define target_cpu %{_target_cpu} |
53 |
%define cross_prefix %{nil} |
54 |
%define cross_program_prefix %{nil} |
55 |
%define _slibdir /%{_lib} |
56 |
%define _slibdir32 /lib |
57 |
%endif |
58 |
|
59 |
# Define target (base) architecture |
60 |
%define arch %(echo %{target_cpu}|sed -e "s/\\(i.86\\|athlon\\)/i386/" -e "s/amd64/x86_64/") |
61 |
%define isarch() %(case " %* " in (*" %{arch} "*) echo 1;; (*) echo 0;; esac) |
62 |
|
63 |
%if %{build_cross} |
64 |
%if %isarch %arm |
65 |
%define gnuext -gnueabi |
66 |
%else |
67 |
%define gnuext -gnu |
68 |
%endif |
69 |
%endif |
70 |
|
71 |
# Define Xen arches to build with -mno-tls-direct-direct-seg-refs |
72 |
%define xenarches %{ix86} x86_64 |
73 |
|
74 |
# arches which requires glibc-port |
75 |
%define ports_arch %arm %mips |
76 |
|
77 |
# Define to build nscd with selinux support |
78 |
%define build_selinux 0 |
79 |
|
80 |
# Flag for build_pdf_doc: |
81 |
# 1 build glibc with PDF documentation |
82 |
# 0 don't build PDF glibc documentation (e.g. for bootstrap build) |
83 |
%define build_pdf_doc 0 |
84 |
|
85 |
# Enable checking by default for arches where we know tests all pass |
86 |
%define build_check 0 |
87 |
|
88 |
# Allow make check to fail only when running kernels where we know |
89 |
# tests must pass (no missing features or bugs in the kernel) |
90 |
%define check_min_kver 2.6.32 |
91 |
|
92 |
# Define to build a biarch package |
93 |
%define build_biarch 0 |
94 |
%if %isarch x86_64 mips64 mips64el |
95 |
%define build_biarch 1 |
96 |
%endif |
97 |
|
98 |
# Define to build glibc-debug package |
99 |
%define build_debug 1 |
100 |
%define _enable_debug_packages 1 |
101 |
%if "%{_enable_debug_packages}" == "1" |
102 |
%define build_debug 0 |
103 |
%endif |
104 |
|
105 |
# Define to bootstrap new glibc |
106 |
%define build_bootstrap 0 |
107 |
%{expand: %{!?build_cross_bootstrap: %global build_cross_bootstrap 0}} |
108 |
|
109 |
%define build_profile 1 |
110 |
%define build_nscd 1 |
111 |
%define build_doc 1 |
112 |
%define build_utils 1 |
113 |
%define build_i18ndata 1 |
114 |
%define build_timezone 0 |
115 |
|
116 |
# Disable a few defaults when cross-compiling a glibc |
117 |
%if %{build_cross} |
118 |
%define build_doc 0 |
119 |
%define build_pdf_doc 0 |
120 |
%define build_biarch 0 |
121 |
%define build_check 0 |
122 |
%define build_debug 0 |
123 |
%define build_nscd 0 |
124 |
%define build_profile 0 |
125 |
%define build_utils 0 |
126 |
%define build_i18ndata 0 |
127 |
%define build_timezone 0 |
128 |
%endif |
129 |
|
130 |
# Allow --with[out] <feature> at rpm command line build |
131 |
%{expand: %{?_without_PDF: %%global build_pdf_doc 0}} |
132 |
%{expand: %{?_without_CHECK: %%global build_check 0}} |
133 |
%{expand: %{?_without_UTILS: %%global build_utils 0}} |
134 |
%{expand: %{?_without_BOOTSTRAP:%%global build_bootstrap 0}} |
135 |
%{expand: %{?_with_PDF: %%global build_pdf_doc 1}} |
136 |
%{expand: %{?_with_CHECK: %%global build_check 1}} |
137 |
%{expand: %{?_with_UTILS: %%global build_utils 1}} |
138 |
%{expand: %{?_with_BOOTSTRAP: %%global build_bootstrap 1}} |
139 |
|
140 |
Summary: The GNU libc libraries |
141 |
Name: %{cross_prefix}glibc |
142 |
Version: %{glibcversion} |
143 |
Release: %{glibcrelease} |
144 |
Epoch: %{glibcepoch} |
145 |
License: LGPL |
146 |
Group: System/Libraries |
147 |
Url: http://www.gnu.org/software/libc/ |
148 |
|
149 |
# FSF source |
150 |
Source0: http://ftp.gnu.org/gnu/glibc/%{source_package}.tar.xz |
151 |
%if %{RELEASE} |
152 |
Source1: http://ftp.gnu.org/gnu/glibc/%{source_package}.tar.xz.sig |
153 |
%endif |
154 |
Source2: libc-lock.h |
155 |
|
156 |
Source4: glibc-find-requires.sh |
157 |
Source5: glibc-check.sh |
158 |
Source6: nscd.service |
159 |
Source7: nscd.socket |
160 |
Source8: nsswitch.conf |
161 |
Source9: nscd.conf |
162 |
|
163 |
# wrapper to avoid rpm circular dependencies |
164 |
Source14: glibc-post-wrapper.c |
165 |
|
166 |
# Blowfish support |
167 |
Source16: http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_ver}.tar.gz |
168 |
Source17: http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_ver}.tar.gz.sign |
169 |
Source18: http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/glibc/crypt_freesec.c |
170 |
Source19: http://cvsweb.openwall.com/cgi/cvsweb.cgi/~checkout~/Owl/packages/glibc/crypt_freesec.h |
171 |
|
172 |
%if %{build_cross} |
173 |
Autoreq: false |
174 |
Autoprov: false |
175 |
%else |
176 |
Provides: glibc-crypt_blowfish = %{crypt_bf_ver} |
177 |
Provides: should-restart = system |
178 |
%if %isarch %{xenarches} |
179 |
Obsoletes: %{name}-xen |
180 |
Provides: %{name}-xen |
181 |
%endif |
182 |
# The dynamic linker supports DT_GNU_HASH |
183 |
Provides: rtld(GNU_HASH) |
184 |
Autoreq: false |
185 |
%endif |
186 |
BuildRequires: patch |
187 |
BuildRequires: gettext |
188 |
BuildRequires: perl |
189 |
BuildRequires: kernel-userspace-headers |
190 |
BuildRequires: libstdc++-static-devel |
191 |
BuildRequires: hardlink |
192 |
%if %{build_selinux} |
193 |
BuildRequires: libselinux-devel >= 1.17.10 |
194 |
%endif |
195 |
# (tmb) force latest binutils |
196 |
BuildRequires: %{cross_prefix}binutils >= 2.20 |
197 |
# we need the static dash |
198 |
%define ash_bin /usr/bin/dash.static |
199 |
Requires(post): dash-static |
200 |
Requires: filesystem >= 2.1.9-18 |
201 |
# (tmb) force fixed gcc-4.9.1-2 |
202 |
BuildRequires: %{cross_prefix}gcc >= 4.9.1-2 |
203 |
%if !%{build_cross} |
204 |
%ifarch mips mipsel |
205 |
Provides: ld.so.1 |
206 |
%endif |
207 |
%endif |
208 |
|
209 |
# Old prelink versions brakes the system with glibc 2.11 |
210 |
Conflicts: prelink < 1:0.4.2-1.20091104.1 |
211 |
|
212 |
BuildRequires: texinfo |
213 |
BuildRequires: texinfo-tex |
214 |
%if %{build_pdf_doc} |
215 |
BuildRequires: texlive |
216 |
%endif |
217 |
%if %{build_utils} |
218 |
BuildRequires: gd-devel |
219 |
%endif |
220 |
BuildRequires: autoconf2.5 |
221 |
BuildRequires: libcap-devel |
222 |
BuildRequires: rpm-mageia-setup-build >= 1.147 |
223 |
BuildRequires: spec-helper >= 0.31.2 |
224 |
|
225 |
# make "localedef --add-to-archive" to follow symlink |
226 |
# safe to send ustream, need to be kept for locales |
227 |
Patch00: glibc-2.11.1-localedef-archive-follow-symlinks.patch |
228 |
|
229 |
# various path fix, according to usrmove |
230 |
Patch01: glibc-2.17-fhs-usrmove.patch |
231 |
Patch02: glibc-2.9-ldd-non-exec.patch |
232 |
# try to fallback on loading /lib/libnss_*.so.X.Y when the loading |
233 |
# of /lib/libnss_*.so.X failed. Should be dropped, IMHO. |
234 |
Patch04: glibc-2.17-nss-upgrade.patch |
235 |
|
236 |
Patch06: glibc-2.20-share-locale.patch |
237 |
# use xvt instead of xterm in xtrace.sh |
238 |
# cannot be pushed upstream as xvt is Ma* specific |
239 |
Patch09: glibc-2.2.4-xterm-xvt.patch |
240 |
|
241 |
# add transliteration for "COLON SIGN" |
242 |
# ( used for the money of money of san salvador ) |
243 |
Patch11: glibc-2.19-compat-EUR-currencies.patch |
244 |
|
245 |
# fix the chkconfig header, should be sent upstream |
246 |
Patch13: glibc-2.3.3-nscd-enable.patch |
247 |
|
248 |
# disable cache for hosts on nscd, as this is seen as insecure |
249 |
# if the system relie on reverse dns for security |
250 |
Patch14: glibc-2.9-nscd-no-host-cache.patch |
251 |
|
252 |
Patch17: glibc-2.18-i386-hwcapinfo.patch |
253 |
|
254 |
# add some new timezone for various cities |
255 |
# Halifax, Montreal, Johannesburg |
256 |
# should be sent upstream ( I guess ) |
257 |
Patch23: glibc-2.3.4-timezone.patch |
258 |
Patch24: glibc-2.10.1-biarch-cpp-defines.patch |
259 |
Patch26: glibc-2.17-nice_fix.patch |
260 |
|
261 |
# fix a typo, safe to send upstream |
262 |
Patch27: glibc-2.20-ENOTTY-fr-translation.patch |
263 |
Patch29: glibc-2.3.5-biarch-utils.patch |
264 |
|
265 |
# remove multiarch header, Ma* specific patch |
266 |
# check if still needed or if the work was finished |
267 |
Patch30: glibc-2.17-multiarch.patch |
268 |
Patch31: glibc-2.20-i586-hptiming.patch |
269 |
|
270 |
# do not use i686 optimised library if the processor do not support |
271 |
# cmov ( some i686 cpu don't, from VIA iirc ) |
272 |
# shuld be sent upstream, IMHO |
273 |
Patch32: glibc-2.3.4-i586-if-no-cmov.patch |
274 |
|
275 |
# translation fixes, need to be checked with some i18n team member |
276 |
# should be safe to send upstream once checked |
277 |
Patch33: glibc-2.3.6-pt_BR-i18nfixes.patch |
278 |
Patch35: glibc-2.16.0-force-gb18030-for-zh_CN.patch |
279 |
|
280 |
# disable parallel testsuite of rt on powerpc with SMT |
281 |
Patch38: glibc-2.18-testsuite-rt-notparallel.patch |
282 |
# freesec crypt |
283 |
Patch39: glibc-2.17-mga-owl-crypt_freesec.patch |
284 |
Patch40: glibc-2.14.1-avx-relocate_fcrypt.patch |
285 |
Patch41: glibc-2.14.1-avx-increase_BF_FRAME.patch |
286 |
Patch42: glibc-2.20-mga-avx-owl-crypt.patch |
287 |
|
288 |
# add support for sha256 and sha512 in crypt |
289 |
# likely coming from owl |
290 |
Patch43: glibc-2.16.0-mga-wrapper_handle_sha.patch |
291 |
|
292 |
# check for libcap, even if selinux is disabled |
293 |
# should be sent upstream |
294 |
Patch44: glibc-2.19-dont-tie-libcap-with-selinux.patch |
295 |
|
296 |
# change page size to 16k. mandatory for loongson |
297 |
# but not necessary a good idea for other socs |
298 |
Patch46: glibc-2.20-mips_16k_page_size.patch |
299 |
|
300 |
Patch50: crypt_blowfish_arm.patch |
301 |
|
302 |
### upstream glibc 2.20 branch fixes |
303 |
Patch101: 101-Update-Russian-translation.patch |
304 |
Patch102: 102-Add-new-Linux-3.16-constants-to-netinet-udp.h.patch |
305 |
Patch103: 103-Handle-zero-prefix-length-in-getifaddrs-BZ-17371.patch |
306 |
Patch104: 104-Revert-to-defining-__extern_inline-only-for-gcc-4.3-.patch |
307 |
Patch105: 105-Fix-memory-leak-in-libio-wfileops.c-do_ftell_wide-BZ.patch |
308 |
Patch106: 106-Fix-memory-leak-in-error-path-of-do_ftell_wide-BZ-17.patch |
309 |
Patch107: 107-Update-French-translation.patch |
310 |
Patch108: 108-BZ-17460-Fix-buffer-overrun-in-nscd-help.patch |
311 |
Patch109: 109-MIPS-Avoid-a-dangling-vfork-GLIBC_2.0-reference.patch |
312 |
Patch110: 110-AArch64-End-frame-record-chain-correctly.patch |
313 |
Patch111: 111-CVE-2014-7817-wordexp-fails-to-honour-WRDE_NOCMD.patch |
314 |
Patch112: 112-Make-__extern_always_inline-usable-on-clang-again.patch |
315 |
Patch113: 113-CVE-2012-3406-Stack-overflow-in-vfprintf-BZ-16617.patch |
316 |
Patch114: 114-CVE-2014-9402-Avoid-infinite-loop-in-nss_dns-getnetbyname-BZ-17630.patch |
317 |
Patch115: 115-Move-findidx-nested-functions-to-top-level.patch |
318 |
# CVE-2015-8982 |
319 |
Patch116: 116-Fix-memory-handling-in-strxfrm_l-BZ-16009.patch |
320 |
Patch117: 117-Use-AVX-unaligned-memcpy-only-if-AVX2-is-available.patch |
321 |
Patch118: 118-CVE-2015-1472-wscanf-allocates-too-little-memory.patch |
322 |
# CVE-2015-8983 |
323 |
Patch119: 119-Fix-BZ-17269-_IO_wstr_overflow-integer-overflow.patch |
324 |
# CVE-2015-8984 |
325 |
Patch120: 120-Fix-read-past-end-of-pattern-in-fnmatch-bug-18032.patch |
326 |
# CVE-2015-1781 |
327 |
Patch121: 121-glibc-2.20-CVE-2015-1781-resolv-nss_dns-dns-host.c-buffer-overf.patch |
328 |
# CVE-2014-8121 |
329 |
Patch122: 122-CVE-2014-8121-Do-not-close-NSS-files-database-during.patch |
330 |
# CVE-2015-8777 |
331 |
Patch123: 123-CVE-2015-8777-Always-enable-pointer-guard-BZ-18928.patch |
332 |
# CVE-2015-8776 |
333 |
Patch124: 124-CVE-2015-8776-Fix-BZ-18985-out-of-range-data-to-strftime-causes-a-.patch |
334 |
# CVE-2015-8778 |
335 |
Patch125: 125-CVE-2015-8778-Handle-overflow-in-__hcreate_r.patch |
336 |
Patch126: 126-CVE-2015-8778-Improve-check-against-integer-wraparound-in-hcreate_.patch |
337 |
# CVE-2015-8779 |
338 |
Patch127: 127-CVE-2015-8779-catopen-Multiple-unbounded-stack-allocations.patch |
339 |
# CVE-2014-9761 |
340 |
Patch128: 128-CVE-2014-9761-Refactor-strtod-parsing-of-NaN-payloads.patch |
341 |
Patch129: 129-CVE-2014-9761-Fix-nan-functions-handling-of-payload-strings-bug-16.patch |
342 |
# CVE-2015-7547 |
343 |
Patch130: 130-CVE-2015-7547-getaddrinfo-stack-based-buffer-overflo.patch |
344 |
# CVE-2016-3075 |
345 |
Patch131: 131-CVE-2016-3075-Stack-overflow-in-_nss_dns_getnetbynam.patch |
346 |
# CVE-2016-1234 |
347 |
Patch132: 132-glob-Simplify-the-interface-for-the-GLOB_ALTDIRFUNC-.patch |
348 |
Patch133: 133-CVE-2016-1234-glob-Do-not-copy-d_name-field-of-struc.patch |
349 |
# CVE-2016-3706 |
350 |
Patch134: 134-CVE-2016-3706-getaddrinfo-stack-overflow-in-hostent-.patch |
351 |
# CVE-2016-4429 |
352 |
Patch135: 135-CVE-2016-4429-sunrpc-Do-not-use-alloca-in-clntudp_ca.patch |
353 |
# CVE-2016-5417 |
354 |
Patch136: 136-CVE-2016-5417-Fix-resource-leak-in-resolver-bug-19257.patch |
355 |
# CVE-2015-5180 |
356 |
Patch137: 137-CVE-2015-5180-resolv-Fix-crash-with-internal-QTYPE-B.patch |
357 |
|
358 |
### upstream fixes from glibc master branch |
359 |
Patch201: glibc-2.20-malloc-additional-unlink-hardening-for-non-small-bin.patch |
360 |
# disable elision as glibc breaks on intel microcode udate |
361 |
Patch202: glibc-2.20-disable-all-lock-elision-unless--enable-lock-elision-is-yes.patch |
362 |
# upstream (BZ #12926) |
363 |
Patch203: glibc-2.20-Fix-infinite-loop-in-check_pf.patch |
364 |
# upstream [BZ #15378] |
365 |
Patch204: glibc-2.20-elf-dl-load.c-open_path-Avoid-writing-to-env_path_list-when-none-of-search-dir-exists.patch |
366 |
# upstream [BZ #17250] |
367 |
Patch205: 205-BZ-17250-Fix-static-dlopen-default-library-search-pa.patch |
368 |
# upstream [BZ #19347] |
369 |
Patch206: 206-grantpt-trust-the-kernel-about-pty-group-and-permiss.patch |
370 |
|
371 |
# Determine minium kernel versions |
372 |
%define enablekernel 2.6.32 |
373 |
Conflicts: kernel < %{enablekernel} |
374 |
|
375 |
# conflict nicrocode that breaks lock elision |
376 |
Conflicts: microcode < 0.20140913-2 |
377 |
|
378 |
# People changed location of rpm scripts... |
379 |
%define rpmscripts /usr/lib/rpm/%{_real_vendor} |
380 |
|
381 |
# Don't try to explicitly provide GLIBC_PRIVATE versioned libraries |
382 |
%define __find_provides %{_builddir}/%{source_dir}/find_provides.sh |
383 |
%define __find_requires %{_builddir}/%{source_dir}/find_requires.sh |
384 |
|
385 |
%if !%{build_cross} |
386 |
Obsoletes: ld.so |
387 |
Provides: ld.so |
388 |
%endif |
389 |
|
390 |
Obsoletes: ldconfig |
391 |
Provides: ldconfig = %{glibcepoch}:%{glibcversion}-%{glibcrelease} /sbin/ldconfig |
392 |
# obsolete nss_db as it got merged again in 2.15 |
393 |
Obsoletes: nss_db <= 2.2.3-0.pre1.9 |
394 |
|
395 |
%description |
396 |
The glibc package contains standard libraries which are used by |
397 |
multiple programs on the system. In order to save disk space and |
398 |
memory, as well as to make upgrading easier, common system code is |
399 |
kept in one place and shared between programs. This particular package |
400 |
contains the most important sets of shared libraries: the standard C |
401 |
library and the standard math library. Without these two libraries, a |
402 |
Linux system will not function. The glibc package also contains |
403 |
national language (locale) support. |
404 |
|
405 |
This package now also provides ldconfig which was package seperately in |
406 |
the past. Ldconfig is a basic system program which determines run-time |
407 |
link bindings between ld.so and shared libraries. Ldconfig scans a running |
408 |
system and sets up the symbolic links that are used to load shared |
409 |
libraries properly. It also creates a cache (/etc/ld.so.cache) which |
410 |
speeds the loading of programs which use shared libraries. |
411 |
|
412 |
%package devel |
413 |
Summary: Header and object files for development using standard C libraries |
414 |
Group: Development/C |
415 |
Requires(post): info-install |
416 |
Requires(preun): info-install |
417 |
Requires(post): coreutils |
418 |
Requires(postun): coreutils, awk |
419 |
Obsoletes: libc-debug, libc-headers, libc-devel, linuxthreads-devel, nptl-devel |
420 |
%if !%{build_debug} |
421 |
Obsoletes: %{name}-debug < 6:2.3.2-15 |
422 |
%endif |
423 |
Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease} |
424 |
%if !%{build_cross} |
425 |
Requires: linux-userspace-headers |
426 |
%endif |
427 |
%if %{build_cross} |
428 |
Autoreq: false |
429 |
Autoprov: false |
430 |
%else |
431 |
Autoreq: true |
432 |
%endif |
433 |
Provides: glibc-crypt_blowfish-devel = %{crypt_bf_ver} |
434 |
|
435 |
%description devel |
436 |
The glibc-devel package contains the header and object files necessary |
437 |
for developing programs which use the standard C libraries (which are |
438 |
used by nearly all programs). If you are developing programs which |
439 |
will use the standard C libraries, your system needs to have these |
440 |
standard header and object files available in order to create the |
441 |
executables. |
442 |
|
443 |
This package also includes the C header files for the Linux kernel. |
444 |
The header files define structures and constants that are needed for |
445 |
building most standard programs. The header files are also needed for |
446 |
rebuilding the kernel. |
447 |
|
448 |
Install glibc-devel if you are going to develop programs which will |
449 |
use the standard C libraries. |
450 |
|
451 |
%package static-devel |
452 |
Summary: Static libraries for GNU C library |
453 |
Group: Development/C |
454 |
Requires: %{name}-devel = %{glibcepoch}:%{glibcversion}-%{glibcrelease} |
455 |
|
456 |
%description static-devel |
457 |
The glibc-static-devel package contains the static libraries necessary |
458 |
for developing programs which use the standard C libraries. Install |
459 |
glibc-static-devel if you need to statically link your program or |
460 |
library. |
461 |
|
462 |
%package profile |
463 |
Summary: The GNU libc libraries, including support for gprof profiling |
464 |
Group: Development/C |
465 |
Obsoletes: libc-profile |
466 |
Provides: libc-profile = %{glibcversion}-%{glibcrelease} |
467 |
Autoreq: true |
468 |
|
469 |
%description profile |
470 |
The glibc-profile package includes the GNU libc libraries and support |
471 |
for profiling using the gprof program. Profiling is analyzing a |
472 |
program's functions to see how much CPU time they use and determining |
473 |
which functions are calling other functions during execution. To use |
474 |
gprof to profile a program, your program needs to use the GNU libc |
475 |
libraries included in glibc-profile (instead of the standard GNU libc |
476 |
libraries included in the glibc package). |
477 |
|
478 |
If you are going to use the gprof program to profile a program, you'll |
479 |
need to install the glibc-profile program. |
480 |
|
481 |
%package -n nscd |
482 |
Summary: A Name Service Caching Daemon (nscd) |
483 |
Group: System/Servers |
484 |
Requires(post): systemd >= %{systemd_required_version} |
485 |
Requires(post): rpm-helper >= 0.24.8-1 |
486 |
Requires(preun): rpm-helper >= 0.24.8-1 |
487 |
Autoreq: true |
488 |
|
489 |
%description -n nscd |
490 |
Nscd caches name service lookups and can dramatically improve |
491 |
performance with NIS+, and may help with DNS as well. Note that you |
492 |
can't use nscd with 2.0 kernels because of bugs in the kernel-side |
493 |
thread support. Unfortunately, nscd happens to hit these bugs |
494 |
particularly hard. |
495 |
|
496 |
Install nscd if you need a name service lookup caching daemon, and |
497 |
you're not using a version 2.0 kernel. |
498 |
|
499 |
%if %{build_debug} |
500 |
%package debug |
501 |
Summary: Shared standard C libraries with debugging information |
502 |
Group: System/Libraries |
503 |
Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease} |
504 |
Autoreq: false |
505 |
|
506 |
%description debug |
507 |
The glibc-debug package contains shared standard C libraries with |
508 |
debugging information. You need this only if you want to step into C |
509 |
library routines during debugging. |
510 |
|
511 |
To use these libraries, you need to add %{_libdir}/debug to your |
512 |
LD_LIBRARY_PATH variable prior to starting the debugger. |
513 |
%endif |
514 |
|
515 |
%package utils |
516 |
Summary: Development utilities from GNU C library |
517 |
Group: Development/Other |
518 |
Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease} |
519 |
|
520 |
%description utils |
521 |
The glibc-utils package contains memusage, a memory usage profiler, |
522 |
mtrace, a memory leak tracer and xtrace, a function call tracer which |
523 |
can be helpful during program debugging. |
524 |
|
525 |
If unsure if you need this, don't install this package. |
526 |
|
527 |
%if %{build_i18ndata} |
528 |
%package i18ndata |
529 |
Summary: Database sources for 'locale' |
530 |
Group: System/Libraries |
531 |
|
532 |
%description i18ndata |
533 |
This package contains the data needed to build the locale data files |
534 |
to use the internationalization features of the GNU libc. |
535 |
%endif |
536 |
|
537 |
%if %{build_timezone} |
538 |
%package -n timezone |
539 |
Summary: Time zone descriptions |
540 |
Group: System/Base |
541 |
|
542 |
%description -n timezone |
543 |
These are configuration files that describe possible |
544 |
time zones. |
545 |
%endif |
546 |
|
547 |
%package doc |
548 |
Summary: GNU C library documentation |
549 |
Group: Development/Other |
550 |
BuildArch: noarch |
551 |
|
552 |
%description doc |
553 |
The glibc-doc package contains documentation for the GNU C library in |
554 |
info format. |
555 |
|
556 |
%if %{build_pdf_doc} |
557 |
%package doc-pdf |
558 |
Summary: GNU C library documentation |
559 |
Group: Development/Other |
560 |
BuildArch: noarch |
561 |
|
562 |
%description doc-pdf |
563 |
The glibc-doc-pdf package contains the printable documentation for the |
564 |
GNU C library in PDF format. |
565 |
%endif |
566 |
|
567 |
%prep |
568 |
%setup -q -n %{source_dir} -a 16 |
569 |
|
570 |
# upstream fixes from glibc 2.20 branch |
571 |
%patch101 -p1 -b .p101 |
572 |
%patch102 -p1 -b .p102 |
573 |
%patch103 -p1 -b .p103 |
574 |
%patch104 -p1 -b .p104 |
575 |
%patch105 -p1 -b .p105 |
576 |
%patch106 -p1 -b .p106 |
577 |
%patch107 -p1 -b .p107 |
578 |
%patch108 -p1 -b .p108 |
579 |
%patch109 -p1 -b .p109 |
580 |
%patch110 -p1 -b .p110 |
581 |
%patch111 -p1 -b .p111 |
582 |
%patch112 -p1 -b .p112 |
583 |
%patch113 -p1 -b .p113 |
584 |
%patch114 -p1 -b .p114 |
585 |
%patch115 -p1 -b .p115 |
586 |
%patch116 -p1 -b .p116 |
587 |
%patch117 -p1 -b .p117 |
588 |
%patch118 -p1 -b .p118 |
589 |
%patch119 -p1 -b .p119 |
590 |
%patch120 -p1 -b .p120 |
591 |
%patch121 -p1 -b .p121 |
592 |
%patch122 -p1 -b .p122 |
593 |
%patch123 -p1 -b .p123 |
594 |
%patch124 -p1 -b .p124 |
595 |
%patch125 -p1 -b .p125 |
596 |
%patch126 -p1 -b .p126 |
597 |
%patch127 -p1 -b .p127 |
598 |
%patch128 -p1 -b .p128 |
599 |
%patch129 -p1 -b .p129 |
600 |
%patch130 -p1 -b .p130 |
601 |
%patch131 -p1 -b .p131 |
602 |
%patch132 -p1 -b .p132 |
603 |
%patch133 -p1 -b .p133 |
604 |
%patch134 -p1 -b .p134 |
605 |
%patch135 -p1 -b .p135 |
606 |
%patch136 -p1 -b .p136 |
607 |
%patch137 -p1 -b .p137 |
608 |
|
609 |
# upstream fixes from glibc master branch |
610 |
%patch201 -p1 -b .p201 |
611 |
%patch202 -p1 -b .p202 |
612 |
%patch203 -p1 -b .p203 |
613 |
%patch204 -p1 -b .p204 |
614 |
%patch205 -p1 -b .p205 |
615 |
%patch206 -p1 -b .p206 |
616 |
|
617 |
# other patches |
618 |
%patch00 -p1 -b .localedef-archive-follow-symlinks |
619 |
%patch01 -p1 -b .fhs |
620 |
%patch02 -p1 -b .ldd-non-exec |
621 |
%patch04 -p1 -b .nss-upgrade |
622 |
%patch06 -p1 -b .share-locale |
623 |
%patch09 -p1 -b .xterm-xvt |
624 |
%patch11 -p1 -b .compat-EUR-currencies |
625 |
%patch13 -p1 -b .nscd-enable |
626 |
%patch14 -p1 -b .nscd-no-host-cache |
627 |
%patch17 -p1 -b .i386-hwcapinfo |
628 |
%patch23 -p1 -b .timezone |
629 |
%patch24 -p1 -b .biarch-cpp-defines |
630 |
%patch26 -p1 -b .nice-fix |
631 |
%patch27 -p1 -b .ENOTTY-fr-translation |
632 |
%patch29 -p1 -b .biarch-utils |
633 |
%patch30 -p1 -b .multiarch-check |
634 |
%patch31 -p1 -b .i586-hptiming |
635 |
%patch32 -p1 -b .i586-if-no-cmov |
636 |
%patch33 -p1 -b .pt_BR-i18nfixes |
637 |
%patch35 -p1 -b .zh_CN-charset-fixes |
638 |
%patch38 -p1 -b .testsuite-rt-notparallel |
639 |
%patch44 -p1 -b .dont-tie-libcap-with-selinux |
640 |
%patch46 -p1 -b .pagesize |
641 |
|
642 |
# copy freesec source |
643 |
cp %{_sourcedir}/crypt_freesec.[ch] crypt/ |
644 |
echo "Applying crypt_blowfish patch:" |
645 |
%patch42 -p1 -b .mga-avx-owl-crypt |
646 |
mv crypt/crypt.h crypt/gnu-crypt.h |
647 |
cp -a crypt_blowfish-%{crypt_bf_ver}/*.[chS] crypt/ |
648 |
|
649 |
# FreeSec support for extended/new-style/BSDI hashes in crypt(3) |
650 |
%patch39 -p1 -b .mga-owl-crypt_freesec |
651 |
%patch40 -p1 -b .avx-relocate_fcrypt |
652 |
%patch41 -p1 -b .avx-increase_BF_FRAME |
653 |
# add sha256-crypt and sha512-crypt support to the Openwall wrapper |
654 |
%patch43 -p1 -b .mga-wrapper_handle_sha |
655 |
%patch50 -p1 -b .crypt_arm_asm |
656 |
|
657 |
%if %{build_selinux} |
658 |
# XXX kludge to build nscd with selinux support as it added -nostdinc |
659 |
# so /usr/include/selinux is not found |
660 |
ln -s %{_includedir}/selinux selinux |
661 |
%endif |
662 |
|
663 |
find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \; |
664 |
|
665 |
# \\(Anssi 03/2008\\) FIXME: use __provides_exclude |
666 |
cat > find_provides.sh << EOF |
667 |
#!/bin/sh |
668 |
%{rpmscripts}/find-provides | grep -v GLIBC_PRIVATE |
669 |
exit 0 |
670 |
EOF |
671 |
chmod +x find_provides.sh |
672 |
|
673 |
cat > find_requires.bootstrap.sh << EOF |
674 |
/bin/sh %{SOURCE4} %{buildroot} %{_target_cpu} | grep -v "\(GLIBC_PRIVATE\|linux-gate\|linux-vdso\)" |
675 |
exit 0 |
676 |
EOF |
677 |
chmod +x find_requires.bootstrap.sh |
678 |
|
679 |
# XXX: use better way later to avoid LD_LIBRARY_PATH issue |
680 |
cat %{rpmscripts}/find-requires | sed '/.*LD_LIBRARY_PATH.*/d;' > find_requires |
681 |
chmod +x find_requires |
682 |
# \\(Anssi 03/2008\\) FIXME: use __requires_exclude |
683 |
cat > find_requires.noprivate.sh << EOF |
684 |
%{_builddir}/%{source_dir}/find_requires %{buildroot} %{_target_cpu} | \ |
685 |
grep -v GLIBC_PRIVATE |
686 |
exit 0 |
687 |
EOF |
688 |
chmod +x find_requires.noprivate.sh |
689 |
|
690 |
# FIXME: fix system rpm find-requires to use the prefix cross version |
691 |
%if %{build_bootstrap} || "%{_target_cpu}" != "%{target_cpu}" |
692 |
ln -s find_requires.bootstrap.sh find_requires.sh |
693 |
%else |
694 |
ln -s find_requires.noprivate.sh find_requires.sh |
695 |
%endif |
696 |
|
697 |
# Remove patch backups from files we ship in glibc packages |
698 |
rm -f ChangeLog.[^0-9]* |
699 |
rm -f localedata/locales/{???_??,??_??}.* |
700 |
rm -f localedata/locales/[a-z_]*.* |
701 |
|
702 |
%build |
703 |
# Prepare test matrix in the next function |
704 |
CheckList=$PWD/Check.list |
705 |
rm -f $CheckList |
706 |
touch $CheckList |
707 |
|
708 |
# |
709 |
# CompareKver <kernel version> |
710 |
# function to compare the desired kernel version with running kernel |
711 |
# version (package releases not taken into account in comparison). The |
712 |
# function returns: |
713 |
# -1 = <kernel version> is lesser than current running kernel |
714 |
# 0 = <kernel version> is equal to the current running kernel |
715 |
# 1 = <kernel version> is greater than current running kernel |
716 |
# |
717 |
function CompareKver() { |
718 |
v1=`echo $1 | sed 's/\.\?$/./'` |
719 |
v2=`uname -r | sed 's/[^.0-9].*//' | sed 's/\.\?$/./'` |
720 |
n=1 |
721 |
s=0 |
722 |
while true; do |
723 |
c1=`echo "$v1" | cut -d "." -f $n` |
724 |
c2=`echo "$v2" | cut -d "." -f $n` |
725 |
if [ -z "$c1" -a -z "$c2" ]; then |
726 |
break |
727 |
elif [ -z "$c1" ]; then |
728 |
s=-1 |
729 |
break |
730 |
elif [ -z "$c2" ]; then |
731 |
s=1 |
732 |
break |
733 |
elif [ "$c1" -gt "$c2" ]; then |
734 |
s=1 |
735 |
break |
736 |
elif [ "$c2" -gt "$c1" ]; then |
737 |
s=-1 |
738 |
break |
739 |
fi |
740 |
n=$((n + 1)) |
741 |
done |
742 |
echo $s |
743 |
} |
744 |
|
745 |
# |
746 |
# BuildGlibc <arch> [<extra_configure_options>+] |
747 |
# |
748 |
function BuildGlibc() { |
749 |
arch="$1" |
750 |
shift 1 |
751 |
|
752 |
# PowerPC CPU add-on |
753 |
case $arch in |
754 |
cpu-addon,*) |
755 |
cpu=` echo "$arch" | sed -n "/.*,\([^,]*\),.*$/s//\1/p"` |
756 |
arch=`echo "$arch" | sed -n "/.*,.*,\([^,]*\)$/s//\1/p"` |
757 |
;; |
758 |
*) |
759 |
cpu=$arch |
760 |
;; |
761 |
esac |
762 |
|
763 |
# Select optimization flags and compiler to use |
764 |
BuildAltArch="no" |
765 |
BuildCompFlags="" |
766 |
BuildFlags="" |
767 |
case $arch in |
768 |
i[3456]86 | athlon) |
769 |
BuildFlags="-march=$arch -mtune=generic" |
770 |
if [[ "`uname -m`" = "x86_64" ]]; then |
771 |
BuildAltArch="yes" |
772 |
BuildCompFlags="-m32" |
773 |
fi |
774 |
;; |
775 |
x86_64) |
776 |
BuildFlags="-mtune=generic" |
777 |
;; |
778 |
mips|mipsel) |
779 |
BuildFlags="-march=mips3" |
780 |
BuildCompFlags="-march=mips3" |
781 |
;; |
782 |
mips32|mips32el) |
783 |
BuildFlags="-march=mips3 -mabi=n32" |
784 |
BuildCompFlags="-march=mips3 -mabi=n32" |
785 |
;; |
786 |
mips64|mips64el) |
787 |
BuildFlags="-march=mips3 -mabi=64" |
788 |
BuildCompFlags="-march=mips3 -mabi=64" |
789 |
;; |
790 |
armv4t*) |
791 |
BuildFlags="-march=armv4t" |
792 |
BuildCompFlags="-march=armv4t" |
793 |
;; |
794 |
armv5t*) |
795 |
BuildFlags="-march=armv5t" |
796 |
BuildCompFlags="-march=armv5t" |
797 |
;; |
798 |
# to check |
799 |
armv7*) |
800 |
BuildFlags="-march=armv7-a" |
801 |
BuildCompFlags="-march=armv7-a" |
802 |
;; |
803 |
esac |
804 |
|
805 |
# Choose multiarch support |
806 |
MultiArchFlags= |
807 |
case $arch in |
808 |
i686 | x86_64) |
809 |
MultiArchFlags="--enable-multi-arch" |
810 |
;; |
811 |
esac |
812 |
|
813 |
# Determine C & C++ compilers |
814 |
BuildCC="%{__cc} $BuildCompFlags" |
815 |
BuildCXX="%{__cxx} $BuildCompFlags" |
816 |
|
817 |
# Are we supposed to cross-compile? |
818 |
if [[ "%{target_cpu}" != "%{_target_cpu}" ]]; then |
819 |
# Can't use BuildCC anymore with previous changes. |
820 |
BuildCC="%{cross_program_prefix}gcc $BuildCompFlags" |
821 |
BuildCXX="%{cross_program_prefix}g++ $BuildCompFlags" |
822 |
BuildCross="--build=%{_target_platform}" |
823 |
export libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes |
824 |
fi |
825 |
|
826 |
BuildFlags="$BuildFlags -DNDEBUG=1 -O2 -finline-functions -g" |
827 |
|
828 |
# Do not use direct references against %gs when accessing tls data |
829 |
# XXX make it the default in GCC? (for other non glibc specific usage) |
830 |
case $arch in |
831 |
i[3456]86 | x86_64) |
832 |
BuildFlags="$BuildFlags -mno-tls-direct-seg-refs" |
833 |
;; |
834 |
esac |
835 |
|
836 |
# Arch specific compilation flags |
837 |
if [[ "$arch" = "ppc64" ]]; then |
838 |
BuildFlags="$BuildFlags -fno-inline-functions -mno-minimal-toc" |
839 |
fi |
840 |
|
841 |
# Extra configure flags |
842 |
ExtraFlags= |
843 |
if [[ "%{build_profile}" != "0" ]]; then |
844 |
ExtraFlags="$ExtraFlags --enable-profile" |
845 |
fi |
846 |
|
847 |
# NPTL+TLS are now the default |
848 |
# check for other arches |
849 |
%if %isarch %ports_arch |
850 |
Pthreads="ports nptl" |
851 |
%else |
852 |
Pthreads="nptl" |
853 |
%endif |
854 |
|
855 |
# Add-ons |
856 |
AddOns="libidn" |
857 |
if [[ "$cpu" != "$arch" ]]; then |
858 |
AddOns="$AddOns,powerpc-cpu" |
859 |
BuildFlags="$BuildFlags -mcpu=$cpu" |
860 |
ExtraFlags="$ExtraFlags --with-cpu=$cpu" |
861 |
fi |
862 |
|
863 |
# Build with selinux support? |
864 |
%if %{build_selinux} |
865 |
SElinuxFlags="--with-selinux" |
866 |
%else |
867 |
SElinuxFlags="--without-selinux" |
868 |
%endif |
869 |
|
870 |
# Kernel headers directory |
871 |
KernelHeaders=%{_includedir} |
872 |
|
873 |
# Determine library name |
874 |
glibc_cv_cc_64bit_output=no |
875 |
if echo ".text" | $BuildCC -c -o test.o -xassembler -; then |
876 |
case `/usr/bin/file test.o` in |
877 |
*"ELF 64"*) |
878 |
glibc_cv_cc_64bit_output=yes |
879 |
;; |
880 |
esac |
881 |
fi |
882 |
rm -f test.o |
883 |
|
884 |
# Force a separate and clean object dir |
885 |
rm -rf build-$cpu-linux |
886 |
mkdir build-$cpu-linux |
887 |
pushd build-$cpu-linux |
888 |
[[ "$BuildAltArch" = "yes" ]] && touch ".alt" || touch ".main" |
889 |
CC="$BuildCC" CXX="$BuildCXX" CFLAGS="$BuildFlags" ../configure \ |
890 |
$arch-%{_real_vendor}-linux%{gnuext} $BuildCross \ |
891 |
--prefix=%{_prefix} \ |
892 |
--libexecdir=%{_prefix}/libexec \ |
893 |
--infodir=%{_infodir} \ |
894 |
--enable-add-ons="$AddOns" --without-cvs \ |
895 |
$ExtraFlags $MultiArchFlags $SElinuxFlags \ |
896 |
--enable-kernel=%{enablekernel} \ |
897 |
--with-headers=$KernelHeaders ${1+"$@"} \ |
898 |
--enable-obsolete-rpc |
899 |
%make -r -s |
900 |
popd |
901 |
|
902 |
# All tests are expected to pass on certain platforms, depending also |
903 |
# on the version of the kernel running |
904 |
case $arch in |
905 |
athlon | ia64 | ppc | ppc64) |
906 |
if [ "`CompareKver %{check_min_kver}`" -lt 0 ]; then |
907 |
check_flags="" |
908 |
else |
909 |
check_flags="-k" |
910 |
fi |
911 |
;; |
912 |
*) |
913 |
check_flags="-k" |
914 |
;; |
915 |
esac |
916 |
|
917 |
# Generate test matrix |
918 |
[[ -d "build-$arch-linux" ]] || { |
919 |
echo "ERROR: PrepareGlibcTest: build-$arch-linux does not exist!" |
920 |
return 1 |
921 |
} |
922 |
local BuildJobs="-j`getconf _NPROCESSORS_ONLN`" |
923 |
echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList |
924 |
|
925 |
case $cpu in |
926 |
i686|athlon) base_arch=i586;; |
927 |
power*) base_arch=$arch;; |
928 |
*) base_arch=none;; |
929 |
esac |
930 |
|
931 |
[[ -d "build-$base_arch-linux" ]] && { |
932 |
check_flags="$check_flags -l build-$base_arch-linux/elf/ld.so" |
933 |
echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList |
934 |
} |
935 |
return 0 |
936 |
} |
937 |
|
938 |
# Build main glibc |
939 |
BuildGlibc %{target_cpu} |
940 |
|
941 |
%if %{build_biarch} |
942 |
%if %isarch x86_64 |
943 |
BuildGlibc i686 |
944 |
%endif |
945 |
%endif |
946 |
%if %isarch mips |
947 |
BuildGlibc mips64 |
948 |
BuildGlibc mips32 |
949 |
%endif |
950 |
%if %isarch mipsel |
951 |
BuildGlibc mips64el |
952 |
BuildGlibc mips32el |
953 |
%endif |
954 |
%if %isarch mips64 |
955 |
BuildGlibc mips |
956 |
BuildGlibc mips32 |
957 |
%endif |
958 |
%if %isarch mips64el |
959 |
BuildGlibc mipsel |
960 |
BuildGlibc mips32el |
961 |
%endif |
962 |
|
963 |
# Build i686 libraries if not already building for i686/athlon |
964 |
case %{target_cpu} in |
965 |
i686 | athlon) |
966 |
;; |
967 |
i[3-6]86) |
968 |
BuildGlibc i686 --disable-profile |
969 |
;; |
970 |
esac |
971 |
|
972 |
make -C crypt_blowfish-%{crypt_bf_ver} man |
973 |
|
974 |
%if %{build_check} |
975 |
export TMPDIR=/tmp |
976 |
export TIMEOUTFACTOR=16 |
977 |
Check="$PWD/glibc-check.sh" |
978 |
cat %{SOURCE5} > $Check |
979 |
chmod +x $Check |
980 |
while read arglist; do |
981 |
$Check $arglist || exit 1 |
982 |
done < $CheckList |
983 |
%endif |
984 |
|
985 |
%install |
986 |
# force use of _NPROCESSORS_ONLN jobs since RPM_BUILD_NCPUS could be |
987 |
# greater for icecream |
988 |
BuildJobs="-j`getconf _NPROCESSORS_ONLN`" |
989 |
|
990 |
make install_root=$RPM_BUILD_ROOT install -C build-%{target_cpu}-linux |
991 |
%if %{build_i18ndata} |
992 |
(cd build-%{target_cpu}-linux; |
993 |
make $BuildJobs -C ../localedata objdir=`pwd` \ |
994 |
install_root=$RPM_BUILD_ROOT \ |
995 |
install-locales |
996 |
) |
997 |
install -m 0644 localedata/SUPPORTED $RPM_BUILD_ROOT/%{_datadir}/i18n/ |
998 |
%endif |
999 |
|
1000 |
# Empty filelist for non i686/athlon targets |
1001 |
> extralibs.filelist |
1002 |
|
1003 |
# Install biarch libraries |
1004 |
%if %{build_biarch} || %isarch mips mipsel |
1005 |
%if %isarch x86_64 |
1006 |
ALT_ARCHES=i686-linux |
1007 |
%endif |
1008 |
%if %isarch mips |
1009 |
ALT_ARCHES="mips64-linux mips32-linux" |
1010 |
%endif |
1011 |
%if %isarch mipsel |
1012 |
ALT_ARCHES="mips64el-linux mips32el-linux" |
1013 |
%endif |
1014 |
%if %isarch mips64 |
1015 |
ALT_ARCHES="mips-linux mips32-linux" |
1016 |
%endif |
1017 |
%if %isarch mips64el |
1018 |
ALT_ARCHES="mipsel-linux mips32el-linux" |
1019 |
%endif |
1020 |
|
1021 |
for ALT_ARCH in $ALT_ARCHES; do |
1022 |
mkdir -p $RPM_BUILD_ROOT/$ALT_ARCH |
1023 |
make install_root=$RPM_BUILD_ROOT/$ALT_ARCH install -C build-$ALT_ARCH |
1024 |
|
1025 |
# Dispatch */lib only |
1026 |
case "$ALT_ARCH" in |
1027 |
mips32*) |
1028 |
LIB="%{_slibdir}32" |
1029 |
;; |
1030 |
mips64*) |
1031 |
LIB="%{_slibdir}64" |
1032 |
;; |
1033 |
*) |
1034 |
LIB=/lib |
1035 |
;; |
1036 |
esac |
1037 |
%if !%{build_cross} |
1038 |
mv $RPM_BUILD_ROOT/$ALT_ARCH/$LIB $RPM_BUILD_ROOT/$LIB |
1039 |
mv $RPM_BUILD_ROOT/$ALT_ARCH%{_prefix}/libexec/getconf/* \ |
1040 |
$RPM_BUILD_ROOT%{_prefix}/libexec/getconf/ |
1041 |
[ ! -d $RPM_BUILD_ROOT/%{_prefix}/$LIB/ ] && mkdir -p $RPM_BUILD_ROOT/%{_prefix}/$LIB/ |
1042 |
mv $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/$LIB/* $RPM_BUILD_ROOT/%{_prefix}/$LIB/ |
1043 |
%else |
1044 |
mv $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/lib $RPM_BUILD_ROOT/$LIB |
1045 |
sed -i $RPM_BUILD_ROOT/$LIB/libc.so -e "s!%{_slibdir}!$LIB!g" |
1046 |
%endif |
1047 |
|
1048 |
rm -rf $RPM_BUILD_ROOT/$ALT_ARCH |
1049 |
# XXX Dispatch 32-bit stubs |
1050 |
(sed '/^@/d' include/stubs-prologue.h; LC_ALL=C sort $(find build-$ALT_ARCH -name stubs)) \ |
1051 |
> $RPM_BUILD_ROOT%{_includedir}/gnu/stubs-32.h |
1052 |
done |
1053 |
%endif |
1054 |
|
1055 |
# Install extra glibc libraries |
1056 |
function InstallGlibc() { |
1057 |
local BuildDir="$1" |
1058 |
local SubDir="$2" |
1059 |
local LibDir="$3" |
1060 |
|
1061 |
case $BuildDir in |
1062 |
*) Pthreads=nptl ;; |
1063 |
esac |
1064 |
|
1065 |
[[ -z "$LibDir" ]] && LibDir="%{_slibdir}" |
1066 |
|
1067 |
pushd $BuildDir |
1068 |
mkdir -p $RPM_BUILD_ROOT$LibDir/$SubDir/ |
1069 |
install -m755 libc.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc-*.so` |
1070 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libc-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc.so.*` |
1071 |
install -m755 math/libm.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm-*.so` |
1072 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libm-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm.so.*` |
1073 |
install -m755 $Pthreads/libpthread.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so` |
1074 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread.so.*` |
1075 |
install -m755 ${Pthreads}_db/libthread_db.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so` |
1076 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db.so.*` |
1077 |
install -m755 rt/librt.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt-*.so` |
1078 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/librt-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt.so.*` |
1079 |
echo "%dir $LibDir/$SubDir" >> ../extralibs.filelist |
1080 |
find $RPM_BUILD_ROOT$LibDir/$SubDir -maxdepth 1 -type f -o -type l | sed -e "s|$RPM_BUILD_ROOT||" >> ../extralibs.filelist |
1081 |
popd |
1082 |
} |
1083 |
|
1084 |
# Install arch-specific optimized libraries |
1085 |
%if %isarch %{ix86} |
1086 |
case %{target_cpu} in |
1087 |
i[3-5]86) |
1088 |
InstallGlibc build-i686-linux i686 |
1089 |
;; |
1090 |
esac |
1091 |
%endif |
1092 |
|
1093 |
# NPTL <bits/stdio-lock.h> is not usable outside of glibc, so include |
1094 |
# the generic one (RH#162634) |
1095 |
install -m644 bits/stdio-lock.h $RPM_BUILD_ROOT%{_includedir}/bits/stdio-lock.h |
1096 |
# And <bits/libc-lock.h> needs sanitizing as well. |
1097 |
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_includedir}/bits/libc-lock.h |
1098 |
|
1099 |
# Compatibility hack: this locale has vanished from glibc, but some other |
1100 |
# programs are still using it. Normally we would handle it in the %pre |
1101 |
# section but with glibc that is simply not an option |
1102 |
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/ru_RU/LC_MESSAGES |
1103 |
|
1104 |
# Remove the files we don't want to distribute |
1105 |
rm -f $RPM_BUILD_ROOT%{_libdir}/libNoVersion* |
1106 |
rm -f $RPM_BUILD_ROOT%{_slibdir}/libNoVersion* |
1107 |
|
1108 |
%if "%{name}" == "glibc" |
1109 |
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/nsswitch.conf |
1110 |
%endif |
1111 |
|
1112 |
# This is for ncsd - in glibc 2.2 |
1113 |
%if %{build_nscd} |
1114 |
install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT%{_sysconfdir} |
1115 |
install -d -m 755 %{buildroot}%{_unitdir} |
1116 |
install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/nscd.service |
1117 |
install -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/nscd.socket |
1118 |
install -D -m 644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}/nscd.conf |
1119 |
install -d -m 755 %{buildroot}%{_var}/db/nscd |
1120 |
%endif |
1121 |
|
1122 |
# These man pages require special attention |
1123 |
mkdir -p %{buildroot}%{_mandir}/man3 |
1124 |
install -p -m 0644 crypt_blowfish-%{crypt_bf_ver}/*.3 %{buildroot}%{_mandir}/man3/ |
1125 |
|
1126 |
# Useless and takes place |
1127 |
rm -rf %buildroot/%{_datadir}/zoneinfo/{posix,right} |
1128 |
|
1129 |
# Include ld.so.conf |
1130 |
%if "%{name}" == "glibc" |
1131 |
%if %isarch mips mipsel |
1132 |
# needed to get a ldd which understands o32, n32, 64 |
1133 |
install -m 755 $RPM_BUILD_DIR/%{source_dir}/build-mips64el-linux/elf/ldd $RPM_BUILD_ROOT/%{_bindir}/ldd |
1134 |
%endif |
1135 |
echo "include /etc/ld.so.conf.d/*.conf" > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf |
1136 |
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf |
1137 |
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d |
1138 |
|
1139 |
# ldconfig cache |
1140 |
mkdir -p $RPM_BUILD_ROOT%{_var}/cache/ldconfig |
1141 |
touch $RPM_BUILD_ROOT%{_var}/cache/ldconfig/aux-cache |
1142 |
|
1143 |
# automatic ldconfig cache update on rpm installs/removals |
1144 |
# (see http://wiki.mandriva.com/en/Rpm_filetriggers) |
1145 |
install -d %buildroot%{_var}/lib/rpm/filetriggers |
1146 |
cat > %buildroot%{_var}/lib/rpm/filetriggers/00-ldconfig.filter << EOF |
1147 |
^.((/lib|/usr/lib)(32|64)?/[^/]*\.so\.|/etc/ld.so.conf.d/[^/]*\.conf) |
1148 |
EOF |
1149 |
cat > %buildroot%{_var}/lib/rpm/filetriggers/00-ldconfig.script << EOF |
1150 |
#!/bin/sh |
1151 |
ldconfig -X |
1152 |
EOF |
1153 |
chmod 0755 %buildroot%{_var}/lib/rpm/filetriggers/00-ldconfig.script |
1154 |
%endif |
1155 |
|
1156 |
# Include %{_libdir}/gconv/gconv-modules.cache |
1157 |
> $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache |
1158 |
chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache |
1159 |
|
1160 |
%if "%{name}" == "glibc" |
1161 |
touch $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.cache |
1162 |
%endif |
1163 |
|
1164 |
# Add libraries to debug sub-package |
1165 |
%if %{build_debug} |
1166 |
mkdir $RPM_BUILD_ROOT%{_libdir}/debug |
1167 |
#cp -a $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_libdir}/debug/ |
1168 |
#rm -f $RPM_BUILD_ROOT%{_libdir}/debug/*_p.a |
1169 |
cp -a $RPM_BUILD_ROOT%{_slibdir}/lib*.so* $RPM_BUILD_ROOT%{_libdir}/debug/ |
1170 |
|
1171 |
pushd $RPM_BUILD_ROOT%{_libdir}/debug |
1172 |
for lib in *.so*; do |
1173 |
[[ -f "$lib" ]] && DEBUG_LIBS="$DEBUG_LIBS %{_libdir}/debug/$lib" |
1174 |
done |
1175 |
popd |
1176 |
%endif |
1177 |
|
1178 |
# Are we cross-compiling? |
1179 |
Strip="strip" |
1180 |
if [[ "%{_target_cpu}" != "%{target_cpu}" ]]; then |
1181 |
Strip="%{cross_program_prefix}$Strip" |
1182 |
fi |
1183 |
|
1184 |
# Strip debugging info from all static libraries |
1185 |
pushd $RPM_BUILD_ROOT%{_slibdir} |
1186 |
for i in *.a; do |
1187 |
if [ -f "$i" ]; then |
1188 |
case "$i" in |
1189 |
*_p.a) ;; |
1190 |
*) $Strip -g -R .comment $i ;; |
1191 |
esac |
1192 |
fi |
1193 |
done |
1194 |
popd |
1195 |
|
1196 |
# post install wrapper |
1197 |
%__cc -Os -DSLIBDIR="\"%{_slibdir}\"" -DASH_BIN="\"%{ash_bin}\"" %{SOURCE14} -static \ |
1198 |
-L $RPM_BUILD_ROOT%{_libdir}/ \ |
1199 |
-o $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper |
1200 |
chmod 700 $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper |
1201 |
|
1202 |
# rquota.x and rquota.h are now provided by quota |
1203 |
rm -f $RPM_BUILD_ROOT%{_includedir}/rpcsvc/rquota.[hx] |
1204 |
|
1205 |
# Hardlink identical locale files together |
1206 |
%if %{build_i18ndata} |
1207 |
%{_sbindir}/hardlink -vc $RPM_BUILD_ROOT%{_datadir}/locale |
1208 |
%endif |
1209 |
|
1210 |
rm -rf $RPM_BUILD_ROOT%{_includedir}/netatalk/ |
1211 |
|
1212 |
# Build file list for devel package |
1213 |
find $RPM_BUILD_ROOT%{_includedir} -type f -or -type l > devel.filelist |
1214 |
find $RPM_BUILD_ROOT%{_includedir} -type d | sed "s/^/%dir /" | \ |
1215 |
grep -v "%{_libdir}/libnss1.*.so$" | \ |
1216 |
grep -v "%{_includedir}$" | >> devel.filelist |
1217 |
find $RPM_BUILD_ROOT%{_libdir} -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist |
1218 |
# biarch libs |
1219 |
%if %{build_biarch} |
1220 |
find $RPM_BUILD_ROOT%{_prefix}/lib -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist |
1221 |
%endif |
1222 |
%if %isarch mips mipsel |
1223 |
find $RPM_BUILD_ROOT%{_libdir}32 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist |
1224 |
find $RPM_BUILD_ROOT%{_libdir}64 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist |
1225 |
%endif |
1226 |
perl -pi -e "s|$RPM_BUILD_ROOT||" devel.filelist |
1227 |
|
1228 |
# /etc/localtime - we're proud of our timezone #Well we may put Paris |
1229 |
%if %{build_timezone} |
1230 |
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
1231 |
cp -f $RPM_BUILD_ROOT%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
1232 |
#ln -sf ..%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
1233 |
%endif |
1234 |
|
1235 |
# [gg] build PDF documentation |
1236 |
%if %{build_pdf_doc} |
1237 |
(cd manual; texi2dvi -p -t @afourpaper -t @finalout libc.texinfo) |
1238 |
%endif |
1239 |
|
1240 |
# the last bit: more documentation |
1241 |
rm -rf documentation |
1242 |
mkdir documentation |
1243 |
cp timezone/README documentation/README.timezone |
1244 |
cp ChangeLog* documentation |
1245 |
gzip -9 documentation/ChangeLog* |
1246 |
mkdir documentation/crypt_blowfish-%{crypt_bf_ver} |
1247 |
install -m 644 crypt_blowfish-%{crypt_bf_ver}/{README,LINKS,PERFORMANCE} \ |
1248 |
documentation/crypt_blowfish-%{crypt_bf_ver} |
1249 |
|
1250 |
# Generate final rpm filelist, with localized libc.mo files |
1251 |
rm -f rpm.filelist |
1252 |
%if "%{name}" == "glibc" |
1253 |
%find_lang libc |
1254 |
perl -ne '/^\s*$/ or print' libc.lang > rpm.filelist |
1255 |
%endif |
1256 |
cat extralibs.filelist >> rpm.filelist |
1257 |
|
1258 |
# Remove unpackaged files |
1259 |
rm -f $RPM_BUILD_ROOT%{_infodir}/dir.old* |
1260 |
rm -rf $RPM_BUILD_ROOT%{_includedir}/asm-*/mach-*/ |
1261 |
rm -f $RPM_BUILD_ROOT%{_datadir}/locale/locale-archive* |
1262 |
rm -f $RPM_BUILD_ROOT%{_var}/db/Makefile |
1263 |
|
1264 |
%if !%{build_utils} |
1265 |
%if %{build_biarch} |
1266 |
rm -f $RPM_BUILD_ROOT%{_slibdir32}/libmemusage.so |
1267 |
rm -f $RPM_BUILD_ROOT%{_slibdir32}/libpcprofile.so |
1268 |
%endif |
1269 |
%if %isarch mips mipsel |
1270 |
rm -f $RPM_BUILD_ROOT%{_slibdir}32/libmemusage.so |
1271 |
rm -f $RPM_BUILD_ROOT%{_slibdir}32/libpcprofile.so |
1272 |
rm -f $RPM_BUILD_ROOT%{_slibdir}64/libmemusage.so |
1273 |
rm -f $RPM_BUILD_ROOT%{_slibdir}64/libpcprofile.so |
1274 |
%endif |
1275 |
rm -f $RPM_BUILD_ROOT%{_slibdir}/libmemusage.so |
1276 |
rm -f $RPM_BUILD_ROOT%{_slibdir}/libpcprofile.so |
1277 |
rm -f $RPM_BUILD_ROOT%{_bindir}/memusage |
1278 |
rm -f $RPM_BUILD_ROOT%{_bindir}/memusagestat |
1279 |
rm -f $RPM_BUILD_ROOT%{_bindir}/mtrace |
1280 |
rm -f $RPM_BUILD_ROOT%{_bindir}/pcprofiledump |
1281 |
rm -f $RPM_BUILD_ROOT%{_bindir}/xtrace |
1282 |
%endif |
1283 |
|
1284 |
%if !%{build_timezone} |
1285 |
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
1286 |
rm -f $RPM_BUILD_ROOT%{_sbindir}/zdump |
1287 |
rm -f $RPM_BUILD_ROOT%{_sbindir}/zic |
1288 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo |
1289 |
%endif |
1290 |
|
1291 |
%if !%{build_i18ndata} |
1292 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/i18n |
1293 |
%endif |
1294 |
|
1295 |
%if "%{name}" != "glibc" |
1296 |
rm -rf $RPM_BUILD_ROOT/boot |
1297 |
rm -rf $RPM_BUILD_ROOT/sbin |
1298 |
rm -rf $RPM_BUILD_ROOT/usr/share |
1299 |
rm -rf $RPM_BUILD_ROOT%{_bindir} |
1300 |
rm -rf $RPM_BUILD_ROOT%{_sbindir} |
1301 |
rm -rf $RPM_BUILD_ROOT%{_datadir} |
1302 |
rm -rf $RPM_BUILD_ROOT%{_infodir} |
1303 |
rm -rf $RPM_BUILD_ROOT%{_prefix}/etc |
1304 |
rm -rf $RPM_BUILD_ROOT%{_libdir}/gconv |
1305 |
%endif |
1306 |
|
1307 |
# In case we are cross-compiling, don't bother to remake symlinks and |
1308 |
# fool spec-helper when stripping files |
1309 |
%if "%{name}" != "glibc" |
1310 |
export DONT_SYMLINK_LIBS=1 |
1311 |
export PATH=%{_bindir}:$PATH |
1312 |
%endif |
1313 |
|
1314 |
%if %build_debug |
1315 |
export EXCLUDE_FROM_STRIP="$DEBUG_LIBS" |
1316 |
%endif |
1317 |
|
1318 |
# This will make the '-g' argument to be passed to eu-strip for these |
1319 |
# libraries, so that only debug symbols are stripped and gdb/valgrind continue |
1320 |
# to work without needing glibc-debug package to be installed. |
1321 |
export EXCLUDE_FROM_FULL_STRIP="ld-%{glibcversion}.so libpthread libc-%{glibcversion}.so" |
1322 |
|
1323 |
%if "%{name}" == "glibc" |
1324 |
%define upgradestamp %{_slibdir}/glibc.upgraded |
1325 |
%define broken_link %{_slibdir}/libnss_nis.so.1 %{_slibdir}/libnss_files.so.1 %{_slibdir}/libnss_dns.so.1 %{_slibdir}/libnss_compat.so.1 |
1326 |
|
1327 |
|
1328 |
%pre -p <lua> |
1329 |
if posix.stat("/usr%{_slibdir}", "type") == 'directory' then |
1330 |
if not posix.stat("/usr%{_slibdir}/libnss_files-%{glibcversion}.so") then |
1331 |
io.open("%{upgradestamp}", "w"):close() |
1332 |
end |
1333 |
end |
1334 |
|
1335 |
%post -p %{_sbindir}/glibc-post-wrapper |
1336 |
export LC_ALL=C |
1337 |
|
1338 |
if [ "$1" -gt 1 ]; then |
1339 |
# migrate /etc/ld.so.conf to include the new /etc/ld.so.conf.d/ |
1340 |
# without external commands but for removing the temporary file |
1341 |
ldso_conf=/etc/ld.so.conf |
1342 |
while read i; do |
1343 |
[ "$i" = "include /etc/ld.so.conf.d/*.conf" ] && keep=1 |
1344 |
# Remove previously used include line without absolute path |
1345 |
[ "$i" = "include ld.so.conf.d/*.conf" ] || echo $i |
1346 |
done < $ldso_conf > $ldso_conf- |
1347 |
if [ -z "$keep" ]; then |
1348 |
echo "include /etc/ld.so.conf.d/*.conf" > $ldso_conf |
1349 |
while read i; do |
1350 |
echo $i |
1351 |
done < $ldso_conf- >> $ldso_conf |
1352 |
fi |
1353 |
[ -x /bin/rm ] && /bin/rm -f $ldso_conf- |
1354 |
fi |
1355 |
/sbin/ldconfig |
1356 |
|
1357 |
if [ "$1" -gt 1 ]; then |
1358 |
# On upgrade the services doesn't work because libnss couldn't be |
1359 |
# loaded anymore. |
1360 |
if [ -f %{upgradestamp} ]; then |
1361 |
if /usr/bin/readlink /proc/1/exe >/dev/null && \ |
1362 |
/usr/bin/readlink /proc/1/root >/dev/null; then |
1363 |
if [ -x /sbin/telinit -a -p /dev/initctl ]; then |
1364 |
/sbin/telinit u |
1365 |
fi |
1366 |
if [ -x /etc/init.d/sshd -a \ |
1367 |
-x /usr/sbin/sshd -a \ |
1368 |
-x /bin/bash ]; then |
1369 |
/etc/init.d/sshd condrestart |
1370 |
fi |
1371 |
fi |
1372 |
fi |
1373 |
if [ -f /bin/rm ]; then |
1374 |
for i in %broken_link; do |
1375 |
if [ -e $i ] && [ ! -L $i ]; then |
1376 |
/bin/rm -f $i |
1377 |
fi |
1378 |
done |
1379 |
fi |
1380 |
fi |
1381 |
[ -x /bin/rm ] && /bin/rm -f %{upgradestamp} |
1382 |
|
1383 |
# always generate the gconv-modules.cache |
1384 |
%{_sbindir}/iconvconfig -o %{_libdir}/gconv/gconv-modules.cache --nostdlib %{_libdir}/gconv |
1385 |
|
1386 |
%endif |
1387 |
|
1388 |
%pre devel |
1389 |
if [ -L %{_includedir}/scsi ]; then |
1390 |
rm -f %{_includedir}/scsi |
1391 |
fi |
1392 |
if [ -L %{_includedir}/sound ]; then |
1393 |
rm -f %{_includedir}/sound |
1394 |
fi |
1395 |
if [ -L %{_includedir}/linux ]; then |
1396 |
rm -f %{_includedir}/linux |
1397 |
fi |
1398 |
if [ -L %{_includedir}/asm ]; then |
1399 |
rm -f %{_includedir}/asm |
1400 |
fi |
1401 |
if [ -L %{_includedir}/asm-generic ]; then |
1402 |
rm -f %{_includedir}/asm-generic |
1403 |
fi |
1404 |
%if %isarch x86_64 |
1405 |
if [ -L %{_includedir}/asm-x86_64 ]; then |
1406 |
rm -f %{_includedir}/asm-x86_64 |
1407 |
fi |
1408 |
if [ -L %{_includedir}/asm-i386 ]; then |
1409 |
rm -f %{_includedir}/asm-i386 |
1410 |
fi |
1411 |
%endif |
1412 |
%if %isarch %mips |
1413 |
if [ -L %{_includedir}/asm-mips ]; then |
1414 |
rm -f %{_includedir}/asm-mips |
1415 |
fi |
1416 |
%endif |
1417 |
%if %isarch %arm |
1418 |
if [ -L %{_includedir}/asm-arm ]; then |
1419 |
rm -f %{_includedir}/asm-arm |
1420 |
fi |
1421 |
%endif |
1422 |
exit 0 |
1423 |
|
1424 |
%if %{build_doc} |
1425 |
%post doc |
1426 |
%_install_info libc.info |
1427 |
|
1428 |
%preun doc |
1429 |
%_remove_install_info libc.info |
1430 |
%endif |
1431 |
|
1432 |
%if %{build_nscd} |
1433 |
%pre -n nscd |
1434 |
%_pre_useradd nscd / /bin/false |
1435 |
|
1436 |
%post -n nscd |
1437 |
%_tmpfilescreate nscd |
1438 |
%_post_service nscd |
1439 |
|
1440 |
%preun -n nscd |
1441 |
%_preun_service nscd |
1442 |
|
1443 |
%postun -n nscd |
1444 |
%_postun_userdel nscd |
1445 |
|
1446 |
if [ "$1" -ge "1" ]; then |
1447 |
/sbin/service nscd condrestart > /dev/null 2>&1 || : |
1448 |
fi |
1449 |
%endif |
1450 |
|
1451 |
%clean |
1452 |
#rm -rf "$RPM_BUILD_ROOT" |
1453 |
#rm -f *.filelist* |
1454 |
|
1455 |
# |
1456 |
# glibc |
1457 |
# |
1458 |
%files -f rpm.filelist |
1459 |
%if "%{name}" == "glibc" |
1460 |
%if %{build_timezone} |
1461 |
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/localtime |
1462 |
%endif |
1463 |
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/nsswitch.conf |
1464 |
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ld.so.conf |
1465 |
%dir %{_sysconfdir}/ld.so.conf.d |
1466 |
%config(noreplace) %{_sysconfdir}/rpc |
1467 |
%doc nis/nss |
1468 |
%doc posix/gai.conf |
1469 |
%{_datadir}/locale/locale.alias |
1470 |
/sbin/sln |
1471 |
%dir %{_prefix}/libexec/getconf |
1472 |
%{_prefix}/libexec/getconf/* |
1473 |
%endif |
1474 |
%{_slibdir}/ld-%{glibcversion}.so |
1475 |
%if %isarch i386 |
1476 |
%{_slibdir}/ld-linux.so.2 |
1477 |
%endif |
1478 |
%if %isarch %arm |
1479 |
%{_slibdir}/ld-linux.so.3 |
1480 |
%endif |
1481 |
%if %isarch x86_64 |
1482 |
%{_slibdir}/ld-linux-x86-64.so.2 |
1483 |
%endif |
1484 |
%if %isarch %mips |
1485 |
%{_slibdir}/ld.so.1 |
1486 |
%endif |
1487 |
%{_slibdir}/lib*-[.0-9]*.so |
1488 |
%{_slibdir}/lib*.so.[0-9]* |
1489 |
%{_slibdir}/libSegFault.so |
1490 |
%if "%{name}" == "glibc" |
1491 |
%dir %{_libdir}/audit |
1492 |
%{_libdir}/audit/sotruss-lib.so |
1493 |
%dir %{_libdir}/gconv |
1494 |
%{_libdir}/gconv/*.so |
1495 |
%{_libdir}/gconv/gconv-modules |
1496 |
%ghost %{_libdir}/gconv/gconv-modules.cache |
1497 |
%{_bindir}/catchsegv |
1498 |
%{_bindir}/gencat |
1499 |
%{_bindir}/getconf |
1500 |
%{_bindir}/getent |
1501 |
%{_bindir}/iconv |
1502 |
%{_bindir}/ldd |
1503 |
%if %isarch i386 |
1504 |
%{_bindir}/lddlibc4 |
1505 |
%endif |
1506 |
%{_bindir}/locale |
1507 |
%{_bindir}/localedef |
1508 |
%{_bindir}/makedb |
1509 |
%{_bindir}/pldd |
1510 |
%{_bindir}/rpcgen |
1511 |
%{_bindir}/sotruss |
1512 |
%{_bindir}/sprof |
1513 |
%{_bindir}/tzselect |
1514 |
%{_sbindir}/iconvconfig |
1515 |
%{_sbindir}/glibc-post-wrapper |
1516 |
%endif |
1517 |
|
1518 |
%if %{build_biarch} |
1519 |
%{_slibdir32}/ld-%{glibcversion}.so |
1520 |
%{_slibdir32}/ld-linux*.so.2 |
1521 |
%{_slibdir32}/lib*-[.0-9]*.so |
1522 |
%{_slibdir32}/lib*.so.[0-9]* |
1523 |
%{_slibdir32}/libSegFault.so |
1524 |
%dir %{_prefix}/lib/audit |
1525 |
%{_prefix}/lib/audit/sotruss-lib.so |
1526 |
%dir %{_prefix}/lib/gconv |
1527 |
%{_prefix}/lib/gconv/* |
1528 |
%endif |
1529 |
%if %isarch mips mipsel |
1530 |
%{_slibdir}32/ld-%{glibcversion}.so |
1531 |
%{_slibdir}32/ld.so.1 |
1532 |
%{_slibdir}32/lib*-[.0-9]*.so |
1533 |
%{_slibdir}32/lib*.so.[0-9]* |
1534 |
%{_slibdir}32/libSegFault.so |
1535 |
%dir %{_libdir}32/gconv |
1536 |
%{_libdir}32/gconv/* |
1537 |
%{_slibdir}64/ld-%{glibcversion}.so |
1538 |
%{_slibdir}64/ld.so.1 |
1539 |
%{_slibdir}64/lib*-[.0-9]*.so |
1540 |
%{_slibdir}64/lib*.so.[0-9]* |
1541 |
%{_slibdir}64/libSegFault.so |
1542 |
%dir %{_libdir}64/gconv |
1543 |
%{_libdir}64/gconv/* |
1544 |
%endif |
1545 |
|
1546 |
# |
1547 |
# ldconfig |
1548 |
# |
1549 |
%if "%{name}" == "glibc" |
1550 |
/sbin/ldconfig |
1551 |
%ghost %{_sysconfdir}/ld.so.cache |
1552 |
%dir %{_var}/cache/ldconfig |
1553 |
%ghost %{_var}/cache/ldconfig/aux-cache |
1554 |
%{_var}/lib/rpm/filetriggers/00-ldconfig.* |
1555 |
%endif |
1556 |
|
1557 |
# |
1558 |
# glibc-devel |
1559 |
# |
1560 |
%files devel -f devel.filelist |
1561 |
%doc README NEWS INSTALL BUGS PROJECTS CONFORMANCE |
1562 |
%doc COPYING COPYING.LIB |
1563 |
%doc documentation/* |
1564 |
%doc hesiod/README.hesiod |
1565 |
%doc crypt/README.ufc-crypt |
1566 |
%if "%{name}" == "glibc" |
1567 |
%{_mandir}/man3/* |
1568 |
%endif |
1569 |
%{_libdir}/libc_nonshared.a |
1570 |
%{_libdir}/libg.a |
1571 |
%{_libdir}/libieee.a |
1572 |
%{_libdir}/libmcheck.a |
1573 |
%{_libdir}/libpthread_nonshared.a |
1574 |
%if "%{name}" == "glibc" |
1575 |
%{_libdir}/librpcsvc.a |
1576 |
%endif |
1577 |
|
1578 |
%if %{build_biarch} |
1579 |
%{_prefix}/lib/libc_nonshared.a |
1580 |
%{_prefix}/lib/libg.a |
1581 |
%{_prefix}/lib/libieee.a |
1582 |
%{_prefix}/lib/libmcheck.a |
1583 |
%{_prefix}/lib/libpthread_nonshared.a |
1584 |
%{_prefix}/lib/librpcsvc.a |
1585 |
%endif |
1586 |
|
1587 |
%if %isarch mips mipsel |
1588 |
%{_libdir}32/libc_nonshared.a |
1589 |
%{_libdir}32/libg.a |
1590 |
%{_libdir}32/libieee.a |
1591 |
%{_libdir}32/libmcheck.a |
1592 |
%{_libdir}32/libpthread_nonshared.a |
1593 |
%if "%{name}" == "glibc" |
1594 |
%{_libdir}32/librpcsvc.a |
1595 |
%endif |
1596 |
%{_libdir}64/libc_nonshared.a |
1597 |
%{_libdir}64/libg.a |
1598 |
%{_libdir}64/libieee.a |
1599 |
%{_libdir}64/libmcheck.a |
1600 |
%{_libdir}64/libpthread_nonshared.a |
1601 |
%if "%{name}" == "glibc" |
1602 |
%{_libdir}64/librpcsvc.a |
1603 |
%endif |
1604 |
%endif |
1605 |
|
1606 |
# |
1607 |
# glibc-static-devel |
1608 |
# |
1609 |
%files static-devel |
1610 |
%doc COPYING COPYING.LIB |
1611 |
%{_libdir}/libBrokenLocale.a |
1612 |
%{_libdir}/libanl.a |
1613 |
%{_libdir}/libc.a |
1614 |
%{_libdir}/libcrypt.a |
1615 |
%{_libdir}/libdl.a |
1616 |
%{_libdir}/libm.a |
1617 |
%{_libdir}/libnsl.a |
1618 |
%{_libdir}/libpthread.a |
1619 |
%{_libdir}/libresolv.a |
1620 |
%{_libdir}/librt.a |
1621 |
%{_libdir}/libutil.a |
1622 |
|
1623 |
%if %{build_biarch} |
1624 |
%{_prefix}/lib/libBrokenLocale.a |
1625 |
%{_prefix}/lib/libanl.a |
1626 |
%{_prefix}/lib/libc.a |
1627 |
%{_prefix}/lib/libcrypt.a |
1628 |
%{_prefix}/lib/libdl.a |
1629 |
%{_prefix}/lib/libm.a |
1630 |
%{_prefix}/lib/libnsl.a |
1631 |
%{_prefix}/lib/libpthread.a |
1632 |
%{_prefix}/lib/libresolv.a |
1633 |
%{_prefix}/lib/librt.a |
1634 |
%{_prefix}/lib/libutil.a |
1635 |
%endif |
1636 |
|
1637 |
%if %isarch mips mipsel |
1638 |
%{_libdir}32/libBrokenLocale.a |
1639 |
%{_libdir}32/libanl.a |
1640 |
%{_libdir}32/libc.a |
1641 |
%{_libdir}32/libcrypt.a |
1642 |
%{_libdir}32/libdl.a |
1643 |
%{_libdir}32/libm.a |
1644 |
%{_libdir}32/libnsl.a |
1645 |
%{_libdir}32/libpthread.a |
1646 |
%{_libdir}32/libresolv.a |
1647 |
%{_libdir}32/librt.a |
1648 |
%{_libdir}32/libutil.a |
1649 |
|
1650 |
%{_libdir}64/libBrokenLocale.a |
1651 |
%{_libdir}64/libanl.a |
1652 |
%{_libdir}64/libc.a |
1653 |
%{_libdir}64/libcrypt.a |
1654 |
%{_libdir}64/libdl.a |
1655 |
%{_libdir}64/libm.a |
1656 |
%{_libdir}64/libnsl.a |
1657 |
%{_libdir}64/libpthread.a |
1658 |
%{_libdir}64/libresolv.a |
1659 |
%{_libdir}64/librt.a |
1660 |
%{_libdir}64/libutil.a |
1661 |
%endif |
1662 |
|
1663 |
# |
1664 |
# glibc-doc |
1665 |
# |
1666 |
%if %{build_doc} |
1667 |
%files doc |
1668 |
%{_infodir}/libc.info* |
1669 |
%endif |
1670 |
|
1671 |
# |
1672 |
# glibc-doc-pdf |
1673 |
# |
1674 |
%if %{build_pdf_doc} |
1675 |
%files doc-pdf |
1676 |
%doc manual/libc.pdf |
1677 |
%endif |
1678 |
|
1679 |
# |
1680 |
# glibc-debug |
1681 |
# |
1682 |
%if %{build_debug} |
1683 |
%files debug |
1684 |
%dir %{_libdir}/debug |
1685 |
%{_libdir}/debug/*.so |
1686 |
%{_libdir}/debug/*.so.* |
1687 |
%if %isarch mips mipsel |
1688 |
%dir %{_libdir}/debug/lib32 |
1689 |
%{_libdir}/debug/lib32/*.so |
1690 |
%{_libdir}/debug/lib32/*.so.* |
1691 |
%dir %{_libdir}/debug/lib64 |
1692 |
%{_libdir}/debug/lib64/*.so |
1693 |
%{_libdir}/debug/lib64/*.so.* |
1694 |
%endif |
1695 |
%endif |
1696 |
|
1697 |
# |
1698 |
# glibc-profile |
1699 |
# |
1700 |
%if %{build_profile} |
1701 |
%files profile |
1702 |
%{_libdir}/lib*_p.a |
1703 |
%if %{build_biarch} |
1704 |
%{_prefix}/lib/lib*_p.a |
1705 |
%endif |
1706 |
%if %isarch mips mipsel |
1707 |
%{_libdir}32/lib*_p.a |
1708 |
%{_libdir}64/lib*_p.a |
1709 |
%endif |
1710 |
%endif |
1711 |
|
1712 |
# |
1713 |
# glibc-utils |
1714 |
# |
1715 |
%if %{build_utils} |
1716 |
%files utils |
1717 |
%if %{build_biarch} |
1718 |
%{_slibdir32}/libmemusage.so |
1719 |
%{_slibdir32}/libpcprofile.so |
1720 |
%endif |
1721 |
%{_slibdir}/libmemusage.so |
1722 |
%{_slibdir}/libpcprofile.so |
1723 |
%{_bindir}/memusage |
1724 |
%{_bindir}/memusagestat |
1725 |
%{_bindir}/mtrace |
1726 |
%{_bindir}/pcprofiledump |
1727 |
%{_bindir}/xtrace |
1728 |
%if %isarch mips mipsel |
1729 |
%{_slibdir}32/libmemusage.so |
1730 |
%{_slibdir}32/libpcprofile.so |
1731 |
%{_slibdir}64/libmemusage.so |
1732 |
%{_slibdir}64/libpcprofile.so |
1733 |
%endif |
1734 |
%endif |
1735 |
|
1736 |
# |
1737 |
# nscd |
1738 |
# |
1739 |
%if %{build_nscd} |
1740 |
%files -n nscd |
1741 |
%config(noreplace) %{_sysconfdir}/nscd.conf |
1742 |
%{_sbindir}/nscd |
1743 |
%{_unitdir}/nscd.service |
1744 |
%{_unitdir}/nscd.socket |
1745 |
%{_tmpfilesdir}/nscd.conf |
1746 |
%dir %{_var}/db/nscd |
1747 |
%endif |
1748 |
|
1749 |
# |
1750 |
# timezone |
1751 |
# |
1752 |
%if %{build_timezone} |
1753 |
%files -n timezone |
1754 |
%{_sbindir}/zdump |
1755 |
%{_sbindir}/zic |
1756 |
%dir %{_datadir}/zoneinfo |
1757 |
%{_datadir}/zoneinfo/* |
1758 |
%endif |
1759 |
|
1760 |
# |
1761 |
# glibc-i18ndata |
1762 |
# |
1763 |
%if %{build_i18ndata} |
1764 |
%files i18ndata |
1765 |
%dir %{_datadir}/i18n |
1766 |
%dir %{_datadir}/i18n/charmaps |
1767 |
%{_datadir}/i18n/charmaps/* |
1768 |
%dir %{_datadir}/i18n/locales |
1769 |
%{_datadir}/i18n/locales/* |
1770 |
%{_datadir}/i18n/SUPPORTED |
1771 |
%endif |