/[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 1378685 - (show annotations) (download)
Mon Mar 18 15:51:52 2019 UTC (5 years, 1 month ago) by tmb
File size: 42184 byte(s)
- switch to autopatch
- ensure upstream patches are applied before Mageia ones


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

  ViewVC Help
Powered by ViewVC 1.1.30