/[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 337272 - (show annotations) (download)
Tue Jan 1 14:21:37 2013 UTC (11 years, 3 months ago) by tmb
Original Path: cauldron/glibc/current/SPECS/glibc.spec
File size: 47979 byte(s)
- update to 2.17
- drop upstream release screwup fix
- ports is now merged back with upstream glibc
- adapt P1 (path fixes) according to Mga and UsrMove setup
- rediff P2 (nss upgrade)
- drop P5 (assign global scope to RFC1918 adresses, fixed properly upstream)
- drop P10 (revert pthread_cond_wait change, merged upstream)
- rediff P26: nice priority fix
- rediff P30 (filter out multiarch headers)
- rediff P38 (disable parellel testusite on powerpc)
- rediff P42 (avx owl crypt)
- rediff P39 (freesec crypt support)
- drop P60, P61 (strncasecmp segfault fix, strtod integer buffer overflow
  fix, merged)


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

  ViewVC Help
Powered by ViewVC 1.1.30