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