/[packages]/cauldron/glibc/current/SPECS/glibc.spec
ViewVC logotype

Contents of /cauldron/glibc/current/SPECS/glibc.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 751288 - (show annotations) (download)
Wed Oct 15 06:41:43 2014 UTC (9 years, 6 months ago) by tmb
File size: 47377 byte(s)
- elf/dl-load.c (open_path): Avoid writing to 'env_path_list'
  when none of the search directories exist. (BZ #15378)


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

  ViewVC Help
Powered by ViewVC 1.1.30