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

  ViewVC Help
Powered by ViewVC 1.1.30