/[packages]/cauldron/glibc/current/SPECS/glibc.spec
ViewVC logotype

Contents of /cauldron/glibc/current/SPECS/glibc.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1397895 - (show annotations) (download)
Wed May 15 19:45:57 2019 UTC (4 years, 11 months ago) by tmb
File size: 43405 byte(s)
Fix crash in _IO_wfile_sync [BZ #20568]
1 # RH 2.2.4-20, SuSE 2.3.1-32
2
3 # <epoch>:<version>-<release> tags for glibc main package
4 %define glibcversion 2.29
5 %define __glibcrelease 11
6 %define glibcepoch 6
7
8 %define source_package glibc-%{glibcversion}
9 %define source_dir glibc-%{glibcversion}
10 %define _glibcrelease %{__glibcrelease}
11
12 %define glibcrelease %mkrel %{_glibcrelease}
13
14 # Define "cross" to an architecture to which glibc is to be
15 # cross-compiled
16 %define build_cross 0
17 %{expand: %{?cross: %%global build_cross 1}}
18
19 %if %{build_cross}
20 %define target_cpu %{cross}
21 %define cross_prefix cross-%{target_cpu}-
22 %define _prefix /usr/%{target_cpu}-%{_real_vendor}-linux%{gnuext}
23 %define cross_program_prefix %{target_cpu}-%{_real_vendor}-linux%{gnuext}-
24 %define _exec_prefix %{_prefix}
25 # brain damage alert: should not be needed imho
26 # overriding _prefix and _exec_prefix should be enough
27 %define _bindir %{_exec_prefix}/bin
28 %define _sbindir %{_exec_prefix}/sbin
29 %define _libexecdir %{_exec_prefix}/libexec
30 %define _datadir %{_prefix}/share
31 %define _sharedstatedir %{_prefix}/com
32 %define _localstatedir %{_prefix}/var
33 %define _lib lib
34 %define _libdir %{_exec_prefix}/%{_lib}
35 %define _slibdir %{_exec_prefix}/%{_lib}
36 %define _slibdir32 %{_exec_prefix}/lib
37 %define _includedir %{_prefix}/include
38 %else
39 %define gnuext %{_gnu}
40 %define target_cpu %{_target_cpu}
41 %define cross_prefix %{nil}
42 %define cross_program_prefix %{nil}
43 %define _slibdir /%{_lib}
44 %define _slibdir32 /lib
45 %endif
46
47 # Define target (base) architecture
48 %define arch %(echo %{target_cpu}|sed -e "s/\\(i.86\\|athlon\\)/i386/" -e "s/amd64/x86_64/")
49 %define isarch() %(case " %* " in (*" %{arch} "*) echo 1;; (*) echo 0;; esac)
50
51 %if %{build_cross}
52 %if %isarch %arm
53 %define gnuext -gnueabi
54 %else
55 %define gnuext -gnu
56 %endif
57 %endif
58
59 # Define Xen arches to build with -mno-tls-direct-direct-seg-refs
60 %define xenarches %{ix86} x86_64
61
62 # arches which requires glibc-port
63 %define ports_arch %arm %mips
64
65 # Define to build nscd with selinux support
66 %define build_selinux 0
67
68 # Flag for build_pdf_doc:
69 # 1 build glibc with PDF documentation
70 # 0 don't build PDF glibc documentation (e.g. for bootstrap build)
71 %define build_pdf_doc 0
72
73 # Enable checking by default for arches where we know tests all pass
74 %define build_check 0
75
76 # Allow make check to fail only when running kernels where we know
77 # tests must pass (no missing features or bugs in the kernel)
78 %define check_min_kver 2.6.32
79
80 # Define to build a biarch package
81 %define build_biarch 0
82 %if %isarch x86_64 mips64 mips64el
83 %define build_biarch 1
84 %endif
85
86 # Define to build glibc-debug package
87 %define build_debug 1
88 %define _enable_debug_packages 1
89 %if "%{_enable_debug_packages}" == "1"
90 %define build_debug 0
91 %endif
92
93 # Define to bootstrap new glibc
94 %define build_bootstrap 0
95 %{expand: %{!?build_cross_bootstrap: %global build_cross_bootstrap 0}}
96
97 %define build_profile 1
98 %define build_nscd 1
99 %define build_doc 1
100 %define build_utils 1
101 %define build_i18ndata 1
102 %define build_timezone 0
103
104 # Disable a few defaults when cross-compiling a glibc
105 %if %{build_cross}
106 %define build_doc 0
107 %define build_pdf_doc 0
108 %define build_biarch 0
109 %define build_check 0
110 %define build_debug 0
111 %define build_nscd 0
112 %define build_profile 0
113 %define build_utils 0
114 %define build_i18ndata 0
115 %define build_timezone 0
116 %endif
117
118 # Allow --with[out] <feature> at rpm command line build
119 %{expand: %{?_without_PDF: %%global build_pdf_doc 0}}
120 %{expand: %{?_without_CHECK: %%global build_check 0}}
121 %{expand: %{?_without_UTILS: %%global build_utils 0}}
122 %{expand: %{?_without_BOOTSTRAP:%%global build_bootstrap 0}}
123 %{expand: %{?_with_PDF: %%global build_pdf_doc 1}}
124 %{expand: %{?_with_CHECK: %%global build_check 1}}
125 %{expand: %{?_with_UTILS: %%global build_utils 1}}
126 %{expand: %{?_with_BOOTSTRAP: %%global build_bootstrap 1}}
127
128 Summary: The GNU libc libraries
129 Name: %{cross_prefix}glibc
130 Version: %{glibcversion}
131 Release: %{glibcrelease}
132 Epoch: %{glibcepoch}
133 License: LGPL
134 Group: System/Libraries
135 Url: https://www.gnu.org/software/libc/
136
137 # FSF source
138 Source0: https://ftpmirror.gnu.org/libc/%{source_package}.tar.xz
139 Source1: https://ftpmirror.gnu.org/libc/%{source_package}.tar.xz.sig
140 Source2: glibc-git.sh
141
142 Source4: glibc-find-requires.sh
143 Source5: glibc-check.sh
144 Source6: nscd.service
145 Source7: nscd.socket
146 Source8: nsswitch.conf
147 Source9: nscd.conf
148
149 # wrapper to avoid rpm circular dependencies
150 Source14: glibc-post-wrapper.c
151
152 %if %{build_cross}
153 Autoreq: false
154 Autoprov: false
155 %else
156 Provides: should-restart = system
157 %if %isarch %{xenarches}
158 Obsoletes: %{name}-xen
159 Provides: %{name}-xen
160 %endif
161 # The dynamic linker supports DT_GNU_HASH
162 Provides: rtld(GNU_HASH)
163 Autoreq: false
164 %endif
165 BuildRequires: bison >= 3.3.1-1
166 BuildRequires: patch
167 BuildRequires: gettext
168 BuildRequires: perl
169 BuildRequires: kernel-userspace-headers
170 BuildRequires: libstdc++-static-devel
171 BuildRequires: hardlink
172 %if %{build_selinux}
173 BuildRequires: pkgconfig(libselinux) >= 1.17.10
174 %endif
175 # (tmb) force latest binutils
176 BuildRequires: %{cross_prefix}binutils >= 1:2.32-5
177 # we need the static dash
178 %define ash_bin /usr/bin/dash.static
179 Requires(post): dash-static
180 Requires(post): grep
181 Requires: filesystem >= 2.1.9-18
182 # ensure libxcrypt is installed as glibc crypt is disabled / being obsoleted
183 Requires: %{_lib}xcrypt1 >= 4.1.1-1
184 # (tmb) force new gcc 8.3
185 BuildRequires: %{cross_prefix}gcc >= 8.3.1-0.20190419.2
186 %if !%{build_cross}
187 %ifarch mips mipsel
188 Provides: ld.so.1
189 %endif
190 %endif
191
192 BuildRequires: texinfo
193 BuildRequires: texinfo-tex
194 %if %{build_pdf_doc}
195 BuildRequires: texlive
196 %endif
197 %if %{build_utils}
198 BuildRequires: pkgconfig(gdlib)
199 %endif
200 BuildRequires: autoconf2.5
201 BuildRequires: pkgconfig(libcap)
202 BuildRequires: rpm-mageia-setup-build >= 1.147
203 BuildRequires: spec-helper >= 0.31.2
204
205 ###
206 ### upstream release/2.29/master branch
207 ### git format-patch --start-number 200 glibc-2.29..origin/release/2.29/master
208 ###
209 Patch200: 0200-nptl-Fix-pthread_rwlock_try-lock-stalls-Bug-23844.patch
210 Patch201: 0201-x86-64-memcmp-Use-unsigned-Jcc-instructions-on-size-.patch
211 Patch202: 0202-arm-Use-nr-constraint-for-Systemtap-probes-BZ-24164.patch
212 Patch203: 0203-Add-compiler-barriers-around-modifications-of-the-ro.patch
213 Patch204: 0204-nptl-Avoid-fork-handler-lock-for-async-signal-safe-f.patch
214 Patch205: 0205-nptl-Fix-invalid-Systemtap-probe-in-pthread_join-BZ-.patch
215 Patch206: 0206-Fix-output-of-LD_SHOW_AUXV-1.patch
216 Patch207: 0207-regex-fix-read-overrun-BZ-24114.patch
217 Patch208: 0208-Record-CVE-2019-9169-in-NEWS-and-ChangeLog-BZ-24114.patch
218 Patch209: 0209-S390-Mark-vx-and-vxe-as-important-hwcap.patch
219 Patch210: 0210-ja_JP-Change-the-offset-for-Taisho-gan-nen-from-2-to.patch
220 Patch211: 0211-ja_JP-locale-Add-entry-for-the-new-Japanese-era-BZ-2.patch
221 Patch212: 0212-malloc-Set-and-reset-all-hooks-for-tracing-Bug-16573.patch
222 Patch213: 0213-memusagestat-use-local-glibc-when-linking-BZ-18465.patch
223 Patch214: 0214-Revert-memusagestat-use-local-glibc-when-linking-BZ-.patch
224 Patch215: 0215-support-Add-support_capture_subprogram.patch
225 Patch216: 0216-elf-Fix-pldd-BZ-18035.patch
226 Patch217: 0217-malloc-Check-for-large-bin-list-corruption-when-inse.patch
227 Patch218: 0218-Fix-crash-in-_IO_wfile_sync-bug-20568.patch
228
229 ###
230 ### upstream master branch
231 ### starts from number 300
232 ###
233 Patch300: 0300-nss_files-Fix-etc-aliases-null-pointer-dereference-B.patch
234 Patch301: 0301-nptl-Reinstate-pthread_timedjoin_np-as-a-cancellatio.patch
235 Patch302: 0302-resolv-Enable-full-ICMP-errors-for-UDP-DNS-sockets-B.patch
236 Patch304: 0304-iconv-localedef-avoid-floating-point-rounding-differ.patch
237 Patch305: 0305-Fix-parentheses-error-in-iconvconfig.c-and-ld-collat.patch
238 Patch306: 0306-aarch64-thunderx2-memcpy-implementation-cleanup-and-.patch
239 Patch307: 0307-aarch64-thunderx2-memmove-performance-improvements.patch
240
241 ###
242 ### Mageia patches
243 ###
244
245 # make "localedef --add-to-archive" to follow symlink
246 # safe to send ustream, need to be kept for locales
247 Patch00: glibc-2.17-localedef-archive-follow-symlinks.patch
248
249 # various path fix, according to usrmove
250 Patch01: glibc-2.17-fhs-usrmove.patch
251 # try to fallback on loading /lib/libnss_*.so.X.Y when the loading
252 # of /lib/libnss_*.so.X failed. Should be dropped, IMHO.
253 Patch04: glibc-2.17-nss-upgrade.patch
254
255 Patch06: glibc-2.26-share-locale.patch
256 # use xvt instead of xterm in xtrace.sh
257 # cannot be pushed upstream as xvt is Ma* specific
258 Patch09: glibc-2.2.4-xterm-xvt.patch
259
260 # add transliteration for "COLON SIGN"
261 # ( used for the money of money of san salvador )
262 Patch11: glibc-2.19-compat-EUR-currencies.patch
263
264 # fix the chkconfig header, should be sent upstream
265 Patch13: glibc-2.3.3-nscd-enable.patch
266
267 # disable cache for hosts on nscd, as this is seen as insecure
268 # if the system relie on reverse dns for security
269 Patch14: glibc-2.9-nscd-no-host-cache.patch
270
271 # add some new timezone for various cities
272 # Halifax, Montreal, Johannesburg
273 # should be sent upstream ( I guess )
274 Patch23: glibc-2.3.4-timezone.patch
275 Patch24: glibc-2.10.1-biarch-cpp-defines.patch
276
277 # fix a typo, safe to send upstream
278 Patch27: glibc-2.20-ENOTTY-fr-translation.patch
279 Patch29: glibc-2.3.5-biarch-utils.patch
280
281 # remove multiarch header, Ma* specific patch
282 # check if still needed or if the work was finished
283 Patch30: glibc-2.26-multiarch.patch
284
285 # translation fixes, need to be checked with some i18n team member
286 # should be safe to send upstream once checked
287 Patch35: glibc-2.16.0-force-gb18030-for-zh_CN.patch
288
289 # disable parallel testsuite of rt on powerpc with SMT
290 Patch38: glibc-2.18-testsuite-rt-notparallel.patch
291
292 # Add C.UTF-8 locale into /usr/lib/locale/
293 Patch59: glibc-c-utf8-locale.patch
294
295 # check for libcap, even if selinux is disabled
296 # should be sent upstream
297 Patch44: glibc-2.26-dont-tie-libcap-with-selinux.patch
298
299
300 # Determine minium kernel versions
301 %define enablekernel 3.2
302 Conflicts: kernel < %{enablekernel}
303
304 # People changed location of rpm scripts...
305 %define rpmscripts /usr/lib/rpm/%{_real_vendor}
306
307 # Don't try to explicitly provide GLIBC_PRIVATE versioned libraries
308 %define __find_provides %{_builddir}/%{source_dir}/find_provides.sh
309 %define __find_requires %{_builddir}/%{source_dir}/find_requires.sh
310
311 %if !%{build_cross}
312 Obsoletes: ld.so
313 Provides: ld.so
314 %endif
315
316 Obsoletes: ldconfig
317 Provides: ldconfig = %{glibcepoch}:%{glibcversion}-%{glibcrelease} /sbin/ldconfig
318 # obsolete nss_db as it got merged again in 2.15
319 Obsoletes: nss_db <= 2.2.3-0.pre1.9
320
321 %description
322 The glibc package contains standard libraries which are used by
323 multiple programs on the system. In order to save disk space and
324 memory, as well as to make upgrading easier, common system code is
325 kept in one place and shared between programs. This particular package
326 contains the most important sets of shared libraries: the standard C
327 library and the standard math library. Without these two libraries, a
328 Linux system will not function. The glibc package also contains
329 national language (locale) support.
330
331 This package now also provides ldconfig which was package seperately in
332 the past. Ldconfig is a basic system program which determines run-time
333 link bindings between ld.so and shared libraries. Ldconfig scans a running
334 system and sets up the symbolic links that are used to load shared
335 libraries properly. It also creates a cache (/etc/ld.so.cache) which
336 speeds the loading of programs which use shared libraries.
337
338 %package devel
339 Summary: Header and object files for development using standard C libraries
340 Group: Development/C
341 Requires(post): coreutils
342 Requires(postun): coreutils, awk
343 # ensure libxcrypt is installed as glibc crypt is disabled / being obsoleted
344 Requires: %{_lib}xcrypt-devel >= 4.1.1-1
345 Obsoletes: libc-debug, libc-headers, libc-devel, linuxthreads-devel, nptl-devel
346 # (tmb) filter out requires on self-provides
347 %global __requires_exclude devel\\(libm.*\\)
348 # (tmb) add virtual provides for old libm to ease builds... from glibc-2.22 libmvec is preferred
349 %ifarch x86_64
350 Provides: devel(libm(64bit))
351 %endif
352 %if !%{build_debug}
353 Obsoletes: %{name}-debug < 6:2.3.2-15
354 %endif
355 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
356 %if !%{build_cross}
357 Requires: linux-userspace-headers
358 %endif
359 %if %{build_cross}
360 Autoreq: false
361 Autoprov: false
362 %else
363 Autoreq: true
364 %endif
365
366 %description devel
367 The glibc-devel package contains the header and object files necessary
368 for developing programs which use the standard C libraries (which are
369 used by nearly all programs). If you are developing programs which
370 will use the standard C libraries, your system needs to have these
371 standard header and object files available in order to create the
372 executables.
373
374 This package also includes the C header files for the Linux kernel.
375 The header files define structures and constants that are needed for
376 building most standard programs. The header files are also needed for
377 rebuilding the kernel.
378
379 Install glibc-devel if you are going to develop programs which will
380 use the standard C libraries.
381
382 %package static-devel
383 Summary: Static libraries for GNU C library
384 Group: Development/C
385 Requires: %{name}-devel = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
386 # ensure libxcrypt is installed as glibc crypt is disabled / being obsoleted
387 Requires: %{_lib}xcrypt-static-devel >= 4.1.1-1
388
389 %description static-devel
390 The glibc-static-devel package contains the static libraries necessary
391 for developing programs which use the standard C libraries. Install
392 glibc-static-devel if you need to statically link your program or
393 library.
394
395 %package profile
396 Summary: The GNU libc libraries, including support for gprof profiling
397 Group: Development/C
398 Obsoletes: libc-profile
399 Provides: libc-profile = %{glibcversion}-%{glibcrelease}
400 Autoreq: true
401
402 %description profile
403 The glibc-profile package includes the GNU libc libraries and support
404 for profiling using the gprof program. Profiling is analyzing a
405 program's functions to see how much CPU time they use and determining
406 which functions are calling other functions during execution. To use
407 gprof to profile a program, your program needs to use the GNU libc
408 libraries included in glibc-profile (instead of the standard GNU libc
409 libraries included in the glibc package).
410
411 If you are going to use the gprof program to profile a program, you'll
412 need to install the glibc-profile program.
413
414 %package -n nscd
415 Summary: A Name Service Caching Daemon (nscd)
416 Group: System/Servers
417 Requires(post): systemd >= %{systemd_required_version}
418 Requires(post): rpm-helper >= 0.24.8-1
419 Requires(preun): rpm-helper >= 0.24.8-1
420 Autoreq: true
421
422 %description -n nscd
423 Nscd caches name service lookups and can dramatically improve
424 performance with NIS+, and may help with DNS as well. Note that you
425 can't use nscd with 2.0 kernels because of bugs in the kernel-side
426 thread support. Unfortunately, nscd happens to hit these bugs
427 particularly hard.
428
429 Install nscd if you need a name service lookup caching daemon, and
430 you're not using a version 2.0 kernel.
431
432 %if %{build_debug}
433 %package debug
434 Summary: Shared standard C libraries with debugging information
435 Group: System/Libraries
436 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
437 Autoreq: false
438
439 %description debug
440 The glibc-debug package contains shared standard C libraries with
441 debugging information. You need this only if you want to step into C
442 library routines during debugging.
443
444 To use these libraries, you need to add %{_libdir}/debug to your
445 LD_LIBRARY_PATH variable prior to starting the debugger.
446 %endif
447
448 %package utils
449 Summary: Development utilities from GNU C library
450 Group: Development/Other
451 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
452
453 %description utils
454 The glibc-utils package contains memusage, a memory usage profiler,
455 mtrace, a memory leak tracer and xtrace, a function call tracer which
456 can be helpful during program debugging.
457
458 If unsure if you need this, don't install this package.
459
460 %if %{build_i18ndata}
461 %package i18ndata
462 Summary: Database sources for 'locale'
463 Group: System/Libraries
464
465 %description i18ndata
466 This package contains the data needed to build the locale data files
467 to use the internationalization features of the GNU libc.
468 %endif
469
470 %if %{build_timezone}
471 %package -n timezone
472 Summary: Time zone descriptions
473 Group: System/Base
474
475 %description -n timezone
476 These are configuration files that describe possible
477 time zones.
478 %endif
479
480 %package doc
481 Summary: GNU C library documentation
482 Group: Development/Other
483 BuildArch: noarch
484
485 %description doc
486 The glibc-doc package contains documentation for the GNU C library in
487 info format.
488
489 %if %{build_pdf_doc}
490 %package doc-pdf
491 Summary: GNU C library documentation
492 Group: Development/Other
493 BuildArch: noarch
494
495 %description doc-pdf
496 The glibc-doc-pdf package contains the printable documentation for the
497 GNU C library in PDF format.
498 %endif
499
500 %prep
501 %setup -q -n %{source_dir}
502 %autopatch -p1
503
504 %if %{build_selinux}
505 # XXX kludge to build nscd with selinux support as it added -nostdinc
506 # so /usr/include/selinux is not found
507 ln -s %{_includedir}/selinux selinux
508 %endif
509
510 find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;
511
512 # \\(Anssi 03/2008\\) FIXME: use __provides_exclude
513 cat > find_provides.sh << EOF
514 #!/bin/sh
515 %{rpmscripts}/find-provides | grep -v GLIBC_PRIVATE
516 exit 0
517 EOF
518 chmod +x find_provides.sh
519
520 cat > find_requires.bootstrap.sh << EOF
521 /bin/sh %{SOURCE4} %{buildroot} %{_target_cpu} | grep -v "\(GLIBC_PRIVATE\|linux-gate\|linux-vdso\)"
522 exit 0
523 EOF
524 chmod +x find_requires.bootstrap.sh
525
526 # XXX: use better way later to avoid LD_LIBRARY_PATH issue
527 cat %{rpmscripts}/find-requires | sed '/.*LD_LIBRARY_PATH.*/d;' > find_requires
528 chmod +x find_requires
529 # \\(Anssi 03/2008\\) FIXME: use __requires_exclude
530 cat > find_requires.noprivate.sh << EOF
531 %{_builddir}/%{source_dir}/find_requires %{buildroot} %{_target_cpu} | \
532 grep -v GLIBC_PRIVATE
533 exit 0
534 EOF
535 chmod +x find_requires.noprivate.sh
536
537 # FIXME: fix system rpm find-requires to use the prefix cross version
538 %if %{build_bootstrap} || "%{_target_cpu}" != "%{target_cpu}"
539 ln -s find_requires.bootstrap.sh find_requires.sh
540 %else
541 ln -s find_requires.noprivate.sh find_requires.sh
542 %endif
543
544 # Remove patch backups from files we ship in glibc packages
545 rm -fr ChangeLog.old
546 rm -f localedata/locales/{???_??,??_??}.*
547 rm -f localedata/locales/[a-z_]*.*
548
549 %build
550 # Prepare test matrix in the next function
551 CheckList=$PWD/Check.list
552 rm -f $CheckList
553 touch $CheckList
554
555 #
556 # CompareKver <kernel version>
557 # function to compare the desired kernel version with running kernel
558 # version (package releases not taken into account in comparison). The
559 # function returns:
560 # -1 = <kernel version> is lesser than current running kernel
561 # 0 = <kernel version> is equal to the current running kernel
562 # 1 = <kernel version> is greater than current running kernel
563 #
564 function CompareKver() {
565 v1=`echo $1 | sed 's/\.\?$/./'`
566 v2=`uname -r | sed 's/[^.0-9].*//' | sed 's/\.\?$/./'`
567 n=1
568 s=0
569 while true; do
570 c1=`echo "$v1" | cut -d "." -f $n`
571 c2=`echo "$v2" | cut -d "." -f $n`
572 if [ -z "$c1" -a -z "$c2" ]; then
573 break
574 elif [ -z "$c1" ]; then
575 s=-1
576 break
577 elif [ -z "$c2" ]; then
578 s=1
579 break
580 elif [ "$c1" -gt "$c2" ]; then
581 s=1
582 break
583 elif [ "$c2" -gt "$c1" ]; then
584 s=-1
585 break
586 fi
587 n=$((n + 1))
588 done
589 echo $s
590 }
591
592 #
593 # BuildGlibc <arch> [<extra_configure_options>+]
594 #
595 function BuildGlibc() {
596 arch="$1"
597 shift 1
598
599 # PowerPC CPU add-on
600 case $arch in
601 cpu-addon,*)
602 cpu=` echo "$arch" | sed -n "/.*,\([^,]*\),.*$/s//\1/p"`
603 arch=`echo "$arch" | sed -n "/.*,.*,\([^,]*\)$/s//\1/p"`
604 ;;
605 *)
606 cpu=$arch
607 ;;
608 esac
609
610 # Select optimization flags and compiler to use
611 BuildAltArch="no"
612 BuildCompFlags=""
613 BuildFlags=""
614 case $arch in
615 i[3456]86 | athlon)
616 BuildFlags="-march=$arch -mtune=generic"
617 if [[ "`uname -m`" = "x86_64" ]]; then
618 BuildAltArch="yes"
619 BuildCompFlags="-m32"
620 fi
621 ;;
622 x86_64)
623 BuildFlags="-mtune=generic"
624 ;;
625 mips|mipsel)
626 BuildFlags="-march=mips3"
627 BuildCompFlags="-march=mips3"
628 ;;
629 mips32|mips32el)
630 BuildFlags="-march=mips3 -mabi=n32"
631 BuildCompFlags="-march=mips3 -mabi=n32"
632 ;;
633 mips64|mips64el)
634 BuildFlags="-march=mips3 -mabi=64"
635 BuildCompFlags="-march=mips3 -mabi=64"
636 ;;
637 armv4t*)
638 BuildFlags="-march=armv4t"
639 BuildCompFlags="-march=armv4t"
640 ;;
641 armv5t*)
642 BuildFlags="-march=armv5t"
643 BuildCompFlags="-march=armv5t"
644 ;;
645 # to check
646 armv7h*)
647 BuildFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
648 BuildCompFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
649 ;;
650 esac
651
652 # Choose multiarch support
653 MultiArchFlags=
654 case $arch in
655 i686 | x86_64)
656 MultiArchFlags="--enable-multi-arch"
657 ;;
658 esac
659
660 # Determine C & C++ compilers
661 BuildCC="%{__cc} $BuildCompFlags"
662 BuildCXX="%{__cxx} $BuildCompFlags"
663
664 # Are we supposed to cross-compile?
665 if [[ "%{target_cpu}" != "%{_target_cpu}" ]]; then
666 # Can't use BuildCC anymore with previous changes.
667 BuildCC="%{cross_program_prefix}gcc $BuildCompFlags"
668 BuildCXX="%{cross_program_prefix}g++ $BuildCompFlags"
669 BuildCross="--build=%{_target_platform}"
670 export libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
671 fi
672
673 BuildFlags="$BuildFlags -DNDEBUG=1 -O2 -finline-functions -g"
674
675 # Do not use direct references against %gs when accessing tls data
676 # XXX make it the default in GCC? (for other non glibc specific usage)
677 case $arch in
678 i[3456]86 | x86_64)
679 BuildFlags="$BuildFlags -mno-tls-direct-seg-refs"
680 ;;
681 esac
682
683 # Arch specific compilation flags
684 if [[ "$arch" = "ppc64" ]]; then
685 BuildFlags="$BuildFlags -fno-inline-functions -mno-minimal-toc"
686 fi
687
688 # Extra configure flags
689 ExtraFlags=
690 if [[ "%{build_profile}" != "0" ]]; then
691 ExtraFlags="$ExtraFlags --enable-profile"
692 fi
693
694 # NPTL+TLS are now the default
695 # check for other arches
696 %if %isarch %ports_arch
697 Pthreads="ports nptl"
698 %else
699 Pthreads="nptl"
700 %endif
701
702 # Add-ons
703 AddOns="libidn"
704 if [[ "$cpu" != "$arch" ]]; then
705 AddOns="$AddOns,powerpc-cpu"
706 BuildFlags="$BuildFlags -mcpu=$cpu"
707 ExtraFlags="$ExtraFlags --with-cpu=$cpu"
708 fi
709
710 # Build with selinux support?
711 %if %{build_selinux}
712 SElinuxFlags="--with-selinux"
713 %else
714 SElinuxFlags="--without-selinux"
715 %endif
716
717 # Kernel headers directory
718 KernelHeaders=%{_includedir}
719
720 # Determine library name
721 glibc_cv_cc_64bit_output=no
722 if echo ".text" | $BuildCC -c -o test.o -xassembler -; then
723 case `/usr/bin/file test.o` in
724 *"ELF 64"*)
725 glibc_cv_cc_64bit_output=yes
726 ;;
727 esac
728 fi
729 rm -f test.o
730
731 # Force a separate and clean object dir
732 rm -rf build-$cpu-linux
733 mkdir build-$cpu-linux
734 pushd build-$cpu-linux
735 [[ "$BuildAltArch" = "yes" ]] && touch ".alt" || touch ".main"
736 CC="$BuildCC" CXX="$BuildCXX" CFLAGS="$BuildFlags -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -Wno-maybe-uninitialized" ../configure \
737 $arch-%{_real_vendor}-linux%{gnuext} $BuildCross \
738 --prefix=%{_prefix} \
739 --libexecdir=%{_prefix}/libexec \
740 --infodir=%{_infodir} \
741 --enable-add-ons="$AddOns" --without-cvs \
742 $ExtraFlags $MultiArchFlags $SElinuxFlags \
743 --enable-kernel=%{enablekernel} \
744 --with-headers=$KernelHeaders ${1+"$@"} \
745 --enable-obsolete-rpc \
746 --enable-obsolete-nsl \
747 --disable-crypt
748 %make_build -r -s
749 popd
750
751 # All tests are expected to pass on certain platforms, depending also
752 # on the version of the kernel running
753 case $arch in
754 athlon | ia64 | ppc | ppc64)
755 if [ "`CompareKver %{check_min_kver}`" -lt 0 ]; then
756 check_flags=""
757 else
758 check_flags="-k"
759 fi
760 ;;
761 *)
762 check_flags="-k"
763 ;;
764 esac
765
766 # Generate test matrix
767 [[ -d "build-$arch-linux" ]] || {
768 echo "ERROR: PrepareGlibcTest: build-$arch-linux does not exist!"
769 return 1
770 }
771 local BuildJobs="-j`getconf _NPROCESSORS_ONLN`"
772 echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
773
774 case $cpu in
775 i686|athlon) base_arch=i586;;
776 power*) base_arch=$arch;;
777 *) base_arch=none;;
778 esac
779
780 [[ -d "build-$base_arch-linux" ]] && {
781 check_flags="$check_flags -l build-$base_arch-linux/elf/ld.so"
782 echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
783 }
784 return 0
785 }
786
787 # Build main glibc
788 BuildGlibc %{target_cpu}
789
790 %if %{build_biarch}
791 %if %isarch x86_64
792 BuildGlibc i686
793 %endif
794 %endif
795 %if %isarch mips
796 BuildGlibc mips64
797 BuildGlibc mips32
798 %endif
799 %if %isarch mipsel
800 BuildGlibc mips64el
801 BuildGlibc mips32el
802 %endif
803 %if %isarch mips64
804 BuildGlibc mips
805 BuildGlibc mips32
806 %endif
807 %if %isarch mips64el
808 BuildGlibc mipsel
809 BuildGlibc mips32el
810 %endif
811
812 # Build i686 libraries if not already building for i686/athlon
813 case %{target_cpu} in
814 i686 | athlon)
815 ;;
816 i[3-6]86)
817 # BuildGlibc i686 --disable-profile
818 ;;
819 esac
820
821 %if %{build_check}
822 export TMPDIR=/tmp
823 export TIMEOUTFACTOR=16
824 Check="$PWD/glibc-check.sh"
825 cat %{SOURCE5} > $Check
826 chmod +x $Check
827 while read arglist; do
828 $Check $arglist || exit 1
829 done < $CheckList
830 %endif
831
832 %install
833 # force use of _NPROCESSORS_ONLN jobs since RPM_BUILD_NCPUS could be
834 # greater for icecream
835 BuildJobs="-j`getconf _NPROCESSORS_ONLN`"
836
837 make install_root=$RPM_BUILD_ROOT install -C build-%{target_cpu}-linux
838 %if %{build_i18ndata}
839 (cd build-%{target_cpu}-linux;
840 make $BuildJobs -C ../localedata objdir=`pwd` \
841 install_root=$RPM_BUILD_ROOT \
842 install-locales
843 )
844 install -m 0644 localedata/SUPPORTED $RPM_BUILD_ROOT/%{_datadir}/i18n/
845 %endif
846
847 # Empty filelist for non i686/athlon targets
848 > extralibs.filelist
849
850 # Install biarch libraries
851 %if %{build_biarch} || %isarch mips mipsel
852 %if %isarch x86_64
853 ALT_ARCHES=i686-linux
854 %endif
855 %if %isarch mips
856 ALT_ARCHES="mips64-linux mips32-linux"
857 %endif
858 %if %isarch mipsel
859 ALT_ARCHES="mips64el-linux mips32el-linux"
860 %endif
861 %if %isarch mips64
862 ALT_ARCHES="mips-linux mips32-linux"
863 %endif
864 %if %isarch mips64el
865 ALT_ARCHES="mipsel-linux mips32el-linux"
866 %endif
867
868 for ALT_ARCH in $ALT_ARCHES; do
869 mkdir -p $RPM_BUILD_ROOT/$ALT_ARCH
870 make install_root=$RPM_BUILD_ROOT/$ALT_ARCH install -C build-$ALT_ARCH
871
872 # Dispatch */lib only
873 case "$ALT_ARCH" in
874 mips32*)
875 LIB="%{_slibdir}32"
876 ;;
877 mips64*)
878 LIB="%{_slibdir}64"
879 ;;
880 *)
881 LIB=/lib
882 ;;
883 esac
884 %if !%{build_cross}
885 mv $RPM_BUILD_ROOT/$ALT_ARCH/$LIB $RPM_BUILD_ROOT/$LIB
886 mv $RPM_BUILD_ROOT/$ALT_ARCH%{_prefix}/libexec/getconf/* \
887 $RPM_BUILD_ROOT%{_prefix}/libexec/getconf/
888 [ ! -d $RPM_BUILD_ROOT/%{_prefix}/$LIB/ ] && mkdir -p $RPM_BUILD_ROOT/%{_prefix}/$LIB/
889 mv $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/$LIB/* $RPM_BUILD_ROOT/%{_prefix}/$LIB/
890 %else
891 mv $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/lib $RPM_BUILD_ROOT/$LIB
892 sed -i $RPM_BUILD_ROOT/$LIB/libc.so -e "s!%{_slibdir}!$LIB!g"
893 %endif
894
895 rm -rf $RPM_BUILD_ROOT/$ALT_ARCH
896 # XXX Dispatch 32-bit stubs
897 (sed '/^@/d' include/stubs-prologue.h; LC_ALL=C sort $(find build-$ALT_ARCH -name stubs)) \
898 > $RPM_BUILD_ROOT%{_includedir}/gnu/stubs-32.h
899 done
900 %endif
901
902 # Install extra glibc libraries
903 function InstallGlibc() {
904 local BuildDir="$1"
905 local SubDir="$2"
906 local LibDir="$3"
907
908 case $BuildDir in
909 *) Pthreads=nptl ;;
910 esac
911
912 [[ -z "$LibDir" ]] && LibDir="%{_slibdir}"
913
914 pushd $BuildDir
915 mkdir -p $RPM_BUILD_ROOT$LibDir/$SubDir/
916 install -m755 libc.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc-*.so`
917 ln -sf `basename $RPM_BUILD_ROOT$LibDir/libc-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc.so.*`
918 install -m755 math/libm.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm-*.so`
919 ln -sf `basename $RPM_BUILD_ROOT$LibDir/libm-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm.so.*`
920 install -m755 $Pthreads/libpthread.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so`
921 ln -sf `basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread.so.*`
922 install -m755 ${Pthreads}_db/libthread_db.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so`
923 ln -sf `basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db.so.*`
924 install -m755 rt/librt.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt-*.so`
925 ln -sf `basename $RPM_BUILD_ROOT$LibDir/librt-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt.so.*`
926 echo "%dir $LibDir/$SubDir" >> ../extralibs.filelist
927 find $RPM_BUILD_ROOT$LibDir/$SubDir -maxdepth 1 -type f -o -type l | sed -e "s|$RPM_BUILD_ROOT||" >> ../extralibs.filelist
928 popd
929 }
930
931 # Install arch-specific optimized libraries
932 %if %isarch %{ix86}
933 case %{target_cpu} in
934 i[3-5]86)
935 # InstallGlibc build-i686-linux i686
936 ;;
937 esac
938 %endif
939
940 # Remove the files we don't want to distribute
941 rm -f $RPM_BUILD_ROOT%{_libdir}/libNoVersion*
942 rm -f $RPM_BUILD_ROOT%{_slibdir}/libNoVersion*
943
944 %if "%{name}" == "glibc"
945 install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/nsswitch.conf
946 %endif
947
948 # This is for ncsd - in glibc 2.2
949 %if %{build_nscd}
950 install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT%{_sysconfdir}
951 install -d -m 755 %{buildroot}%{_unitdir}
952 install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/nscd.service
953 install -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/nscd.socket
954 install -D -m 644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}/nscd.conf
955 install -d -m 755 %{buildroot}%{_var}/db/nscd
956 %endif
957
958 # Useless and takes place
959 rm -rf %buildroot/%{_datadir}/zoneinfo/{posix,right}
960
961 # Include ld.so.conf
962 %if "%{name}" == "glibc"
963 %if %isarch mips mipsel
964 # needed to get a ldd which understands o32, n32, 64
965 install -m 755 $RPM_BUILD_DIR/%{source_dir}/build-mips64el-linux/elf/ldd $RPM_BUILD_ROOT/%{_bindir}/ldd
966 %endif
967 echo "include /etc/ld.so.conf.d/*.conf" > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf
968 chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf
969 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d
970
971 # ldconfig cache
972 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/ldconfig
973 touch $RPM_BUILD_ROOT%{_var}/cache/ldconfig/aux-cache
974 %endif
975
976 # Include %{_libdir}/gconv/gconv-modules.cache
977 > $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
978 chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
979
980 %if "%{name}" == "glibc"
981 touch $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.cache
982 %endif
983
984 # Add libraries to debug sub-package
985 %if %{build_debug}
986 mkdir $RPM_BUILD_ROOT%{_libdir}/debug
987 #cp -a $RPM_BUILD_ROOT%{_libdir}/*.a $RPM_BUILD_ROOT%{_libdir}/debug/
988 #rm -f $RPM_BUILD_ROOT%{_libdir}/debug/*_p.a
989 cp -a $RPM_BUILD_ROOT%{_slibdir}/lib*.so* $RPM_BUILD_ROOT%{_libdir}/debug/
990
991 pushd $RPM_BUILD_ROOT%{_libdir}/debug
992 for lib in *.so*; do
993 [[ -f "$lib" ]] && DEBUG_LIBS="$DEBUG_LIBS %{_libdir}/debug/$lib"
994 done
995 popd
996 %endif
997
998 # Are we cross-compiling?
999 Strip="strip"
1000 if [[ "%{_target_cpu}" != "%{target_cpu}" ]]; then
1001 Strip="%{cross_program_prefix}$Strip"
1002 fi
1003
1004 # Strip debugging info from all static libraries
1005 pushd $RPM_BUILD_ROOT%{_slibdir}
1006 for i in *.a; do
1007 if [ -f "$i" ]; then
1008 case "$i" in
1009 *_p.a) ;;
1010 *) $Strip -g -R .comment $i ;;
1011 esac
1012 fi
1013 done
1014 popd
1015
1016 # post install wrapper
1017 %__cc -Os -g %{SOURCE14} -static \
1018 -o "$RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper" \
1019 -L "$RPM_BUILD_ROOT%{_libdir}/" \
1020 '-DSLIBDIR="%{_slibdir}"' \
1021 '-DGCONV_DIR="%{_libdir}/gconv"'
1022 chmod 700 $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper
1023
1024 # rquota.x and rquota.h are now provided by quota
1025 rm -f $RPM_BUILD_ROOT%{_includedir}/rpcsvc/rquota.[hx]
1026
1027 # Hardlink identical locale files together
1028 %if %{build_i18ndata}
1029 %{_sbindir}/hardlink -vc $RPM_BUILD_ROOT%{_datadir}/locale
1030 %endif
1031
1032 rm -rf $RPM_BUILD_ROOT%{_includedir}/netatalk/
1033
1034 # Build file list for devel package
1035 find $RPM_BUILD_ROOT%{_includedir} -type f -or -type l > devel.filelist
1036 find $RPM_BUILD_ROOT%{_includedir} -type d | sed "s/^/%dir /" | \
1037 grep -v "%{_libdir}/libnss1.*.so$" | \
1038 grep -v "%{_includedir}$" | >> devel.filelist
1039 find $RPM_BUILD_ROOT%{_libdir} -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1040 # biarch libs
1041 %if %{build_biarch}
1042 find $RPM_BUILD_ROOT%{_prefix}/lib -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1043 %endif
1044 %if %isarch mips mipsel
1045 find $RPM_BUILD_ROOT%{_libdir}32 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1046 find $RPM_BUILD_ROOT%{_libdir}64 -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
1047 %endif
1048 perl -pi -e "s|$RPM_BUILD_ROOT||" devel.filelist
1049
1050 # /etc/localtime - we're proud of our timezone #Well we may put Paris
1051 %if %{build_timezone}
1052 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1053 cp -f $RPM_BUILD_ROOT%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1054 #ln -sf ..%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1055 %endif
1056
1057 # [gg] build PDF documentation
1058 %if %{build_pdf_doc}
1059 (cd manual; texi2dvi -p -t @afourpaper -t @finalout libc.texinfo)
1060 %endif
1061
1062 # the last bit: more documentation
1063 rm -rf documentation
1064 mkdir documentation
1065 cp timezone/README documentation/README.timezone
1066 cp ChangeLog documentation
1067 gzip -9 documentation/ChangeLog*
1068
1069 # Leave a compatibility symlink for the dynamic loader on armhfp targets,
1070 # at least until the world gets rebuilt
1071 %ifarch armv7hl
1072 ln -sf %{_slibdir}/ld-linux-armhf.so.3 $RPM_BUILD_ROOT%{_slibdir}/ld-linux.so.3
1073 %endif
1074
1075 # Generate final rpm filelist, with localized libc.mo files
1076 rm -f rpm.filelist
1077 %if "%{name}" == "glibc"
1078 %find_lang libc
1079 perl -ne '/^\s*$/ or print' libc.lang > rpm.filelist
1080 %endif
1081 cat extralibs.filelist >> rpm.filelist
1082
1083 # Remove unpackaged files
1084 rm -f $RPM_BUILD_ROOT%{_infodir}/dir.old*
1085 rm -rf $RPM_BUILD_ROOT%{_includedir}/asm-*/mach-*/
1086 rm -f $RPM_BUILD_ROOT%{_datadir}/locale/locale-archive*
1087 rm -f $RPM_BUILD_ROOT%{_var}/db/Makefile
1088
1089 %if !%{build_utils}
1090 %if %{build_biarch}
1091 rm -f $RPM_BUILD_ROOT%{_slibdir32}/libmemusage.so
1092 rm -f $RPM_BUILD_ROOT%{_slibdir32}/libpcprofile.so
1093 %endif
1094 %if %isarch mips mipsel
1095 rm -f $RPM_BUILD_ROOT%{_slibdir}32/libmemusage.so
1096 rm -f $RPM_BUILD_ROOT%{_slibdir}32/libpcprofile.so
1097 rm -f $RPM_BUILD_ROOT%{_slibdir}64/libmemusage.so
1098 rm -f $RPM_BUILD_ROOT%{_slibdir}64/libpcprofile.so
1099 %endif
1100 rm -f $RPM_BUILD_ROOT%{_slibdir}/libmemusage.so
1101 rm -f $RPM_BUILD_ROOT%{_slibdir}/libpcprofile.so
1102 rm -f $RPM_BUILD_ROOT%{_bindir}/memusage
1103 rm -f $RPM_BUILD_ROOT%{_bindir}/memusagestat
1104 rm -f $RPM_BUILD_ROOT%{_bindir}/mtrace
1105 rm -f $RPM_BUILD_ROOT%{_bindir}/pcprofiledump
1106 rm -f $RPM_BUILD_ROOT%{_bindir}/xtrace
1107 %endif
1108
1109 %if !%{build_timezone}
1110 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime
1111 rm -f $RPM_BUILD_ROOT%{_sbindir}/zdump
1112 rm -f $RPM_BUILD_ROOT%{_sbindir}/zic
1113 rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo
1114 %endif
1115
1116 %if !%{build_i18ndata}
1117 rm -rf $RPM_BUILD_ROOT%{_datadir}/i18n
1118 %endif
1119
1120 %if "%{name}" != "glibc"
1121 rm -rf $RPM_BUILD_ROOT/boot
1122 rm -rf $RPM_BUILD_ROOT/sbin
1123 rm -rf $RPM_BUILD_ROOT/usr/share
1124 rm -rf $RPM_BUILD_ROOT%{_bindir}
1125 rm -rf $RPM_BUILD_ROOT%{_sbindir}
1126 rm -rf $RPM_BUILD_ROOT%{_datadir}
1127 rm -rf $RPM_BUILD_ROOT%{_infodir}
1128 rm -rf $RPM_BUILD_ROOT%{_prefix}/etc
1129 rm -rf $RPM_BUILD_ROOT%{_libdir}/gconv
1130 %endif
1131
1132 # In case we are cross-compiling, don't bother to remake symlinks and
1133 # fool spec-helper when stripping files
1134 %if "%{name}" != "glibc"
1135 export DONT_SYMLINK_LIBS=1
1136 export PATH=%{_bindir}:$PATH
1137 %endif
1138
1139 %if %build_debug
1140 export EXCLUDE_FROM_STRIP="$DEBUG_LIBS"
1141 %endif
1142
1143 # This will make the '-g' argument to be passed to eu-strip for these
1144 # libraries, so that only debug symbols are stripped and gdb/valgrind continue
1145 # to work without needing glibc-debug package to be installed.
1146 export EXCLUDE_FROM_FULL_STRIP="ld-%{glibcversion}.so libpthread libc-%{glibcversion}.so"
1147
1148 %if "%{name}" == "glibc"
1149
1150 %post -p %{_sbindir}/glibc-post-wrapper
1151
1152 # automatic ldconfig cache update on rpm installs/removals
1153 # (see http://www.rpm.org/wiki/FileTriggers)
1154 # FIXME: port to lua to remove circular dependency with grep
1155 %transfiletriggerin -p %{ash_bin} -P 2000000 -- /lib/ /lib64/
1156 grep -F '.so.' | ldconfig -X
1157
1158 %transfiletriggerin -p %{ash_bin} -P 2000000 -- /etc/ld.so.conf.d/
1159 ldconfig -X
1160
1161 %endif
1162
1163 %pre devel
1164 if [ -L %{_includedir}/scsi ]; then
1165 rm -f %{_includedir}/scsi
1166 fi
1167 if [ -L %{_includedir}/sound ]; then
1168 rm -f %{_includedir}/sound
1169 fi
1170 if [ -L %{_includedir}/linux ]; then
1171 rm -f %{_includedir}/linux
1172 fi
1173 if [ -L %{_includedir}/asm ]; then
1174 rm -f %{_includedir}/asm
1175 fi
1176 if [ -L %{_includedir}/asm-generic ]; then
1177 rm -f %{_includedir}/asm-generic
1178 fi
1179 %if %isarch x86_64
1180 if [ -L %{_includedir}/asm-x86_64 ]; then
1181 rm -f %{_includedir}/asm-x86_64
1182 fi
1183 if [ -L %{_includedir}/asm-i386 ]; then
1184 rm -f %{_includedir}/asm-i386
1185 fi
1186 %endif
1187 %if %isarch %mips
1188 if [ -L %{_includedir}/asm-mips ]; then
1189 rm -f %{_includedir}/asm-mips
1190 fi
1191 %endif
1192 %if %isarch %arm
1193 if [ -L %{_includedir}/asm-arm ]; then
1194 rm -f %{_includedir}/asm-arm
1195 fi
1196 %endif
1197 exit 0
1198
1199 %if %{build_nscd}
1200 %pre -n nscd
1201 %_pre_useradd nscd / /bin/false
1202
1203 %post -n nscd
1204 %_tmpfilescreate nscd
1205 %_post_service nscd
1206
1207 %preun -n nscd
1208 %_preun_service nscd
1209
1210 %postun -n nscd
1211 %_postun_userdel nscd
1212
1213 if [ "$1" -ge "1" ]; then
1214 /sbin/service nscd condrestart > /dev/null 2>&1 || :
1215 fi
1216 %endif
1217
1218 %clean
1219 #rm -rf "$RPM_BUILD_ROOT"
1220 #rm -f *.filelist*
1221
1222 #
1223 # glibc
1224 #
1225 %files -f rpm.filelist
1226 %if "%{name}" == "glibc"
1227 %if %{build_timezone}
1228 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/localtime
1229 %endif
1230 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/nsswitch.conf
1231 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ld.so.conf
1232 %dir %{_sysconfdir}/ld.so.conf.d
1233 %config(noreplace) %{_sysconfdir}/rpc
1234 %doc nis/nss
1235 %doc posix/gai.conf
1236 %{_datadir}/locale/locale.alias
1237 /sbin/sln
1238 %dir %{_prefix}/libexec/getconf
1239 %{_prefix}/libexec/getconf/*
1240 %endif
1241 %{_slibdir}/ld-%{glibcversion}.so
1242 %if %isarch i386
1243 %{_slibdir}/ld-linux.so.2
1244 %endif
1245 %if %isarch %arm
1246 %if %isarch armv7hl
1247 %{_slibdir}/ld-linux-armhf.so.3
1248 %endif
1249 %{_slibdir}/ld-linux.so.3
1250 %endif
1251 %if %isarch x86_64
1252 %{_slibdir}/ld-linux-x86-64.so.2
1253 %endif
1254 %if %isarch aarch64
1255 %{_slibdir}/ld-linux-aarch64.so.1
1256 %endif
1257 %if %isarch %mips
1258 %{_slibdir}/ld.so.1
1259 %endif
1260 %{_slibdir}/lib*-[.0-9]*.so
1261 %{_slibdir}/lib*.so.[0-9]*
1262 %{_slibdir}/libSegFault.so
1263 %if "%{name}" == "glibc"
1264 %dir %{_libdir}/audit
1265 %{_libdir}/audit/sotruss-lib.so
1266 %dir %{_libdir}/gconv
1267 %{_libdir}/gconv/*.so
1268 %{_libdir}/gconv/gconv-modules
1269 %ghost %{_libdir}/gconv/gconv-modules.cache
1270 %{_bindir}/catchsegv
1271 %{_bindir}/gencat
1272 %{_bindir}/getconf
1273 %{_bindir}/getent
1274 %{_bindir}/iconv
1275 %{_bindir}/ldd
1276 %if %isarch i386
1277 %{_bindir}/lddlibc4
1278 %endif
1279 %{_bindir}/locale
1280 %{_bindir}/localedef
1281 %{_bindir}/makedb
1282 %{_bindir}/pldd
1283 %{_bindir}/rpcgen
1284 %{_bindir}/sotruss
1285 %{_bindir}/sprof
1286 %{_bindir}/tzselect
1287 %{_sbindir}/iconvconfig
1288 %{_sbindir}/glibc-post-wrapper
1289 %endif
1290
1291 %if %isarch aarch64
1292 %{_slibdir32}/ld-linux-aarch64.so.1
1293 %endif
1294
1295 %if %{build_biarch}
1296 %{_slibdir32}/ld-%{glibcversion}.so
1297 %{_slibdir32}/ld-linux*.so.2
1298 %{_slibdir32}/lib*-[.0-9]*.so
1299 %{_slibdir32}/lib*.so.[0-9]*
1300 %{_slibdir32}/libSegFault.so
1301 %dir %{_prefix}/lib/audit
1302 %{_prefix}/lib/audit/sotruss-lib.so
1303 %dir %{_prefix}/lib/gconv
1304 %{_prefix}/lib/gconv/*
1305 %endif
1306 %if %isarch mips mipsel
1307 %{_slibdir}32/ld-%{glibcversion}.so
1308 %{_slibdir}32/ld.so.1
1309 %{_slibdir}32/lib*-[.0-9]*.so
1310 %{_slibdir}32/lib*.so.[0-9]*
1311 %{_slibdir}32/libSegFault.so
1312 %dir %{_libdir}32/gconv
1313 %{_libdir}32/gconv/*
1314 %{_slibdir}64/ld-%{glibcversion}.so
1315 %{_slibdir}64/ld.so.1
1316 %{_slibdir}64/lib*-[.0-9]*.so
1317 %{_slibdir}64/lib*.so.[0-9]*
1318 %{_slibdir}64/libSegFault.so
1319 %dir %{_libdir}64/gconv
1320 %{_libdir}64/gconv/*
1321 %endif
1322
1323 #
1324 # ldconfig
1325 #
1326 %if "%{name}" == "glibc"
1327 /sbin/ldconfig
1328 %ghost %{_sysconfdir}/ld.so.cache
1329 %dir %{_var}/cache/ldconfig
1330 %ghost %{_var}/cache/ldconfig/aux-cache
1331 %endif
1332
1333 #
1334 # glibc-devel
1335 #
1336 %files devel -f devel.filelist
1337 %doc README NEWS INSTALL
1338 # (tmb) FIXME, figure out rpm doc breakage/change
1339 #doc COPYING COPYING.LIB
1340 #doc documentation/*
1341 #doc hesiod/README.hesiod
1342 #doc crypt/README.ufc-crypt
1343 %{_libdir}/libc_nonshared.a
1344 %{_libdir}/libg.a
1345 %{_libdir}/libmcheck.a
1346 %if %isarch x86_64
1347 %{_libdir}/libm-%{glibcversion}.a
1348 %{_libdir}/libmvec.a
1349 %{_libdir}/libmvec_nonshared.a
1350 %endif
1351 #{_libdir}/libpthread_nonshared.a
1352 %if "%{name}" == "glibc"
1353 %{_libdir}/librpcsvc.a
1354 %endif
1355
1356 %if %{build_biarch}
1357 %{_prefix}/lib/libc_nonshared.a
1358 %{_prefix}/lib/libg.a
1359 %{_prefix}/lib/libmcheck.a
1360 #{_prefix}/lib/libpthread_nonshared.a
1361 %{_prefix}/lib/librpcsvc.a
1362 %endif
1363
1364 %if %isarch mips mipsel
1365 %{_libdir}32/libc_nonshared.a
1366 %{_libdir}32/libg.a
1367 %{_libdir}32/libmcheck.a
1368 %{_libdir}32/libpthread_nonshared.a
1369 %if "%{name}" == "glibc"
1370 %{_libdir}32/librpcsvc.a
1371 %endif
1372 %{_libdir}64/libc_nonshared.a
1373 %{_libdir}64/libg.a
1374 %{_libdir}64/libmcheck.a
1375 %{_libdir}64/libpthread_nonshared.a
1376 %if "%{name}" == "glibc"
1377 %{_libdir}64/librpcsvc.a
1378 %endif
1379 %endif
1380
1381 #
1382 # glibc-static-devel
1383 #
1384 %files static-devel
1385 %doc COPYING COPYING.LIB
1386 %{_libdir}/libBrokenLocale.a
1387 %{_libdir}/libanl.a
1388 %{_libdir}/libc.a
1389 %{_libdir}/libdl.a
1390 %{_libdir}/libm.a
1391 %{_libdir}/libnsl.a
1392 %{_libdir}/libpthread.a
1393 %{_libdir}/libresolv.a
1394 %{_libdir}/librt.a
1395 %{_libdir}/libutil.a
1396
1397 %if %{build_biarch}
1398 %{_prefix}/lib/libBrokenLocale.a
1399 %{_prefix}/lib/libanl.a
1400 %{_prefix}/lib/libc.a
1401 %{_prefix}/lib/libdl.a
1402 %{_prefix}/lib/libm.a
1403 %{_prefix}/lib/libnsl.a
1404 %{_prefix}/lib/libpthread.a
1405 %{_prefix}/lib/libresolv.a
1406 %{_prefix}/lib/librt.a
1407 %{_prefix}/lib/libutil.a
1408 %endif
1409
1410 %if %isarch mips mipsel
1411 %{_libdir}32/libBrokenLocale.a
1412 %{_libdir}32/libanl.a
1413 %{_libdir}32/libc.a
1414 %{_libdir}32/libdl.a
1415 %{_libdir}32/libm.a
1416 %{_libdir}32/libnsl.a
1417 %{_libdir}32/libpthread.a
1418 %{_libdir}32/libresolv.a
1419 %{_libdir}32/librt.a
1420 %{_libdir}32/libutil.a
1421
1422 %{_libdir}64/libBrokenLocale.a
1423 %{_libdir}64/libanl.a
1424 %{_libdir}64/libc.a
1425 %{_libdir}64/libdl.a
1426 %{_libdir}64/libm.a
1427 %{_libdir}64/libnsl.a
1428 %{_libdir}64/libpthread.a
1429 %{_libdir}64/libresolv.a
1430 %{_libdir}64/librt.a
1431 %{_libdir}64/libutil.a
1432 %endif
1433
1434 #
1435 # glibc-doc
1436 #
1437 %if %{build_doc}
1438 %files doc
1439 %{_infodir}/libc.info*
1440 %endif
1441
1442 #
1443 # glibc-doc-pdf
1444 #
1445 %if %{build_pdf_doc}
1446 %files doc-pdf
1447 %doc manual/libc.pdf
1448 %endif
1449
1450 #
1451 # glibc-debug
1452 #
1453 %if %{build_debug}
1454 %files debug
1455 %dir %{_libdir}/debug
1456 %{_libdir}/debug/*.so
1457 %{_libdir}/debug/*.so.*
1458 %if %isarch mips mipsel
1459 %dir %{_libdir}/debug/lib32
1460 %{_libdir}/debug/lib32/*.so
1461 %{_libdir}/debug/lib32/*.so.*
1462 %dir %{_libdir}/debug/lib64
1463 %{_libdir}/debug/lib64/*.so
1464 %{_libdir}/debug/lib64/*.so.*
1465 %endif
1466 %endif
1467
1468 #
1469 # glibc-profile
1470 #
1471 %if %{build_profile}
1472 %files profile
1473 %{_libdir}/lib*_p.a
1474 %if %{build_biarch}
1475 %{_prefix}/lib/lib*_p.a
1476 %endif
1477 %if %isarch mips mipsel
1478 %{_libdir}32/lib*_p.a
1479 %{_libdir}64/lib*_p.a
1480 %endif
1481 %endif
1482
1483 #
1484 # glibc-utils
1485 #
1486 %if %{build_utils}
1487 %files utils
1488 %if %{build_biarch}
1489 %{_slibdir32}/libmemusage.so
1490 %{_slibdir32}/libpcprofile.so
1491 %endif
1492 %{_slibdir}/libmemusage.so
1493 %{_slibdir}/libpcprofile.so
1494 %{_bindir}/memusage
1495 %{_bindir}/memusagestat
1496 %{_bindir}/mtrace
1497 %{_bindir}/pcprofiledump
1498 %{_bindir}/xtrace
1499 %if %isarch mips mipsel
1500 %{_slibdir}32/libmemusage.so
1501 %{_slibdir}32/libpcprofile.so
1502 %{_slibdir}64/libmemusage.so
1503 %{_slibdir}64/libpcprofile.so
1504 %endif
1505 %endif
1506
1507 #
1508 # nscd
1509 #
1510 %if %{build_nscd}
1511 %files -n nscd
1512 %config(noreplace) %{_sysconfdir}/nscd.conf
1513 %{_sbindir}/nscd
1514 %{_unitdir}/nscd.service
1515 %{_unitdir}/nscd.socket
1516 %{_tmpfilesdir}/nscd.conf
1517 %dir %{_var}/db/nscd
1518 %endif
1519
1520 #
1521 # timezone
1522 #
1523 %if %{build_timezone}
1524 %files -n timezone
1525 %{_sbindir}/zdump
1526 %{_sbindir}/zic
1527 %dir %{_datadir}/zoneinfo
1528 %{_datadir}/zoneinfo/*
1529 %endif
1530
1531 #
1532 # glibc-i18ndata
1533 #
1534 %if %{build_i18ndata}
1535 %files i18ndata
1536 %dir %{_datadir}/i18n
1537 %dir %{_datadir}/i18n/charmaps
1538 %{_datadir}/i18n/charmaps/*
1539 %dir %{_datadir}/i18n/locales
1540 %{_datadir}/i18n/locales/*
1541 %{_datadir}/i18n/SUPPORTED
1542 %endif

  ViewVC Help
Powered by ViewVC 1.1.30