/[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 820464 - (show annotations) (download)
Sat Apr 18 15:11:52 2015 UTC (9 years ago) by tmb
File size: 48955 byte(s)
- Fix _IO_wstr_overflow integer overflow (PR/BZ #17269)
- Fix read past end of pattern in fnmatch (PR/BZ #18032)


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

  ViewVC Help
Powered by ViewVC 1.1.30