/[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 1415586 - (show annotations) (download)
Sat Jun 29 14:47:16 2019 UTC (4 years, 9 months ago) by tmb
File size: 43817 byte(s)
- malloc: Fix warnings in tests with GCC 9
- Use a proper C tokenizer to implement the obsolete typedefs test
- libio: do not attempt to free wide buffers of legacy streams [BZ #24228]


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

  ViewVC Help
Powered by ViewVC 1.1.30