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

  ViewVC Help
Powered by ViewVC 1.1.30