/[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 3099 - (show annotations) (download)
Sun Jan 9 15:49:21 2011 UTC (13 years, 2 months ago) by blino
Original Path: cauldron/glibc/current/SPECS/glibc.spec
File size: 45857 byte(s)
remove old ldconfig scriptlets

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

  ViewVC Help
Powered by ViewVC 1.1.30