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

  ViewVC Help
Powered by ViewVC 1.1.30