/[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 674975 - (show annotations) (download)
Sat Sep 13 11:22:45 2014 UTC (9 years, 7 months ago) by tmb
File size: 46462 byte(s)
Add new Linux 3.16 constants to netinet/udp.h
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 4
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 # upstream fixes
304 Patch100: glibc-2.20-Add-new-Linux-3.16-constants-to-netinet-udp.h.patch
305
306 # Determine minium kernel versions
307 %define enablekernel 2.6.32
308 Conflicts: kernel < %{enablekernel}
309
310 # People changed location of rpm scripts...
311 %define rpmscripts /usr/lib/rpm/%{_real_vendor}
312
313 # Don't try to explicitly provide GLIBC_PRIVATE versioned libraries
314 %define __find_provides %{_builddir}/%{source_dir}/find_provides.sh
315 %define __find_requires %{_builddir}/%{source_dir}/find_requires.sh
316
317 %if !%{build_cross}
318 Obsoletes: ld.so
319 Provides: ld.so
320 %endif
321
322 Obsoletes: ldconfig
323 Provides: ldconfig = %{glibcepoch}:%{glibcversion}-%{glibcrelease} /sbin/ldconfig
324 # obsolete nss_db as it got merged again in 2.15
325 Obsoletes: nss_db <= 2.2.3-0.pre1.9
326
327 %description
328 The glibc package contains standard libraries which are used by
329 multiple programs on the system. In order to save disk space and
330 memory, as well as to make upgrading easier, common system code is
331 kept in one place and shared between programs. This particular package
332 contains the most important sets of shared libraries: the standard C
333 library and the standard math library. Without these two libraries, a
334 Linux system will not function. The glibc package also contains
335 national language (locale) support.
336
337 This package now also provides ldconfig which was package seperately in
338 the past. Ldconfig is a basic system program which determines run-time
339 link bindings between ld.so and shared libraries. Ldconfig scans a running
340 system and sets up the symbolic links that are used to load shared
341 libraries properly. It also creates a cache (/etc/ld.so.cache) which
342 speeds the loading of programs which use shared libraries.
343
344 %package devel
345 Summary: Header and object files for development using standard C libraries
346 Group: Development/C
347 Requires(post): info-install
348 Requires(preun): info-install
349 Requires(post): coreutils
350 Requires(postun): coreutils, awk
351 Obsoletes: libc-debug, libc-headers, libc-devel, linuxthreads-devel, nptl-devel
352 %if !%{build_debug}
353 Obsoletes: %{name}-debug < 6:2.3.2-15
354 %endif
355 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
356 %if !%{build_cross}
357 Requires: linux-userspace-headers
358 %endif
359 %if %{build_cross}
360 Autoreq: false
361 Autoprov: false
362 %else
363 Autoreq: true
364 %endif
365 Provides: glibc-crypt_blowfish-devel = %{crypt_bf_ver}
366
367 %description devel
368 The glibc-devel package contains the header and object files necessary
369 for developing programs which use the standard C libraries (which are
370 used by nearly all programs). If you are developing programs which
371 will use the standard C libraries, your system needs to have these
372 standard header and object files available in order to create the
373 executables.
374
375 This package also includes the C header files for the Linux kernel.
376 The header files define structures and constants that are needed for
377 building most standard programs. The header files are also needed for
378 rebuilding the kernel.
379
380 Install glibc-devel if you are going to develop programs which will
381 use the standard C libraries.
382
383 %package static-devel
384 Summary: Static libraries for GNU C library
385 Group: Development/C
386 Requires: %{name}-devel = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
387
388 %description static-devel
389 The glibc-static-devel package contains the static libraries necessary
390 for developing programs which use the standard C libraries. Install
391 glibc-static-devel if you need to statically link your program or
392 library.
393
394 %package profile
395 Summary: The GNU libc libraries, including support for gprof profiling
396 Group: Development/C
397 Obsoletes: libc-profile
398 Provides: libc-profile = %{glibcversion}-%{glibcrelease}
399 Autoreq: true
400
401 %description profile
402 The glibc-profile package includes the GNU libc libraries and support
403 for profiling using the gprof program. Profiling is analyzing a
404 program's functions to see how much CPU time they use and determining
405 which functions are calling other functions during execution. To use
406 gprof to profile a program, your program needs to use the GNU libc
407 libraries included in glibc-profile (instead of the standard GNU libc
408 libraries included in the glibc package).
409
410 If you are going to use the gprof program to profile a program, you'll
411 need to install the glibc-profile program.
412
413 %package -n nscd
414 Summary: A Name Service Caching Daemon (nscd)
415 Group: System/Servers
416 Requires(post): systemd >= %{systemd_required_version}
417 Requires(post): rpm-helper >= 0.24.8-1
418 Requires(preun): rpm-helper >= 0.24.8-1
419 Autoreq: true
420
421 %description -n nscd
422 Nscd caches name service lookups and can dramatically improve
423 performance with NIS+, and may help with DNS as well. Note that you
424 can't use nscd with 2.0 kernels because of bugs in the kernel-side
425 thread support. Unfortunately, nscd happens to hit these bugs
426 particularly hard.
427
428 Install nscd if you need a name service lookup caching daemon, and
429 you're not using a version 2.0 kernel.
430
431 %if %{build_debug}
432 %package debug
433 Summary: Shared standard C libraries with debugging information
434 Group: System/Libraries
435 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
436 Autoreq: false
437
438 %description debug
439 The glibc-debug package contains shared standard C libraries with
440 debugging information. You need this only if you want to step into C
441 library routines during debugging.
442
443 To use these libraries, you need to add %{_libdir}/debug to your
444 LD_LIBRARY_PATH variable prior to starting the debugger.
445 %endif
446
447 %package utils
448 Summary: Development utilities from GNU C library
449 Group: Development/Other
450 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
451
452 %description utils
453 The glibc-utils package contains memusage, a memory usage profiler,
454 mtrace, a memory leak tracer and xtrace, a function call tracer which
455 can be helpful during program debugging.
456
457 If unsure if you need this, don't install this package.
458
459 %if %{build_i18ndata}
460 %package i18ndata
461 Summary: Database sources for 'locale'
462 Group: System/Libraries
463
464 %description i18ndata
465 This package contains the data needed to build the locale data files
466 to use the internationalization features of the GNU libc.
467 %endif
468
469 %if %{build_timezone}
470 %package -n timezone
471 Summary: Time zone descriptions
472 Group: System/Base
473
474 %description -n timezone
475 These are configuration files that describe possible
476 time zones.
477 %endif
478
479 %package doc
480 Summary: GNU C library documentation
481 Group: Development/Other
482 BuildArch: noarch
483
484 %description doc
485 The glibc-doc package contains documentation for the GNU C library in
486 info format.
487
488 %if %{build_pdf_doc}
489 %package doc-pdf
490 Summary: GNU C library documentation
491 Group: Development/Other
492 BuildArch: noarch
493
494 %description doc-pdf
495 The glibc-doc-pdf package contains the printable documentation for the
496 GNU C library in PDF format.
497 %endif
498
499 %prep
500 %setup -q -n %{source_dir} -a 16
501
502 # upstream fixes
503 %patch100 -p1 -b .p100
504
505 # other patches
506 %patch00 -p1 -b .localedef-archive-follow-symlinks
507 %patch01 -p1 -b .fhs
508 %patch02 -p1 -b .ldd-non-exec
509 %patch04 -p1 -b .nss-upgrade
510 %patch06 -p1 -b .share-locale
511 %patch09 -p1 -b .xterm-xvt
512 %patch11 -p1 -b .compat-EUR-currencies
513 %patch13 -p1 -b .nscd-enable
514 %patch14 -p1 -b .nscd-no-host-cache
515 %patch17 -p1 -b .i386-hwcapinfo
516 %patch23 -p1 -b .timezone
517 %patch24 -p1 -b .biarch-cpp-defines
518 %patch26 -p1 -b .nice-fix
519 %patch27 -p1 -b .ENOTTY-fr-translation
520 %patch29 -p1 -b .biarch-utils
521 %patch30 -p1 -b .multiarch-check
522 %patch31 -p1 -b .i586-hptiming
523 %patch32 -p1 -b .i586-if-no-cmov
524 %patch33 -p1 -b .pt_BR-i18nfixes
525 %patch35 -p1 -b .zh_CN-charset-fixes
526 %patch38 -p1 -b .testsuite-rt-notparallel
527 %patch44 -p1 -b .dont-tie-libcap-with-selinux
528 %patch46 -p1 -b .pagesize
529
530 # copy freesec source
531 cp %{_sourcedir}/crypt_freesec.[ch] crypt/
532 echo "Applying crypt_blowfish patch:"
533 %patch42 -p1 -b .mga-avx-owl-crypt
534 mv crypt/crypt.h crypt/gnu-crypt.h
535 cp -a crypt_blowfish-%{crypt_bf_ver}/*.[chS] crypt/
536
537 # FreeSec support for extended/new-style/BSDI hashes in crypt(3)
538 %patch39 -p1 -b .mga-owl-crypt_freesec
539 %patch40 -p1 -b .avx-relocate_fcrypt
540 %patch41 -p1 -b .avx-increase_BF_FRAME
541 # add sha256-crypt and sha512-crypt support to the Openwall wrapper
542 %patch43 -p1 -b .mga-wrapper_handle_sha
543 %patch50 -p1 -b .crypt_arm_asm
544
545 %if %{build_selinux}
546 # XXX kludge to build nscd with selinux support as it added -nostdinc
547 # so /usr/include/selinux is not found
548 ln -s %{_includedir}/selinux selinux
549 %endif
550
551 find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;
552
553 # (Anssi 03/2008) FIXME: use _provides_exceptions
554 cat > find_provides.sh << EOF
555 #!/bin/sh
556 %{rpmscripts}/find-provides | grep -v GLIBC_PRIVATE
557 exit 0
558 EOF
559 chmod +x find_provides.sh
560
561 cat > find_requires.bootstrap.sh << EOF
562 /bin/sh %{SOURCE4} %{buildroot} %{_target_cpu} | grep -v "\(GLIBC_PRIVATE\|linux-gate\|linux-vdso\)"
563 exit 0
564 EOF
565 chmod +x find_requires.bootstrap.sh
566
567 # XXX: use better way later to avoid LD_LIBRARY_PATH issue
568 cat %{rpmscripts}/find-requires | sed '/.*LD_LIBRARY_PATH.*/d;' > find_requires
569 chmod +x find_requires
570 # (Anssi 03/2008) FIXME: use _requires_exceptions
571 cat > find_requires.noprivate.sh << EOF
572 %{_builddir}/%{source_dir}/find_requires %{buildroot} %{_target_cpu} | \
573 grep -v GLIBC_PRIVATE
574 exit 0
575 EOF
576 chmod +x find_requires.noprivate.sh
577
578 # FIXME: fix system rpm find-requires to use the prefix cross version
579 %if %{build_bootstrap} || "%{_target_cpu}" != "%{target_cpu}"
580 ln -s find_requires.bootstrap.sh find_requires.sh
581 %else
582 ln -s find_requires.noprivate.sh find_requires.sh
583 %endif
584
585 # Remove patch backups from files we ship in glibc packages
586 rm -f ChangeLog.[^0-9]*
587 rm -f localedata/locales/{???_??,??_??}.*
588 rm -f localedata/locales/[a-z_]*.*
589
590 %build
591 # Prepare test matrix in the next function
592 CheckList=$PWD/Check.list
593 rm -f $CheckList
594 touch $CheckList
595
596 #
597 # CompareKver <kernel version>
598 # function to compare the desired kernel version with running kernel
599 # version (package releases not taken into account in comparison). The
600 # function returns:
601 # -1 = <kernel version> is lesser than current running kernel
602 # 0 = <kernel version> is equal to the current running kernel
603 # 1 = <kernel version> is greater than current running kernel
604 #
605 function CompareKver() {
606 v1=`echo $1 | sed 's/\.\?$/./'`
607 v2=`uname -r | sed 's/[^.0-9].*//' | sed 's/\.\?$/./'`
608 n=1
609 s=0
610 while true; do
611 c1=`echo "$v1" | cut -d "." -f $n`
612 c2=`echo "$v2" | cut -d "." -f $n`
613 if [ -z "$c1" -a -z "$c2" ]; then
614 break
615 elif [ -z "$c1" ]; then
616 s=-1
617 break
618 elif [ -z "$c2" ]; then
619 s=1
620 break
621 elif [ "$c1" -gt "$c2" ]; then
622 s=1
623 break
624 elif [ "$c2" -gt "$c1" ]; then
625 s=-1
626 break
627 fi
628 n=$((n + 1))
629 done
630 echo $s
631 }
632
633 #
634 # BuildGlibc <arch> [<extra_configure_options>+]
635 #
636 function BuildGlibc() {
637 arch="$1"
638 shift 1
639
640 # PowerPC CPU add-on
641 case $arch in
642 cpu-addon,*)
643 cpu=` echo "$arch" | sed -n "/.*,\([^,]*\),.*$/s//\1/p"`
644 arch=`echo "$arch" | sed -n "/.*,.*,\([^,]*\)$/s//\1/p"`
645 ;;
646 *)
647 cpu=$arch
648 ;;
649 esac
650
651 # Select optimization flags and compiler to use
652 BuildAltArch="no"
653 BuildCompFlags=""
654 BuildFlags=""
655 case $arch in
656 i[3456]86 | athlon)
657 BuildFlags="-march=$arch -mtune=generic"
658 if [[ "`uname -m`" = "x86_64" ]]; then
659 BuildAltArch="yes"
660 BuildCompFlags="-m32"
661 fi
662 ;;
663 x86_64)
664 BuildFlags="-mtune=generic"
665 ;;
666 mips|mipsel)
667 BuildFlags="-march=mips3"
668 BuildCompFlags="-march=mips3"
669 ;;
670 mips32|mips32el)
671 BuildFlags="-march=mips3 -mabi=n32"
672 BuildCompFlags="-march=mips3 -mabi=n32"
673 ;;
674 mips64|mips64el)
675 BuildFlags="-march=mips3 -mabi=64"
676 BuildCompFlags="-march=mips3 -mabi=64"
677 ;;
678 armv4t*)
679 BuildFlags="-march=armv4t"
680 BuildCompFlags="-march=armv4t"
681 ;;
682 armv5t*)
683 BuildFlags="-march=armv5t"
684 BuildCompFlags="-march=armv5t"
685 ;;
686 # to check
687 armv7*)
688 BuildFlags="-march=armv7-a"
689 BuildCompFlags="-march=armv7-a"
690 ;;
691 esac
692
693 # Choose multiarch support
694 MultiArchFlags=
695 case $arch in
696 i686 | x86_64)
697 MultiArchFlags="--enable-multi-arch"
698 ;;
699 esac
700
701 # Determine C & C++ compilers
702 BuildCC="%{__cc} $BuildCompFlags"
703 BuildCXX="%{__cxx} $BuildCompFlags"
704
705 # Are we supposed to cross-compile?
706 if [[ "%{target_cpu}" != "%{_target_cpu}" ]]; then
707 # Can't use BuildCC anymore with previous changes.
708 BuildCC="%{cross_program_prefix}gcc $BuildCompFlags"
709 BuildCXX="%{cross_program_prefix}g++ $BuildCompFlags"
710 BuildCross="--build=%{_target_platform}"
711 export libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
712 fi
713
714 BuildFlags="$BuildFlags -DNDEBUG=1 -O2 -finline-functions -g"
715
716 # Do not use direct references against %gs when accessing tls data
717 # XXX make it the default in GCC? (for other non glibc specific usage)
718 case $arch in
719 i[3456]86 | x86_64)
720 BuildFlags="$BuildFlags -mno-tls-direct-seg-refs"
721 ;;
722 esac
723
724 # Arch specific compilation flags
725 if [[ "$arch" = "ppc64" ]]; then
726 BuildFlags="$BuildFlags -fno-inline-functions -mno-minimal-toc"
727 fi
728
729 # Extra configure flags
730 ExtraFlags=
731 if [[ "%{build_profile}" != "0" ]]; then
732 ExtraFlags="$ExtraFlags --enable-profile"
733 fi
734
735 # NPTL+TLS are now the default
736 # check for other arches
737 %if %isarch %ports_arch
738 Pthreads="ports nptl"
739 %else
740 Pthreads="nptl"
741 %endif
742
743 # Add-ons
744 AddOns="libidn"
745 if [[ "$cpu" != "$arch" ]]; then
746 AddOns="$AddOns,powerpc-cpu"
747 BuildFlags="$BuildFlags -mcpu=$cpu"
748 ExtraFlags="$ExtraFlags --with-cpu=$cpu"
749 fi
750
751 # Build with selinux support?
752 %if %{build_selinux}
753 SElinuxFlags="--with-selinux"
754 %else
755 SElinuxFlags="--without-selinux"
756 %endif
757
758 # Kernel headers directory
759 KernelHeaders=%{_includedir}
760
761 # Determine library name
762 glibc_cv_cc_64bit_output=no
763 if echo ".text" | $BuildCC -c -o test.o -xassembler -; then
764 case `/usr/bin/file test.o` in
765 *"ELF 64"*)
766 glibc_cv_cc_64bit_output=yes
767 ;;
768 esac
769 fi
770 rm -f test.o
771
772 # Force a separate and clean object dir
773 rm -rf build-$cpu-linux
774 mkdir build-$cpu-linux
775 pushd build-$cpu-linux
776 [[ "$BuildAltArch" = "yes" ]] && touch ".alt" || touch ".main"
777 CC="$BuildCC" CXX="$BuildCXX" CFLAGS="$BuildFlags" ../configure \
778 $arch-%{_real_vendor}-linux%{gnuext} $BuildCross \
779 --prefix=%{_prefix} \
780 --libexecdir=%{_prefix}/libexec \
781 --infodir=%{_infodir} \
782 --enable-add-ons="$AddOns" --without-cvs \
783 $ExtraFlags $MultiArchFlags $SElinuxFlags \
784 --enable-kernel=%{enablekernel} \
785 --with-headers=$KernelHeaders ${1+"$@"} \
786 --enable-lock-elision \
787 --enable-obsolete-rpc
788 %make -r -s
789 popd
790
791 # All tests are expected to pass on certain platforms, depending also
792 # on the version of the kernel running
793 case $arch in
794 athlon | ia64 | ppc | ppc64)
795 if [ "`CompareKver %{check_min_kver}`" -lt 0 ]; then
796 check_flags=""
797 else
798 check_flags="-k"
799 fi
800 ;;
801 *)
802 check_flags="-k"
803 ;;
804 esac
805
806 # Generate test matrix
807 [[ -d "build-$arch-linux" ]] || {
808 echo "ERROR: PrepareGlibcTest: build-$arch-linux does not exist!"
809 return 1
810 }
811 local BuildJobs="-j`getconf _NPROCESSORS_ONLN`"
812 echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
813
814 case $cpu in
815 i686|athlon) base_arch=i586;;
816 power*) base_arch=$arch;;
817 *) base_arch=none;;
818 esac
819
820 [[ -d "build-$base_arch-linux" ]] && {
821 check_flags="$check_flags -l build-$base_arch-linux/elf/ld.so"
822 echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
823 }
824 return 0
825 }
826
827 # Build main glibc
828 BuildGlibc %{target_cpu}
829
830 %if %{build_biarch}
831 %if %isarch x86_64
832 BuildGlibc i686
833 %endif
834 %endif
835 %if %isarch mips
836 BuildGlibc mips64
837 BuildGlibc mips32
838 %endif
839 %if %isarch mipsel
840 BuildGlibc mips64el
841 BuildGlibc mips32el
842 %endif
843 %if %isarch mips64
844 BuildGlibc mips
845 BuildGlibc mips32
846 %endif
847 %if %isarch mips64el
848 BuildGlibc mipsel
849 BuildGlibc mips32el
850 %endif
851
852 # Build i686 libraries if not already building for i686/athlon
853 case %{target_cpu} in
854 i686 | athlon)
855 ;;
856 i[3-6]86)
857 BuildGlibc i686 --disable-profile
858 ;;
859 esac
860
861 make -C crypt_blowfish-%{crypt_bf_ver} man
862
863 %if %{build_check}
864 export TMPDIR=/tmp
865 export TIMEOUTFACTOR=16
866 Check="$PWD/glibc-check.sh"
867 cat %{SOURCE5} > $Check
868 chmod +x $Check
869 while read arglist; do
870 $Check $arglist || exit 1
871 done < $CheckList
872 %endif
873
874 %install
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/00-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/00-ldconfig.script << EOF
1038 #!/bin/sh
1039 ldconfig -X
1040 EOF
1041 chmod 0755 %buildroot%{_var}/lib/rpm/filetriggers/00-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/00-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.30