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