/[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 724574 - (show annotations) (download)
Thu Sep 25 08:46:52 2014 UTC (9 years, 6 months ago) by tmb
File size: 46876 byte(s)
- Fix memory leak in libio/wfileops.c do_ftell_wide [BZ #17370]
- Fix memory leak in error path of do_ftell_wide [BZ #17370]


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

  ViewVC Help
Powered by ViewVC 1.1.30