/[packages]/updates/3/glibc/current/SPECS/glibc.spec
ViewVC logotype

Contents of /updates/3/glibc/current/SPECS/glibc.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30