/[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 820468 - (show annotations) (download)
Sat Apr 18 22:13:05 2015 UTC (9 years ago) by tmb
File size: 49022 byte(s)
nscd needs /var/db/nscd (mga#15545)
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 18
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 install -d -m 755 %{buildroot}%{_var}/db/nscd
1067 %endif
1068
1069 # These man pages require special attention
1070 mkdir -p %{buildroot}%{_mandir}/man3
1071 install -p -m 0644 crypt_blowfish-%{crypt_bf_ver}/*.3 %{buildroot}%{_mandir}/man3/
1072
1073 # Useless and takes place
1074 rm -rf %buildroot/%{_datadir}/zoneinfo/{posix,right}
1075
1076 # Include ld.so.conf
1077 %if "%{name}" == "glibc"
1078 %if %isarch mips mipsel
1079 # needed to get a ldd which understands o32, n32, 64
1080 install -m 755 $RPM_BUILD_DIR/%{source_dir}/build-mips64el-linux/elf/ldd $RPM_BUILD_ROOT/%{_bindir}/ldd
1081 %endif
1082 echo "include /etc/ld.so.conf.d/*.conf" > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf
1083 chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf
1084 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d
1085
1086 # ldconfig cache
1087 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/ldconfig
1088 touch $RPM_BUILD_ROOT%{_var}/cache/ldconfig/aux-cache
1089
1090 # automatic ldconfig cache update on rpm installs/removals
1091 # (see http://wiki.mandriva.com/en/Rpm_filetriggers)
1092 install -d %buildroot%{_var}/lib/rpm/filetriggers
1093 cat > %buildroot%{_var}/lib/rpm/filetriggers/00-ldconfig.filter << EOF
1094 ^.((/lib|/usr/lib)(32|64)?/[^/]*\.so\.|/etc/ld.so.conf.d/[^/]*\.conf)
1095 EOF
1096 cat > %buildroot%{_var}/lib/rpm/filetriggers/00-ldconfig.script << EOF
1097 #!/bin/sh
1098 ldconfig -X
1099 EOF
1100 chmod 0755 %buildroot%{_var}/lib/rpm/filetriggers/00-ldconfig.script
1101 %endif
1102
1103 # Include %{_libdir}/gconv/gconv-modules.cache
1104 > $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
1105 chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
1106
1107 %if "%{name}" == "glibc"
1108 touch $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.cache
1109 %endif
1110
1111 # Add libraries to debug sub-package
1112 %if %{build_debug}
1113 mkdir $RPM_BUILD_ROOT%{_libdir}/debug
1114 #cp -a $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_libdir}/debug/
1115 #rm -f $RPM_BUILD_ROOT%{_libdir}/debug/*_p.a
1116 cp -a $RPM_BUILD_ROOT%{_slibdir}/lib*.so* $RPM_BUILD_ROOT%{_libdir}/debug/
1117
1118 pushd $RPM_BUILD_ROOT%{_libdir}/debug
1119 for lib in *.so*; do
1120 [[ -f "$lib" ]] && DEBUG_LIBS="$DEBUG_LIBS %{_libdir}/debug/$lib"
1121 done
1122 popd
1123 %endif
1124
1125 # Are we cross-compiling?
1126 Strip="strip"
1127 if [[ "%{_target_cpu}" != "%{target_cpu}" ]]; then
1128 Strip="%{cross_program_prefix}$Strip"
1129 fi
1130
1131 # Strip debugging info from all static libraries
1132 pushd $RPM_BUILD_ROOT%{_slibdir}
1133 for i in *.a; do
1134 if [ -f "$i" ]; then
1135 case "$i" in
1136 *_p.a) ;;
1137 *) $Strip -g -R .comment $i ;;
1138 esac
1139 fi
1140 done
1141 popd
1142
1143 # post install wrapper
1144 %__cc -Os -DSLIBDIR="\"%{_slibdir}\"" -DASH_BIN="\"%{ash_bin}\"" %{SOURCE14} -static \
1145 -L $RPM_BUILD_ROOT%{_libdir}/ \
1146 -o $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper
1147 chmod 700 $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper
1148
1149 # rquota.x and rquota.h are now provided by quota
1150 rm -f $RPM_BUILD_ROOT%{_includedir}/rpcsvc/rquota.[hx]
1151
1152 # Hardlink identical locale files together
1153 %if %{build_i18ndata}
1154 %{_sbindir}/hardlink -vc $RPM_BUILD_ROOT%{_datadir}/locale
1155 %endif
1156
1157 rm -rf $RPM_BUILD_ROOT%{_includedir}/netatalk/
1158
1159 # Build file list for devel package
1160 find $RPM_BUILD_ROOT%{_includedir} -type f -or -type l > devel.filelist
1161 find $RPM_BUILD_ROOT%{_includedir} -type d | sed "s/^/%dir /" | \
1162 grep -v "%{_libdir}/libnss1.*.so$" | \
1163 grep -v "%{_includedir}$" | >> devel.filelist
1164 find $RPM_BUILD_ROOT%{_libdir} -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1165 # biarch libs
1166 %if %{build_biarch}
1167 find $RPM_BUILD_ROOT%{_prefix}/lib -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1168 %endif
1169 %if %isarch mips mipsel
1170 find $RPM_BUILD_ROOT%{_libdir}32 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1171 find $RPM_BUILD_ROOT%{_libdir}64 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1172 %endif
1173 perl -pi -e "s|$RPM_BUILD_ROOT||" devel.filelist
1174
1175 # /etc/localtime - we're proud of our timezone #Well we may put Paris
1176 %if %{build_timezone}
1177 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1178 cp -f $RPM_BUILD_ROOT%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1179 #ln -sf ..%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1180 %endif
1181
1182 # [gg] build PDF documentation
1183 %if %{build_pdf_doc}
1184 (cd manual; texi2dvi -p -t @afourpaper -t @finalout libc.texinfo)
1185 %endif
1186
1187 # the last bit: more documentation
1188 rm -rf documentation
1189 mkdir documentation
1190 cp timezone/README documentation/README.timezone
1191 cp ChangeLog* documentation
1192 gzip -9 documentation/ChangeLog*
1193 mkdir documentation/crypt_blowfish-%{crypt_bf_ver}
1194 install -m 644 crypt_blowfish-%{crypt_bf_ver}/{README,LINKS,PERFORMANCE} \
1195 documentation/crypt_blowfish-%{crypt_bf_ver}
1196
1197 # Generate final rpm filelist, with localized libc.mo files
1198 rm -f rpm.filelist
1199 %if "%{name}" == "glibc"
1200 %find_lang libc
1201 perl -ne '/^\s*$/ or print' libc.lang > rpm.filelist
1202 %endif
1203 cat extralibs.filelist >> rpm.filelist
1204
1205 # Remove unpackaged files
1206 rm -f $RPM_BUILD_ROOT%{_infodir}/dir.old*
1207 rm -rf $RPM_BUILD_ROOT%{_includedir}/asm-*/mach-*/
1208 rm -f $RPM_BUILD_ROOT%{_datadir}/locale/locale-archive*
1209 rm -f $RPM_BUILD_ROOT%{_var}/db/Makefile
1210
1211 %if !%{build_utils}
1212 %if %{build_biarch}
1213 rm -f $RPM_BUILD_ROOT%{_slibdir32}/libmemusage.so
1214 rm -f $RPM_BUILD_ROOT%{_slibdir32}/libpcprofile.so
1215 %endif
1216 %if %isarch mips mipsel
1217 rm -f $RPM_BUILD_ROOT%{_slibdir}32/libmemusage.so
1218 rm -f $RPM_BUILD_ROOT%{_slibdir}32/libpcprofile.so
1219 rm -f $RPM_BUILD_ROOT%{_slibdir}64/libmemusage.so
1220 rm -f $RPM_BUILD_ROOT%{_slibdir}64/libpcprofile.so
1221 %endif
1222 rm -f $RPM_BUILD_ROOT%{_slibdir}/libmemusage.so
1223 rm -f $RPM_BUILD_ROOT%{_slibdir}/libpcprofile.so
1224 rm -f $RPM_BUILD_ROOT%{_bindir}/memusage
1225 rm -f $RPM_BUILD_ROOT%{_bindir}/memusagestat
1226 rm -f $RPM_BUILD_ROOT%{_bindir}/mtrace
1227 rm -f $RPM_BUILD_ROOT%{_bindir}/pcprofiledump
1228 rm -f $RPM_BUILD_ROOT%{_bindir}/xtrace
1229 %endif
1230
1231 %if !%{build_timezone}
1232 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1233 rm -f $RPM_BUILD_ROOT%{_sbindir}/zdump
1234 rm -f $RPM_BUILD_ROOT%{_sbindir}/zic
1235 rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo
1236 %endif
1237
1238 %if !%{build_i18ndata}
1239 rm -rf $RPM_BUILD_ROOT%{_datadir}/i18n
1240 %endif
1241
1242 %if "%{name}" != "glibc"
1243 rm -rf $RPM_BUILD_ROOT/boot
1244 rm -rf $RPM_BUILD_ROOT/sbin
1245 rm -rf $RPM_BUILD_ROOT/usr/share
1246 rm -rf $RPM_BUILD_ROOT%{_bindir}
1247 rm -rf $RPM_BUILD_ROOT%{_sbindir}
1248 rm -rf $RPM_BUILD_ROOT%{_datadir}
1249 rm -rf $RPM_BUILD_ROOT%{_infodir}
1250 rm -rf $RPM_BUILD_ROOT%{_prefix}/etc
1251 rm -rf $RPM_BUILD_ROOT%{_libdir}/gconv
1252 %endif
1253
1254 # In case we are cross-compiling, don't bother to remake symlinks and
1255 # fool spec-helper when stripping files
1256 %if "%{name}" != "glibc"
1257 export DONT_SYMLINK_LIBS=1
1258 export PATH=%{_bindir}:$PATH
1259 %endif
1260
1261 %if %build_debug
1262 export EXCLUDE_FROM_STRIP="$DEBUG_LIBS"
1263 %endif
1264
1265 # This will make the '-g' argument to be passed to eu-strip for these
1266 # libraries, so that only debug symbols are stripped and gdb/valgrind continue
1267 # to work without needing glibc-debug package to be installed.
1268 export EXCLUDE_FROM_FULL_STRIP="ld-%{glibcversion}.so libpthread libc-%{glibcversion}.so"
1269
1270 %if "%{name}" == "glibc"
1271 %define upgradestamp %{_slibdir}/glibc.upgraded
1272 %define broken_link %{_slibdir}/libnss_nis.so.1 %{_slibdir}/libnss_files.so.1 %{_slibdir}/libnss_dns.so.1 %{_slibdir}/libnss_compat.so.1
1273
1274
1275 %pre -p <lua>
1276 if posix.stat("/usr%{_slibdir}", "type") == 'directory' then
1277 if not posix.stat("/usr%{_slibdir}/libnss_files-%{glibcversion}.so") then
1278 io.open("%{upgradestamp}", "w"):close()
1279 end
1280 end
1281
1282 %post -p %{_sbindir}/glibc-post-wrapper
1283 export LC_ALL=C
1284
1285 if [ "$1" -gt 1 ]; then
1286 # migrate /etc/ld.so.conf to include the new /etc/ld.so.conf.d/
1287 # without external commands but for removing the temporary file
1288 ldso_conf=/etc/ld.so.conf
1289 while read i; do
1290 [ "$i" = "include /etc/ld.so.conf.d/*.conf" ] && keep=1
1291 # Remove previously used include line without absolute path
1292 [ "$i" = "include ld.so.conf.d/*.conf" ] || echo $i
1293 done < $ldso_conf > $ldso_conf-
1294 if [ -z "$keep" ]; then
1295 echo "include /etc/ld.so.conf.d/*.conf" > $ldso_conf
1296 while read i; do
1297 echo $i
1298 done < $ldso_conf- >> $ldso_conf
1299 fi
1300 [ -x /bin/rm ] && /bin/rm -f $ldso_conf-
1301 fi
1302 /sbin/ldconfig
1303
1304 if [ "$1" -gt 1 ]; then
1305 # On upgrade the services doesn't work because libnss couldn't be
1306 # loaded anymore.
1307 if [ -f %{upgradestamp} ]; then
1308 if /usr/bin/readlink /proc/1/exe >/dev/null && \
1309 /usr/bin/readlink /proc/1/root >/dev/null; then
1310 if [ -x /sbin/telinit -a -p /dev/initctl ]; then
1311 /sbin/telinit u
1312 fi
1313 if [ -x /etc/init.d/sshd -a \
1314 -x /usr/sbin/sshd -a \
1315 -x /bin/bash ]; then
1316 /etc/init.d/sshd condrestart
1317 fi
1318 fi
1319 fi
1320 if [ -f /bin/rm ]; then
1321 for i in %broken_link; do
1322 if [ -e $i ] && [ ! -L $i ]; then
1323 /bin/rm -f $i
1324 fi
1325 done
1326 fi
1327 fi
1328 [ -x /bin/rm ] && /bin/rm -f %{upgradestamp}
1329
1330 # always generate the gconv-modules.cache
1331 %{_sbindir}/iconvconfig -o %{_libdir}/gconv/gconv-modules.cache --nostdlib %{_libdir}/gconv
1332
1333 %endif
1334
1335 %pre devel
1336 if [ -L %{_includedir}/scsi ]; then
1337 rm -f %{_includedir}/scsi
1338 fi
1339 if [ -L %{_includedir}/sound ]; then
1340 rm -f %{_includedir}/sound
1341 fi
1342 if [ -L %{_includedir}/linux ]; then
1343 rm -f %{_includedir}/linux
1344 fi
1345 if [ -L %{_includedir}/asm ]; then
1346 rm -f %{_includedir}/asm
1347 fi
1348 if [ -L %{_includedir}/asm-generic ]; then
1349 rm -f %{_includedir}/asm-generic
1350 fi
1351 %if %isarch x86_64
1352 if [ -L %{_includedir}/asm-x86_64 ]; then
1353 rm -f %{_includedir}/asm-x86_64
1354 fi
1355 if [ -L %{_includedir}/asm-i386 ]; then
1356 rm -f %{_includedir}/asm-i386
1357 fi
1358 %endif
1359 %if %isarch %mips
1360 if [ -L %{_includedir}/asm-mips ]; then
1361 rm -f %{_includedir}/asm-mips
1362 fi
1363 %endif
1364 %if %isarch %arm
1365 if [ -L %{_includedir}/asm-arm ]; then
1366 rm -f %{_includedir}/asm-arm
1367 fi
1368 %endif
1369 exit 0
1370
1371 %if %{build_doc}
1372 %post doc
1373 %_install_info libc.info
1374
1375 %preun doc
1376 %_remove_install_info libc.info
1377 %endif
1378
1379 %if %{build_nscd}
1380 %pre -n nscd
1381 %_pre_useradd nscd / /bin/false
1382
1383 %post -n nscd
1384 %_tmpfilescreate nscd
1385 %_post_service nscd
1386
1387 %preun -n nscd
1388 %_preun_service nscd
1389
1390 %postun -n nscd
1391 %_postun_userdel nscd
1392
1393 if [ "$1" -ge "1" ]; then
1394 /sbin/service nscd condrestart > /dev/null 2>&1 || :
1395 fi
1396 %endif
1397
1398 %clean
1399 #rm -rf "$RPM_BUILD_ROOT"
1400 #rm -f *.filelist*
1401
1402 #
1403 # glibc
1404 #
1405 %files -f rpm.filelist
1406 %if "%{name}" == "glibc"
1407 %if %{build_timezone}
1408 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/localtime
1409 %endif
1410 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/nsswitch.conf
1411 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ld.so.conf
1412 %dir %{_sysconfdir}/ld.so.conf.d
1413 %config(noreplace) %{_sysconfdir}/rpc
1414 %doc nis/nss
1415 %doc posix/gai.conf
1416 %{_datadir}/locale/locale.alias
1417 /sbin/sln
1418 %dir %{_prefix}/libexec/getconf
1419 %{_prefix}/libexec/getconf/*
1420 %endif
1421 %{_slibdir}/ld-%{glibcversion}.so
1422 %if %isarch i386
1423 %{_slibdir}/ld-linux.so.2
1424 %endif
1425 %if %isarch %arm
1426 %{_slibdir}/ld-linux.so.3
1427 %endif
1428 %if %isarch x86_64
1429 %{_slibdir}/ld-linux-x86-64.so.2
1430 %endif
1431 %if %isarch %mips
1432 %{_slibdir}/ld.so.1
1433 %endif
1434 %{_slibdir}/lib*-[.0-9]*.so
1435 %{_slibdir}/lib*.so.[0-9]*
1436 %{_slibdir}/libSegFault.so
1437 %if "%{name}" == "glibc"
1438 %dir %{_libdir}/audit
1439 %{_libdir}/audit/sotruss-lib.so
1440 %dir %{_libdir}/gconv
1441 %{_libdir}/gconv/*.so
1442 %{_libdir}/gconv/gconv-modules
1443 %ghost %{_libdir}/gconv/gconv-modules.cache
1444 %{_bindir}/catchsegv
1445 %{_bindir}/gencat
1446 %{_bindir}/getconf
1447 %{_bindir}/getent
1448 %{_bindir}/iconv
1449 %{_bindir}/ldd
1450 %if %isarch i386
1451 %{_bindir}/lddlibc4
1452 %endif
1453 %{_bindir}/locale
1454 %{_bindir}/localedef
1455 %{_bindir}/makedb
1456 %{_bindir}/pldd
1457 %{_bindir}/rpcgen
1458 %{_bindir}/sotruss
1459 %{_bindir}/sprof
1460 %{_bindir}/tzselect
1461 %{_sbindir}/iconvconfig
1462 %{_sbindir}/glibc-post-wrapper
1463 %endif
1464
1465 %if %{build_biarch}
1466 %{_slibdir32}/ld-%{glibcversion}.so
1467 %{_slibdir32}/ld-linux*.so.2
1468 %{_slibdir32}/lib*-[.0-9]*.so
1469 %{_slibdir32}/lib*.so.[0-9]*
1470 %{_slibdir32}/libSegFault.so
1471 %dir %{_prefix}/lib/audit
1472 %{_prefix}/lib/audit/sotruss-lib.so
1473 %dir %{_prefix}/lib/gconv
1474 %{_prefix}/lib/gconv/*
1475 %endif
1476 %if %isarch mips mipsel
1477 %{_slibdir}32/ld-%{glibcversion}.so
1478 %{_slibdir}32/ld.so.1
1479 %{_slibdir}32/lib*-[.0-9]*.so
1480 %{_slibdir}32/lib*.so.[0-9]*
1481 %{_slibdir}32/libSegFault.so
1482 %dir %{_libdir}32/gconv
1483 %{_libdir}32/gconv/*
1484 %{_slibdir}64/ld-%{glibcversion}.so
1485 %{_slibdir}64/ld.so.1
1486 %{_slibdir}64/lib*-[.0-9]*.so
1487 %{_slibdir}64/lib*.so.[0-9]*
1488 %{_slibdir}64/libSegFault.so
1489 %dir %{_libdir}64/gconv
1490 %{_libdir}64/gconv/*
1491 %endif
1492
1493 #
1494 # ldconfig
1495 #
1496 %if "%{name}" == "glibc"
1497 /sbin/ldconfig
1498 %ghost %{_sysconfdir}/ld.so.cache
1499 %dir %{_var}/cache/ldconfig
1500 %ghost %{_var}/cache/ldconfig/aux-cache
1501 %{_var}/lib/rpm/filetriggers/00-ldconfig.*
1502 %endif
1503
1504 #
1505 # glibc-devel
1506 #
1507 %files devel -f devel.filelist
1508 %doc README NEWS INSTALL BUGS PROJECTS CONFORMANCE
1509 %doc COPYING COPYING.LIB
1510 %doc documentation/*
1511 %doc hesiod/README.hesiod
1512 %doc crypt/README.ufc-crypt
1513 %if "%{name}" == "glibc"
1514 %{_mandir}/man3/*
1515 %endif
1516 %{_libdir}/libc_nonshared.a
1517 %{_libdir}/libg.a
1518 %{_libdir}/libieee.a
1519 %{_libdir}/libmcheck.a
1520 %{_libdir}/libpthread_nonshared.a
1521 %if "%{name}" == "glibc"
1522 %{_libdir}/librpcsvc.a
1523 %endif
1524
1525 %if %{build_biarch}
1526 %{_prefix}/lib/libc_nonshared.a
1527 %{_prefix}/lib/libg.a
1528 %{_prefix}/lib/libieee.a
1529 %{_prefix}/lib/libmcheck.a
1530 %{_prefix}/lib/libpthread_nonshared.a
1531 %{_prefix}/lib/librpcsvc.a
1532 %endif
1533
1534 %if %isarch mips mipsel
1535 %{_libdir}32/libc_nonshared.a
1536 %{_libdir}32/libg.a
1537 %{_libdir}32/libieee.a
1538 %{_libdir}32/libmcheck.a
1539 %{_libdir}32/libpthread_nonshared.a
1540 %if "%{name}" == "glibc"
1541 %{_libdir}32/librpcsvc.a
1542 %endif
1543 %{_libdir}64/libc_nonshared.a
1544 %{_libdir}64/libg.a
1545 %{_libdir}64/libieee.a
1546 %{_libdir}64/libmcheck.a
1547 %{_libdir}64/libpthread_nonshared.a
1548 %if "%{name}" == "glibc"
1549 %{_libdir}64/librpcsvc.a
1550 %endif
1551 %endif
1552
1553 #
1554 # glibc-static-devel
1555 #
1556 %files static-devel
1557 %doc COPYING COPYING.LIB
1558 %{_libdir}/libBrokenLocale.a
1559 %{_libdir}/libanl.a
1560 %{_libdir}/libc.a
1561 %{_libdir}/libcrypt.a
1562 %{_libdir}/libdl.a
1563 %{_libdir}/libm.a
1564 %{_libdir}/libnsl.a
1565 %{_libdir}/libpthread.a
1566 %{_libdir}/libresolv.a
1567 %{_libdir}/librt.a
1568 %{_libdir}/libutil.a
1569
1570 %if %{build_biarch}
1571 %{_prefix}/lib/libBrokenLocale.a
1572 %{_prefix}/lib/libanl.a
1573 %{_prefix}/lib/libc.a
1574 %{_prefix}/lib/libcrypt.a
1575 %{_prefix}/lib/libdl.a
1576 %{_prefix}/lib/libm.a
1577 %{_prefix}/lib/libnsl.a
1578 %{_prefix}/lib/libpthread.a
1579 %{_prefix}/lib/libresolv.a
1580 %{_prefix}/lib/librt.a
1581 %{_prefix}/lib/libutil.a
1582 %endif
1583
1584 %if %isarch mips mipsel
1585 %{_libdir}32/libBrokenLocale.a
1586 %{_libdir}32/libanl.a
1587 %{_libdir}32/libc.a
1588 %{_libdir}32/libcrypt.a
1589 %{_libdir}32/libdl.a
1590 %{_libdir}32/libm.a
1591 %{_libdir}32/libnsl.a
1592 %{_libdir}32/libpthread.a
1593 %{_libdir}32/libresolv.a
1594 %{_libdir}32/librt.a
1595 %{_libdir}32/libutil.a
1596
1597 %{_libdir}64/libBrokenLocale.a
1598 %{_libdir}64/libanl.a
1599 %{_libdir}64/libc.a
1600 %{_libdir}64/libcrypt.a
1601 %{_libdir}64/libdl.a
1602 %{_libdir}64/libm.a
1603 %{_libdir}64/libnsl.a
1604 %{_libdir}64/libpthread.a
1605 %{_libdir}64/libresolv.a
1606 %{_libdir}64/librt.a
1607 %{_libdir}64/libutil.a
1608 %endif
1609
1610 #
1611 # glibc-doc
1612 #
1613 %if %{build_doc}
1614 %files doc
1615 %{_infodir}/libc.info*
1616 %endif
1617
1618 #
1619 # glibc-doc-pdf
1620 #
1621 %if %{build_pdf_doc}
1622 %files doc-pdf
1623 %doc manual/libc.pdf
1624 %endif
1625
1626 #
1627 # glibc-debug
1628 #
1629 %if %{build_debug}
1630 %files debug
1631 %dir %{_libdir}/debug
1632 %{_libdir}/debug/*.so
1633 %{_libdir}/debug/*.so.*
1634 %if %isarch mips mipsel
1635 %dir %{_libdir}/debug/lib32
1636 %{_libdir}/debug/lib32/*.so
1637 %{_libdir}/debug/lib32/*.so.*
1638 %dir %{_libdir}/debug/lib64
1639 %{_libdir}/debug/lib64/*.so
1640 %{_libdir}/debug/lib64/*.so.*
1641 %endif
1642 %endif
1643
1644 #
1645 # glibc-profile
1646 #
1647 %if %{build_profile}
1648 %files profile
1649 %{_libdir}/lib*_p.a
1650 %if %{build_biarch}
1651 %{_prefix}/lib/lib*_p.a
1652 %endif
1653 %if %isarch mips mipsel
1654 %{_libdir}32/lib*_p.a
1655 %{_libdir}64/lib*_p.a
1656 %endif
1657 %endif
1658
1659 #
1660 # glibc-utils
1661 #
1662 %if %{build_utils}
1663 %files utils
1664 %if %{build_biarch}
1665 %{_slibdir32}/libmemusage.so
1666 %{_slibdir32}/libpcprofile.so
1667 %endif
1668 %{_slibdir}/libmemusage.so
1669 %{_slibdir}/libpcprofile.so
1670 %{_bindir}/memusage
1671 %{_bindir}/memusagestat
1672 %{_bindir}/mtrace
1673 %{_bindir}/pcprofiledump
1674 %{_bindir}/xtrace
1675 %if %isarch mips mipsel
1676 %{_slibdir}32/libmemusage.so
1677 %{_slibdir}32/libpcprofile.so
1678 %{_slibdir}64/libmemusage.so
1679 %{_slibdir}64/libpcprofile.so
1680 %endif
1681 %endif
1682
1683 #
1684 # nscd
1685 #
1686 %if %{build_nscd}
1687 %files -n nscd
1688 %config(noreplace) %{_sysconfdir}/nscd.conf
1689 %{_sbindir}/nscd
1690 %{_unitdir}/nscd.service
1691 %{_unitdir}/nscd.socket
1692 %{_tmpfilesdir}/nscd.conf
1693 %dir %{_var}/db/nscd
1694 %endif
1695
1696 #
1697 # timezone
1698 #
1699 %if %{build_timezone}
1700 %files -n timezone
1701 %{_sbindir}/zdump
1702 %{_sbindir}/zic
1703 %dir %{_datadir}/zoneinfo
1704 %{_datadir}/zoneinfo/*
1705 %endif
1706
1707 #
1708 # glibc-i18ndata
1709 #
1710 %if %{build_i18ndata}
1711 %files i18ndata
1712 %dir %{_datadir}/i18n
1713 %dir %{_datadir}/i18n/charmaps
1714 %{_datadir}/i18n/charmaps/*
1715 %dir %{_datadir}/i18n/locales
1716 %{_datadir}/i18n/locales/*
1717 %{_datadir}/i18n/SUPPORTED
1718 %endif

  ViewVC Help
Powered by ViewVC 1.1.30