/[packages]/updates/3/glibc/current/SPECS/glibc.spec
ViewVC logotype

Contents of /updates/3/glibc/current/SPECS/glibc.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58182 - (show annotations) (download)
Thu Feb 24 01:52:27 2011 UTC (13 years, 1 month ago) by misc
Original Path: cauldron/glibc/current/SPECS/glibc.spec
File size: 47120 byte(s)
- rebuilt for removing various Conflicts and Obsoletes

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

  ViewVC Help
Powered by ViewVC 1.1.30