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

  ViewVC Help
Powered by ViewVC 1.1.26