/[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 1735141 - (show annotations) (download)
Wed Jul 7 22:01:52 2021 UTC (2 years, 9 months ago) by tmb
File size: 40641 byte(s)
wordexp: handle overflow in positional parameter number [BZ #28011]
1 # <epoch>:<version>-<release> tags for glibc main package
2 %define glibcversion 2.33
3 %define __glibcrelease 16
4 %define glibcepoch 6
5
6 %define source_package glibc-%{glibcversion}
7 %define source_dir glibc-%{glibcversion}
8 %define _glibcrelease %{__glibcrelease}
9
10 %define glibcrelease %mkrel %{_glibcrelease}
11
12 # Define "cross" to an architecture to which glibc is to be
13 # cross-compiled
14 %define build_cross 0
15 %{expand: %{?cross: %%global build_cross 1}}
16
17 %if %{build_cross}
18 %define target_cpu %{cross}
19 %define cross_prefix cross-%{target_cpu}-
20 %define _prefix /usr/%{target_cpu}-%{_real_vendor}-linux%{gnuext}
21 %define cross_program_prefix %{target_cpu}-%{_real_vendor}-linux%{gnuext}-
22 %define _exec_prefix %{_prefix}
23 # brain damage alert: should not be needed imho
24 # overriding _prefix and _exec_prefix should be enough
25 %define _bindir %{_exec_prefix}/bin
26 %define _sbindir %{_exec_prefix}/sbin
27 %define _libexecdir %{_exec_prefix}/libexec
28 %define _datadir %{_prefix}/share
29 %define _sharedstatedir %{_prefix}/com
30 %define _localstatedir %{_prefix}/var
31 %define _lib lib
32 %define _libdir %{_exec_prefix}/%{_lib}
33 %define _slibdir %{_exec_prefix}/%{_lib}
34 %define _slibdir32 %{_exec_prefix}/lib
35 %define _includedir %{_prefix}/include
36 %else
37 %define gnuext %{_gnu}
38 %define target_cpu %{_target_cpu}
39 %define cross_prefix %{nil}
40 %define cross_program_prefix %{nil}
41 %define _slibdir /%{_lib}
42 %define _slibdir32 /lib
43 %endif
44
45 # Define target (base) architecture
46 %define arch %(echo %{target_cpu}|sed -e "s/\\(i.86\\|athlon\\)/i386/" -e "s/amd64/x86_64/")
47 %define isarch() %(case " %* " in (*" %{arch} "*) echo 1;; (*) echo 0;; esac)
48
49 %if %{build_cross}
50 %if %isarch %arm
51 %define gnuext -gnueabi
52 %else
53 %define gnuext -gnu
54 %endif
55 %endif
56
57 # Define Xen arches to build with -mno-tls-direct-direct-seg-refs
58 %define xenarches %{ix86} x86_64
59
60 # arches which requires glibc-port
61 %define ports_arch %arm
62
63 # Define to build nscd with selinux support
64 %define build_selinux 0
65
66 # Flag for build_pdf_doc:
67 # 1 build glibc with PDF documentation
68 # 0 don't build PDF glibc documentation (e.g. for bootstrap build)
69 %define build_pdf_doc 0
70
71 # Enable checking by default for arches where we know tests all pass
72 %define build_check 0
73
74 # Allow make check to fail only when running kernels where we know
75 # tests must pass (no missing features or bugs in the kernel)
76 %define check_min_kver 2.6.32
77
78 # Define to build a biarch package
79 %define build_biarch 0
80 %if %isarch x86_64
81 %define build_biarch 1
82 %endif
83
84 # build debug packages
85 %define build_debug 1
86
87 # Define to bootstrap new glibc
88 %define build_bootstrap 0
89 %{expand: %{!?build_cross_bootstrap: %global build_cross_bootstrap 0}}
90
91 %define build_profile 1
92 %define build_nscd 1
93 %define build_doc 1
94 %define build_utils 1
95 %define build_i18ndata 1
96 %define build_timezone 0
97
98 # Disable a few defaults when cross-compiling a glibc
99 %if %{build_cross}
100 %define build_doc 0
101 %define build_pdf_doc 0
102 %define build_biarch 0
103 %define build_check 0
104 %define build_nscd 0
105 %define build_profile 0
106 %define build_utils 0
107 %define build_i18ndata 0
108 %define build_timezone 0
109 %endif
110
111 # Allow --with[out] <feature> at rpm command line build
112 %{expand: %{?_without_PDF: %%global build_pdf_doc 0}}
113 %{expand: %{?_without_CHECK: %%global build_check 0}}
114 %{expand: %{?_without_UTILS: %%global build_utils 0}}
115 %{expand: %{?_without_BOOTSTRAP:%%global build_bootstrap 0}}
116 %{expand: %{?_with_PDF: %%global build_pdf_doc 1}}
117 %{expand: %{?_with_CHECK: %%global build_check 1}}
118 %{expand: %{?_with_UTILS: %%global build_utils 1}}
119 %{expand: %{?_with_BOOTSTRAP: %%global build_bootstrap 1}}
120
121 Summary: The GNU libc libraries
122 Name: %{cross_prefix}glibc
123 Version: %{glibcversion}
124 Release: %{glibcrelease}
125 Epoch: %{glibcepoch}
126 License: LGPL
127 Group: System/Libraries
128 Url: https://www.gnu.org/software/libc/
129
130 # FSF source
131 Source0: https://ftpmirror.gnu.org/libc/%{source_package}.tar.xz
132 Source1: https://ftpmirror.gnu.org/libc/%{source_package}.tar.xz.sig
133 Source2: glibc-git.sh
134
135 Source4: glibc-find-requires.sh
136 Source5: glibc-check.sh
137 Source6: nscd.service
138 Source7: nscd.socket
139 Source8: nsswitch.conf
140 Source9: nscd.conf
141
142 # wrapper to avoid rpm circular dependencies
143 Source14: glibc-post-wrapper.c
144
145 %if %{build_cross}
146 Autoreq: false
147 Autoprov: false
148 %else
149 Provides: should-restart = system
150 %if %isarch %{xenarches}
151 Obsoletes: %{name}-xen
152 Provides: %{name}-xen
153 %endif
154 # The dynamic linker supports DT_GNU_HASH
155 Provides: rtld(GNU_HASH)
156 Autoreq: false
157 %endif
158 BuildRequires: bison >= 3.3.1-1
159 BuildRequires: patch
160 BuildRequires: gettext
161 BuildRequires: perl
162 BuildRequires: kernel-userspace-headers
163 BuildRequires: libstdc++-static-devel
164 BuildRequires: hardlink
165 %if %{build_selinux}
166 BuildRequires: pkgconfig(libselinux) >= 1.17.10
167 BuildRequires: pkgconfig(libpcre) >= 8.44
168 %endif
169 # (tmb) force new gcc 10.2
170 BuildRequires: %{cross_prefix}gcc >= 11.1.0
171 # (tmb) force latest binutils
172 BuildRequires: %{cross_prefix}binutils >= 1:2.36.1-6
173 # we need the static dash
174 %define ash_bin /usr/bin/dash.static
175 Requires(post): dash-static
176 Requires(post): grep
177 Requires: filesystem >= 2.1.9-18
178 # ensure libxcrypt is installed as glibc crypt is disabled / being obsoleted
179 Requires: %{_lib}xcrypt1 >= 4.1.1-1
180
181 BuildRequires: systemtap-sdt-devel
182
183 BuildRequires: texinfo
184 BuildRequires: texinfo-tex
185 %if %{build_pdf_doc}
186 BuildRequires: texlive
187 %endif
188 %if %{build_utils}
189 BuildRequires: pkgconfig(gdlib)
190 %endif
191 BuildRequires: autoconf2.5
192 BuildRequires: pkgconfig(libcap)
193 BuildRequires: rpm-mageia-setup-build >= 1.147
194 BuildRequires: spec-helper >= 0.31.2
195
196 ###
197 ### upstream release/2.33/master branch
198 ### git format-patch --start-number 200 glibc-2.33..origin/release/2.33/master
199 ###
200 Patch200: 0200-nsswitch-return-result-when-nss-database-is-locked-B.patch
201 Patch201: 0201-tunables-Simplify-TUNABLE_SET-interface.patch
202 Patch202: 0202-x86-Use-SIZE_MAX-instead-of-long-int-1-for-tunable-r.patch
203 Patch203: 0203-tunables-Disallow-negative-values-for-some-tunables.patch
204 Patch204: 0204-S390-Add-new-hwcap-values.patch
205 Patch205: 0205-string-Work-around-GCC-PR-98512-in-rawmemchr.patch
206 Patch206: 0206-ld.so-Implement-the-list-diagnostics-option.patch
207 Patch207: 0207-x86-Automate-generation-of-PREFERRED_FEATURE_INDEX_1.patch
208 Patch208: 0208-x86-Add-CPU-specific-diagnostics-to-ld.so-list-diagn.patch
209 Patch209: 0209-nss-Re-enable-NSS-module-loading-after-chroot-BZ-273.patch
210 Patch210: 0210-x86-Set-minimum-x86-64-level-marker-BZ-27318.patch
211 Patch211: 0211-nscd-Fix-double-free-in-netgroupcache-BZ-27462.patch
212 Patch212: 0212-io-Return-EBAFD-for-negative-file-descriptor-on-fsta.patch
213 Patch213: 0213-x86-Handle-_SC_LEVEL1_ICACHE_LINESIZE-BZ-27444.patch
214 Patch214: 0214-elf-Always-set-l-in-_dl_init_paths-bug-23462.patch
215 Patch215: 0215-elf-ld.so-help-calls-_dl_init_paths-without-a-main-m.patch
216 Patch216: 0216-pthread_once-hangs-when-init-routine-throws-an-excep.patch
217 Patch217: 0217-nptl-Remove-private-futex-optimization-BZ-27304.patch
218 Patch218: 0218-test-container-Always-copy-test-specific-support-fil.patch
219 Patch219: 0219-S390-Also-check-vector-support-in-memmove-ifunc-sele.patch
220 Patch220: 0220-malloc-Fix-a-realloc-crash-with-heap-tagging-BZ-2746.patch
221 Patch221: 0221-Update-Nios-II-libm-test-ulps.patch
222 Patch222: 0222-tst-Provide-test-for-select.patch
223 Patch223: 0223-misc-Fix-tst-select-timeout-handling-BZ-27648.patch
224 Patch224: 0224-libsupport-Add-support_select_modifies_timeout.patch
225 Patch225: 0225-libsupport-Add-support_select_normalizes_timeout.patch
226 Patch226: 0226-linux-Normalize-and-return-timeout-on-select-BZ-2765.patch
227 Patch227: 0227-linux-always-update-select-timeout-BZ-27706.patch
228 Patch228: 0228-tunables-Fix-comparison-of-tunable-values.patch
229 Patch229: 0229-support-Typo-and-formatting-fixes.patch
230 Patch230: 0230-support-Pass-environ-to-child-process.patch
231 Patch231: 0231-support-Add-capability-to-fork-an-sgid-child.patch
232 Patch232: 0232-tst-env-setuid-Use-support_capture_subprogram_self_s.patch
233 Patch233: 0233-Enhance-setuid-tunables-test.patch
234 Patch234: 0234-Fix-SXID_ERASE-behavior-in-setuid-programs-BZ-27471.patch
235 Patch235: 0235-Remove-PR_TAGGED_ADDR_ENABLE-from-sys-prctl.h.patch
236 Patch236: 0236-x86-tst-cpu-features-supports.c-Update-AMX-check.patch
237 Patch237: 0237-nptl_db-Support-different-libpthread-ld.so-load-orde.patch
238 Patch238: 0238-nptl-Check-for-compatible-GDB-in-nptl-tst-pthread-gd.patch
239 Patch239: 0239-nptl-Do-not-build-nptl-tst-pthread-gdb-attach-as-PIE.patch
240 Patch240: 0240-powerpc-Fix-handling-of-scv-return-error-codes-BZ-27.patch
241 Patch241: 0241-dlfcn-Failures-after-dlmopen-should-not-terminate-pr.patch
242 Patch242: 0242-Use-__pthread_attr_copy-in-mq_notify-bug-27896.patch
243 Patch243: 0243-Fix-use-of-__pthread_attr_copy-in-mq_notify-bug-2789.patch
244 Patch244: 0244-elf-Use-_dl_catch_error-from-base-namespace-in-dl-li.patch
245 # CVE-2021-35942
246 Patch245: 0245-wordexp-handle-overflow-in-positional-parameter-numb.patch
247
248 ###
249 ### upstream master branch
250 ### starts from number 300
251 ###
252 Patch300: 0300-x86-Check-RTM_ALWAYS_ABORT-for-RTM-BZ-28033.patch
253 Patch301: 0301-x86-Copy-IBT-and-SHSTK-usable-only-if-CET-is-enabled.patch
254 Patch302: 0302-x86-Fix-tst-cpu-features-cpuinfo-on-Ryzen-9-BZ-27873.patch
255
256 ###
257 ### Mageia patches
258 ###
259
260 # make "localedef --add-to-archive" to follow symlink
261 # safe to send ustream, need to be kept for locales
262 Patch00: glibc-2.17-localedef-archive-follow-symlinks.patch
263
264 # various path fix, according to usrmove
265 Patch01: glibc-2.17-fhs-usrmove.patch
266
267 Patch06: glibc-2.26-share-locale.patch
268 # use xvt instead of xterm in xtrace.sh
269 # cannot be pushed upstream as xvt is Ma* specific
270 Patch09: glibc-2.2.4-xterm-xvt.patch
271
272 # add transliteration for "COLON SIGN"
273 # ( used for the money of money of san salvador )
274 Patch11: glibc-2.19-compat-EUR-currencies.patch
275
276 # fix the chkconfig header, should be sent upstream
277 Patch13: glibc-2.3.3-nscd-enable.patch
278
279 # disable cache for hosts on nscd, as this is seen as insecure
280 # if the system relie on reverse dns for security
281 Patch14: glibc-2.9-nscd-no-host-cache.patch
282
283 # add some new timezone for various cities
284 # Halifax, Montreal, Johannesburg
285 # should be sent upstream ( I guess )
286 Patch23: glibc-2.3.4-timezone.patch
287 Patch24: glibc-2.10.1-biarch-cpp-defines.patch
288
289 Patch29: glibc-2.3.5-biarch-utils.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 # (tmb) filter out requires on self-provides
352 %global __requires_exclude devel\\(libm.*\\)
353 # (tmb) add virtual provides for old libm to ease builds... from glibc-2.22 libmvec is preferred
354 %ifarch x86_64
355 Provides: devel(libm(64bit))
356 %endif
357 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
358 %if !%{build_cross}
359 Requires: linux-userspace-headers
360 %endif
361 %if %{build_cross}
362 Autoreq: false
363 Autoprov: false
364 %else
365 Autoreq: true
366 %endif
367
368 %description devel
369 The glibc-devel package contains the header and object files necessary
370 for developing programs which use the standard C libraries (which are
371 used by nearly all programs). If you are developing programs which
372 will use the standard C libraries, your system needs to have these
373 standard header and object files available in order to create the
374 executables.
375
376 This package also includes the C header files for the Linux kernel.
377 The header files define structures and constants that are needed for
378 building most standard programs. The header files are also needed for
379 rebuilding the kernel.
380
381 Install glibc-devel if you are going to develop programs which will
382 use the standard C libraries.
383
384 %package static-devel
385 Summary: Static libraries for GNU C library
386 Group: Development/C
387 Requires: %{name}-devel = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
388 # ensure libxcrypt is installed as glibc crypt is disabled / being obsoleted
389 Requires: %{_lib}xcrypt-static-devel >= 4.1.1-1
390
391 %description static-devel
392 The glibc-static-devel package contains the static libraries necessary
393 for developing programs which use the standard C libraries. Install
394 glibc-static-devel if you need to statically link your program or
395 library.
396
397 %package profile
398 Summary: The GNU libc libraries, including support for gprof profiling
399 Group: Development/C
400 Obsoletes: libc-profile
401 Provides: libc-profile = %{glibcversion}-%{glibcrelease}
402 Autoreq: true
403
404 %description profile
405 The glibc-profile package includes the GNU libc libraries and support
406 for profiling using the gprof program. Profiling is analyzing a
407 program's functions to see how much CPU time they use and determining
408 which functions are calling other functions during execution. To use
409 gprof to profile a program, your program needs to use the GNU libc
410 libraries included in glibc-profile (instead of the standard GNU libc
411 libraries included in the glibc package).
412
413 If you are going to use the gprof program to profile a program, you'll
414 need to install the glibc-profile program.
415
416 %package -n nscd
417 Summary: A Name Service Caching Daemon (nscd)
418 Group: System/Servers
419 Requires(post): systemd >= %{systemd_required_version}
420 Requires(post): rpm-helper >= 0.24.8-1
421 Requires(preun): rpm-helper >= 0.24.8-1
422 Autoreq: true
423
424 %description -n nscd
425 Nscd caches name service lookups and can dramatically improve
426 performance with NIS+, and may help with DNS as well. Note that you
427 can't use nscd with 2.0 kernels because of bugs in the kernel-side
428 thread support. Unfortunately, nscd happens to hit these bugs
429 particularly hard.
430
431 Install nscd if you need a name service lookup caching daemon, and
432 you're not using a version 2.0 kernel.
433
434 %package utils
435 Summary: Development utilities from GNU C library
436 Group: Development/Other
437 Requires: %{name} = %{glibcepoch}:%{glibcversion}-%{glibcrelease}
438
439 %description utils
440 The glibc-utils package contains memusage, a memory usage profiler,
441 mtrace, a memory leak tracer and xtrace, a function call tracer which
442 can be helpful during program debugging.
443
444 If unsure if you need this, don't install this package.
445
446 %if %{build_i18ndata}
447 %package i18ndata
448 Summary: Database sources for 'locale'
449 Group: System/Libraries
450
451 %description i18ndata
452 This package contains the data needed to build the locale data files
453 to use the internationalization features of the GNU libc.
454 %endif
455
456 %if %{build_timezone}
457 %package -n timezone
458 Summary: Time zone descriptions
459 Group: System/Base
460
461 %description -n timezone
462 These are configuration files that describe possible
463 time zones.
464 %endif
465
466 ### glibc core "debuginfo and debugsource" sub-packages
467 %if %{build_debug}
468 %define debug_package %{nil}
469 %define __debug_install_post %{nil}
470 %global __debug_package 1
471 # Disable thew new features that glibc packages don't use.
472 %undefine _debugsource_packages
473 %undefine _debuginfo_subpackages
474 %undefine _unique_debug_names
475 %undefine _unique_debug_srcs
476
477 %package debuginfo
478 Summary: Debug information for package %{name}
479 Group: Development/Debug
480 AutoReqProv: no
481
482 %description debuginfo
483 This package provides debug information for package %{name}.
484 Debug information is useful when developing applications that use this
485 package or when debugging this package.
486
487 %package debugsource
488 Summary: Debug source for package %{name}
489 Group: Development/Debug
490 AutoReqProv: no
491
492 %description debugsource
493 This package provides debug source for %{name}
494 %endif
495
496 %package doc
497 Summary: GNU C library documentation
498 Group: Development/Other
499 BuildArch: noarch
500
501 %description doc
502 The glibc-doc package contains documentation for the GNU C library in
503 info format.
504
505 %if %{build_pdf_doc}
506 %package doc-pdf
507 Summary: GNU C library documentation
508 Group: Development/Other
509 BuildArch: noarch
510
511 %description doc-pdf
512 The glibc-doc-pdf package contains the printable documentation for the
513 GNU C library in PDF format.
514 %endif
515
516 %prep
517 %setup -q -n %{source_dir}
518 %autopatch -p1
519
520 %if %{build_selinux}
521 # XXX kludge to build nscd with selinux support as it added -nostdinc
522 # so /usr/include/selinux is not found
523 ln -s %{_includedir}/selinux selinux
524 %endif
525
526 find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;
527
528 # \\(Anssi 03/2008\\) FIXME: use __provides_exclude
529 cat > find_provides.sh << EOF
530 #!/bin/sh
531 %{rpmscripts}/find-provides | grep -v GLIBC_PRIVATE
532 exit 0
533 EOF
534 chmod +x find_provides.sh
535
536 cat > find_requires.bootstrap.sh << EOF
537 /bin/sh %{SOURCE4} %{buildroot} %{_target_cpu} | grep -v "\(GLIBC_PRIVATE\|linux-gate\|linux-vdso\)"
538 exit 0
539 EOF
540 chmod +x find_requires.bootstrap.sh
541
542 # XXX: use better way later to avoid LD_LIBRARY_PATH issue
543 cat %{rpmscripts}/find-requires | sed '/.*LD_LIBRARY_PATH.*/d;' > find_requires
544 chmod +x find_requires
545 # \\(Anssi 03/2008\\) FIXME: use __requires_exclude
546 cat > find_requires.noprivate.sh << EOF
547 %{_builddir}/%{source_dir}/find_requires %{buildroot} %{_target_cpu} | \
548 grep -v GLIBC_PRIVATE
549 exit 0
550 EOF
551 chmod +x find_requires.noprivate.sh
552
553 # FIXME: fix system rpm find-requires to use the prefix cross version
554 %if %{build_bootstrap} || "%{_target_cpu}" != "%{target_cpu}"
555 ln -s find_requires.bootstrap.sh find_requires.sh
556 %else
557 ln -s find_requires.noprivate.sh find_requires.sh
558 %endif
559
560 # Remove patch backups from files we ship in glibc packages
561 rm -fr ChangeLog.old
562 rm -f localedata/locales/{???_??,??_??}.*
563 rm -f localedata/locales/[a-z_]*.*
564
565 %build
566 # Prepare test matrix in the next function
567 CheckList=$PWD/Check.list
568 rm -f $CheckList
569 touch $CheckList
570
571 #
572 # CompareKver <kernel version>
573 # function to compare the desired kernel version with running kernel
574 # version (package releases not taken into account in comparison). The
575 # function returns:
576 # -1 = <kernel version> is lesser than current running kernel
577 # 0 = <kernel version> is equal to the current running kernel
578 # 1 = <kernel version> is greater than current running kernel
579 #
580 function CompareKver() {
581 v1=`echo $1 | sed 's/\.\?$/./'`
582 v2=`uname -r | sed 's/[^.0-9].*//' | sed 's/\.\?$/./'`
583 n=1
584 s=0
585 while true; do
586 c1=`echo "$v1" | cut -d "." -f $n`
587 c2=`echo "$v2" | cut -d "." -f $n`
588 if [ -z "$c1" -a -z "$c2" ]; then
589 break
590 elif [ -z "$c1" ]; then
591 s=-1
592 break
593 elif [ -z "$c2" ]; then
594 s=1
595 break
596 elif [ "$c1" -gt "$c2" ]; then
597 s=1
598 break
599 elif [ "$c2" -gt "$c1" ]; then
600 s=-1
601 break
602 fi
603 n=$((n + 1))
604 done
605 echo $s
606 }
607
608 #
609 # BuildGlibc <arch> [<extra_configure_options>+]
610 #
611 function BuildGlibc() {
612 arch="$1"
613 shift 1
614
615 # PowerPC CPU add-on
616 case $arch in
617 cpu-addon,*)
618 cpu=` echo "$arch" | sed -n "/.*,\([^,]*\),.*$/s//\1/p"`
619 arch=`echo "$arch" | sed -n "/.*,.*,\([^,]*\)$/s//\1/p"`
620 ;;
621 *)
622 cpu=$arch
623 ;;
624 esac
625
626 # Select optimization flags and compiler to use
627 BuildAltArch="no"
628 BuildCompFlags=""
629 BuildFlags=""
630 case $arch in
631 i[3456]86 | athlon)
632 BuildFlags="-march=$arch -mtune=generic"
633 if [[ "`uname -m`" = "x86_64" ]]; then
634 BuildAltArch="yes"
635 BuildCompFlags="-m32"
636 fi
637 ;;
638 x86_64)
639 BuildFlags="-mtune=generic"
640 ;;
641 armv4t*)
642 BuildFlags="-march=armv4t"
643 BuildCompFlags="-march=armv4t"
644 ;;
645 armv5t*)
646 BuildFlags="-march=armv5t"
647 BuildCompFlags="-march=armv5t"
648 ;;
649 # to check
650 armv7h*)
651 BuildFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
652 BuildCompFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16"
653 ;;
654 esac
655
656 # Choose multiarch support
657 MultiArchFlags=
658 case $arch in
659 i686 | x86_64)
660 MultiArchFlags="--enable-multi-arch"
661 ;;
662 esac
663
664 # Determine C & C++ compilers
665 BuildCC="%{__cc} $BuildCompFlags"
666 BuildCXX="%{__cxx} $BuildCompFlags"
667
668 # Are we supposed to cross-compile?
669 if [[ "%{target_cpu}" != "%{_target_cpu}" ]]; then
670 # Can't use BuildCC anymore with previous changes.
671 BuildCC="%{cross_program_prefix}gcc $BuildCompFlags"
672 BuildCXX="%{cross_program_prefix}g++ $BuildCompFlags"
673 BuildCross="--build=%{_target_platform}"
674 export libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes
675 fi
676
677 BuildFlags="$BuildFlags -DNDEBUG=1 -O2 -finline-functions -g"
678
679 # Do not use direct references against %gs when accessing tls data
680 # XXX make it the default in GCC? (for other non glibc specific usage)
681 case $arch in
682 i[3456]86 | x86_64)
683 BuildFlags="$BuildFlags -mno-tls-direct-seg-refs"
684 ;;
685 esac
686
687 # Arch specific compilation flags
688 if [[ "$arch" = "ppc64" ]]; then
689 BuildFlags="$BuildFlags -fno-inline-functions -mno-minimal-toc"
690 fi
691
692 # Extra configure flags
693 ExtraFlags=
694 if [[ "%{build_profile}" != "0" ]]; then
695 ExtraFlags="$ExtraFlags --enable-profile"
696 fi
697
698 # NPTL+TLS are now the default
699 # check for other arches
700 %if %isarch %ports_arch
701 Pthreads="ports nptl"
702 %else
703 Pthreads="nptl"
704 %endif
705
706 # Add-ons
707 AddOns="libidn"
708 if [[ "$cpu" != "$arch" ]]; then
709 AddOns="$AddOns,powerpc-cpu"
710 BuildFlags="$BuildFlags -mcpu=$cpu"
711 ExtraFlags="$ExtraFlags --with-cpu=$cpu"
712 fi
713
714 # Build with selinux support?
715 %if %{build_selinux}
716 SElinuxFlags="--with-selinux"
717 %else
718 SElinuxFlags="--without-selinux"
719 %endif
720
721 # Kernel headers directory
722 KernelHeaders=%{_includedir}
723
724 # Determine library name
725 glibc_cv_cc_64bit_output=no
726 if echo ".text" | $BuildCC -c -o test.o -xassembler -; then
727 case `/usr/bin/file test.o` in
728 *"ELF 64"*)
729 glibc_cv_cc_64bit_output=yes
730 ;;
731 esac
732 fi
733 rm -f test.o
734
735 # Force a separate and clean object dir
736 rm -rf build-$cpu-linux
737 mkdir build-$cpu-linux
738 pushd build-$cpu-linux
739 [[ "$BuildAltArch" = "yes" ]] && touch ".alt" || touch ".main"
740 CC="$BuildCC" CXX="$BuildCXX" CFLAGS="$BuildFlags -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -Wno-maybe-uninitialized" ../configure \
741 $arch-%{_real_vendor}-linux%{gnuext} $BuildCross \
742 --prefix=%{_prefix} \
743 --libexecdir=%{_prefix}/libexec \
744 --infodir=%{_infodir} \
745 --enable-add-ons="$AddOns" --without-cvs \
746 $ExtraFlags $MultiArchFlags $SElinuxFlags \
747 --enable-kernel=%{enablekernel} \
748 --with-headers=$KernelHeaders ${1+"$@"} \
749 --enable-systemtap \
750 --disable-crypt
751 %make_build -r -s
752 popd
753
754 # All tests are expected to pass on certain platforms, depending also
755 # on the version of the kernel running
756 case $arch in
757 athlon | ia64 | ppc | ppc64)
758 if [ "`CompareKver %{check_min_kver}`" -lt 0 ]; then
759 check_flags=""
760 else
761 check_flags="-k"
762 fi
763 ;;
764 *)
765 check_flags="-k"
766 ;;
767 esac
768
769 # Generate test matrix
770 [[ -d "build-$arch-linux" ]] || {
771 echo "ERROR: PrepareGlibcTest: build-$arch-linux does not exist!"
772 return 1
773 }
774 local BuildJobs="-j`getconf _NPROCESSORS_ONLN`"
775 echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
776
777 case $cpu in
778 i686|athlon) base_arch=i586;;
779 power*) base_arch=$arch;;
780 *) base_arch=none;;
781 esac
782
783 [[ -d "build-$base_arch-linux" ]] && {
784 check_flags="$check_flags -l build-$base_arch-linux/elf/ld.so"
785 echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList
786 }
787 return 0
788 }
789
790 # Build main glibc
791 BuildGlibc %{target_cpu}
792
793 %if %{build_biarch}
794 %if %isarch x86_64
795 BuildGlibc i686
796 %endif
797 %endif
798
799 # Build i686 libraries if not already building for i686/athlon
800 case %{target_cpu} in
801 i686 | athlon)
802 ;;
803 i[3-6]86)
804 # BuildGlibc i686 --disable-profile
805 ;;
806 esac
807
808 %if %{build_check}
809 export TMPDIR=/tmp
810 export TIMEOUTFACTOR=16
811 Check="$PWD/glibc-check.sh"
812 cat %{SOURCE5} > $Check
813 chmod +x $Check
814 while read arglist; do
815 $Check $arglist || exit 1
816 done < $CheckList
817 %endif
818
819 %install
820 # force use of _NPROCESSORS_ONLN jobs since RPM_BUILD_NCPUS could be
821 # greater for icecream
822 BuildJobs="-j`getconf _NPROCESSORS_ONLN`"
823
824 make install_root=%{buildroot} install -C build-%{target_cpu}-linux
825 %if %{build_i18ndata}
826 (cd build-%{target_cpu}-linux;
827 make $BuildJobs -C ../localedata objdir=`pwd` \
828 install_root=%{buildroot} \
829 install-locales
830 )
831 install -m 0644 localedata/SUPPORTED %{buildroot}/%{_datadir}/i18n/
832 %endif
833
834 # Empty filelist for non i686/athlon targets
835 > extralibs.filelist
836
837 # Install biarch libraries
838 %if %{build_biarch}
839 %if %isarch x86_64
840 ALT_ARCHES=i686-linux
841 %endif
842
843 for ALT_ARCH in $ALT_ARCHES; do
844 mkdir -p %{buildroot}/$ALT_ARCH
845 make install_root=%{buildroot}/$ALT_ARCH install -C build-$ALT_ARCH
846
847 # Dispatch */lib only
848 LIB=/lib
849 %if !%{build_cross}
850 mv %{buildroot}/$ALT_ARCH/$LIB %{buildroot}/$LIB
851 mv %{buildroot}/$ALT_ARCH%{_prefix}/libexec/getconf/* \
852 %{buildroot}%{_prefix}/libexec/getconf/
853 [ ! -d %{buildroot}/%{_prefix}/$LIB/ ] && mkdir -p %{buildroot}/%{_prefix}/$LIB/
854 mv %{buildroot}/$ALT_ARCH/%{_prefix}/$LIB/* %{buildroot}/%{_prefix}/$LIB/
855 %else
856 mv %{buildroot}/$ALT_ARCH/%{_prefix}/lib %{buildroot}/$LIB
857 sed -i %{buildroot}/$LIB/libc.so -e "s!%{_slibdir}!$LIB!g"
858 %endif
859
860 rm -rf %{buildroot}/$ALT_ARCH
861 # XXX Dispatch 32-bit stubs
862 (sed '/^@/d' include/stubs-prologue.h; LC_ALL=C sort $(find build-$ALT_ARCH -name stubs)) \
863 > %{buildroot}%{_includedir}/gnu/stubs-32.h
864 done
865 %endif
866
867 # Install extra glibc libraries
868 function InstallGlibc() {
869 local BuildDir="$1"
870 local SubDir="$2"
871 local LibDir="$3"
872
873 case $BuildDir in
874 *) Pthreads=nptl ;;
875 esac
876
877 [[ -z "$LibDir" ]] && LibDir="%{_slibdir}"
878
879 pushd $BuildDir
880 mkdir -p %{buildroot}$LibDir/$SubDir/
881 install -m755 libc.so %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libc-*.so`
882 ln -sf `basename %{buildroot}$LibDir/libc-*.so` %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libc.so.*`
883 install -m755 math/libm.so %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libm-*.so`
884 ln -sf `basename %{buildroot}$LibDir/libm-*.so` %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libm.so.*`
885 install -m755 $Pthreads/libpthread.so %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libpthread-*.so`
886 ln -sf `basename %{buildroot}$LibDir/libpthread-*.so` %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libpthread.so.*`
887 install -m755 ${Pthreads}_db/libthread_db.so %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libthread_db-*.so`
888 ln -sf `basename %{buildroot}$LibDir/libthread_db-*.so` %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/libthread_db.so.*`
889 install -m755 rt/librt.so %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/librt-*.so`
890 ln -sf `basename %{buildroot}$LibDir/librt-*.so` %{buildroot}$LibDir/$SubDir/`basename %{buildroot}$LibDir/librt.so.*`
891 echo "%dir $LibDir/$SubDir" >> ../extralibs.filelist
892 find %{buildroot}$LibDir/$SubDir -maxdepth 1 -type f -o -type l | sed -e "s|%{buildroot}||" >> ../extralibs.filelist
893 popd
894 }
895
896 # Install arch-specific optimized libraries
897 %if %isarch %{ix86}
898 case %{target_cpu} in
899 i[3-5]86)
900 # InstallGlibc build-i686-linux i686
901 ;;
902 esac
903 %endif
904
905 # Remove the files we don't want to distribute
906 rm -f %{buildroot}%{_libdir}/libNoVersion*
907 rm -f %{buildroot}%{_slibdir}/libNoVersion*
908
909 %if "%{name}" == "glibc"
910 install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/nsswitch.conf
911 %endif
912
913 # This is for ncsd - in glibc 2.2
914 %if %{build_nscd}
915 install -m 644 nscd/nscd.conf %{buildroot}%{_sysconfdir}
916 install -d -m 755 %{buildroot}%{_unitdir}
917 install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/nscd.service
918 install -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/nscd.socket
919 install -D -m 644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}/nscd.conf
920 install -d -m 755 %{buildroot}%{_var}/db/nscd
921 %endif
922
923 # Useless and takes place
924 rm -rf %buildroot/%{_datadir}/zoneinfo/{posix,right}
925
926 # Include ld.so.conf
927 %if "%{name}" == "glibc"
928 echo "include /etc/ld.so.conf.d/*.conf" > %{buildroot}%{_sysconfdir}/ld.so.conf
929 chmod 644 %{buildroot}%{_sysconfdir}/ld.so.conf
930 mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
931
932 # ldconfig cache
933 mkdir -p %{buildroot}%{_var}/cache/ldconfig
934 touch %{buildroot}%{_var}/cache/ldconfig/aux-cache
935 %endif
936
937 # Include %{_libdir}/gconv/gconv-modules.cache
938 > %{buildroot}%{_libdir}/gconv/gconv-modules.cache
939 chmod 644 %{buildroot}%{_libdir}/gconv/gconv-modules.cache
940
941 %if "%{name}" == "glibc"
942 touch %{buildroot}%{_sysconfdir}/ld.so.cache
943 %endif
944
945 # Are we cross-compiling?
946 Strip="strip"
947 if [[ "%{_target_cpu}" != "%{target_cpu}" ]]; then
948 Strip="%{cross_program_prefix}$Strip"
949 fi
950
951 # Strip debugging info from all static libraries
952 pushd %{buildroot}%{_slibdir}
953 for i in *.a; do
954 if [ -f "$i" ]; then
955 case "$i" in
956 *_p.a) ;;
957 *) $Strip -g -R .comment $i ;;
958 esac
959 fi
960 done
961 popd
962 pushd %{buildroot}%{_libdir}
963 for i in libc_nonshared.a; do
964 if [ -f "$i" ]; then
965 $Strip -g -R .comment $i
966 fi
967 done
968 popd
969
970 # post install wrapper
971 %__cc -Os -g %{SOURCE14} -static \
972 -o "%{buildroot}%{_sbindir}/glibc-post-wrapper" \
973 -L "%{buildroot}%{_libdir}/" \
974 '-DSLIBDIR="%{_slibdir}"' \
975 '-DGCONV_DIR="%{_libdir}/gconv"'
976 chmod 700 %{buildroot}%{_sbindir}/glibc-post-wrapper
977
978 # rquota.x and rquota.h are now provided by quota
979 rm -f %{buildroot}%{_includedir}/rpcsvc/rquota.[hx]
980
981 # Hardlink identical locale files together
982 %if %{build_i18ndata}
983 %{_bindir}/hardlink -vc %{buildroot}%{_datadir}/locale
984 %endif
985
986 rm -rf %{buildroot}%{_includedir}/netatalk/
987
988 # Build file list for devel package
989 find %{buildroot}%{_includedir} -type f -or -type l > devel.filelist
990 find %{buildroot}%{_includedir} -type d | sed "s/^/%dir /" | \
991 grep -v "%{_libdir}/libnss1.*.so$" | \
992 grep -v "%{_includedir}$" | >> devel.filelist
993 find %{buildroot}%{_libdir} -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
994 # biarch libs
995 %if %{build_biarch}
996 find %{buildroot}%{_prefix}/lib -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist
997 %endif
998 perl -pi -e "s|%{buildroot}||" devel.filelist
999
1000 # /etc/localtime - we're proud of our timezone #Well we may put Paris
1001 %if %{build_timezone}
1002 rm -f %{buildroot}%{_sysconfdir}/localtime
1003 cp -f %{buildroot}%{_datadir}/zoneinfo/US/Eastern %{buildroot}%{_sysconfdir}/localtime
1004 #ln -sf ..%{_datadir}/zoneinfo/US/Eastern %{buildroot}%{_sysconfdir}/localtime
1005 %endif
1006
1007 # [gg] build PDF documentation
1008 %if %{build_pdf_doc}
1009 (cd manual; texi2dvi -p -t @afourpaper -t @finalout libc.texinfo)
1010 %endif
1011
1012 # Leave a compatibility symlink for the dynamic loader on armhfp targets,
1013 # at least until the world gets rebuilt
1014 %ifarch armv7hl
1015 ln -sf %{_slibdir}/ld-linux-armhf.so.3 %{buildroot}%{_slibdir}/ld-linux.so.3
1016 %endif
1017
1018 # Generate final rpm filelist, with localized libc.mo files
1019 rm -f rpm.filelist
1020 %if "%{name}" == "glibc"
1021 %find_lang libc
1022 perl -ne '/^\s*$/ or print' libc.lang > rpm.filelist
1023 %endif
1024 cat extralibs.filelist >> rpm.filelist
1025
1026 # Remove unpackaged files
1027 rm -f %{buildroot}%{_infodir}/dir.old*
1028 rm -rf %{buildroot}%{_includedir}/asm-*/mach-*/
1029 rm -f %{buildroot}%{_datadir}/locale/locale-archive*
1030 rm -f %{buildroot}%{_var}/db/Makefile
1031
1032 %if !%{build_utils}
1033 %if %{build_biarch}
1034 rm -f %{buildroot}%{_slibdir32}/libmemusage.so
1035 rm -f %{buildroot}%{_slibdir32}/libpcprofile.so
1036 %endif
1037 rm -f %{buildroot}%{_slibdir}/libmemusage.so
1038 rm -f %{buildroot}%{_slibdir}/libpcprofile.so
1039 rm -f %{buildroot}%{_bindir}/memusage
1040 rm -f %{buildroot}%{_bindir}/memusagestat
1041 rm -f %{buildroot}%{_bindir}/mtrace
1042 rm -f %{buildroot}%{_bindir}/pcprofiledump
1043 rm -f %{buildroot}%{_bindir}/xtrace
1044 %endif
1045
1046 %if !%{build_timezone}
1047 rm -f %{buildroot}%{_sysconfdir}/localtime
1048 rm -f %{buildroot}%{_bindir}/zdump
1049 rm -f %{buildroot}%{_sbindir}/zic
1050 rm -rf %{buildroot}%{_datadir}/zoneinfo
1051 %endif
1052
1053 %if !%{build_i18ndata}
1054 rm -rf %{buildroot}%{_datadir}/i18n
1055 %endif
1056
1057 %if "%{name}" != "glibc"
1058 rm -rf %{buildroot}/boot
1059 rm -rf %{buildroot}/sbin
1060 rm -rf %{buildroot}/usr/share
1061 rm -rf %{buildroot}%{_bindir}
1062 rm -rf %{buildroot}%{_sbindir}
1063 rm -rf %{buildroot}%{_datadir}
1064 rm -rf %{buildroot}%{_infodir}
1065 rm -rf %{buildroot}%{_prefix}/etc
1066 rm -rf %{buildroot}%{_libdir}/gconv
1067 %endif
1068
1069 # In case we are cross-compiling, don't bother to remake symlinks and
1070 # fool spec-helper when stripping files
1071 %if "%{name}" != "glibc"
1072 export DONT_SYMLINK_LIBS=1
1073 export PATH=%{_bindir}:$PATH
1074 %endif
1075
1076 # This will make the '-g' argument to be passed to eu-strip for these
1077 # libraries, so that only debug symbols are stripped and gdb/valgrind continue
1078 # to work without needing glibc-debug package to be installed.
1079 export EXCLUDE_FROM_FULL_STRIP="ld-%{glibcversion}.so libpthread libc-%{glibcversion}.so"
1080
1081 # If we are building a debug package then copy all of the static archives
1082 # into the debug directory to keep them as unstripped copies.
1083 %if %{build_debug}
1084 mkdir -p %{buildroot}%{_prefix}/lib/debug%{_libdir}
1085 cp -a %{buildroot}%{_libdir}/*.a \
1086 %{buildroot}%{_prefix}/lib/debug%{_libdir}/
1087 rm -f %{buildroot}%{_prefix}/lib/debug%{_libdir}/*_p.a
1088 %endif
1089 # Strip all of the installed object files.
1090 strip -g %{buildroot}%{_libdir}/*.o
1091
1092 find_debuginfo_args='--strict-build-id -g -i'
1093 /usr/bin/find-debuginfo.sh $find_debuginfo_args -o debuginfo.filelist
1094
1095 # List all of the *.a archives in the debug directory.
1096 list_debug_archives()
1097 {
1098 local dir=%{_prefix}/lib/debug%{_libdir}
1099 find %{buildroot}$dir -name "*.a" -printf "$dir/%%P\n"
1100 }
1101
1102 # Remove some common directories from the common package debuginfo so that we
1103 # don't end up owning them.
1104 exclude_common_dirs()
1105 {
1106 exclude_dirs="%{_prefix}/src/debug"
1107 exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug{,/%{_lib},/bin,/sbin})"
1108 exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug%{_prefix}{,/%{_lib},/libexec,/bin,/sbin})"
1109
1110 for d in $(echo $exclude_dirs | sed 's/ /\n/g'); do
1111 sed -i "\|^%%dir $d/\?$|d" $1
1112 done
1113 }
1114
1115 exclude_common_dirs debuginfo.filelist
1116
1117 # remove debug source dir
1118 sed -i 's/\%{_prefix}\/src\/debug\/%{name}-%{version}//' debuginfo.filelist
1119
1120 %if "%{name}" == "glibc"
1121
1122 %post -p %{_sbindir}/glibc-post-wrapper
1123
1124 # automatic ldconfig cache update on rpm installs/removals
1125 # (see http://www.rpm.org/wiki/FileTriggers)
1126 # FIXME: port to lua to remove circular dependency with grep
1127 %transfiletriggerin -p %{ash_bin} -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64
1128 ldconfig -X
1129
1130 %transfiletriggerin -p %{ash_bin} -P 2000000 -- /etc/ld.so.conf.d/
1131 ldconfig -X
1132
1133 %transfiletriggerpostun -p %{ash_bin} -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64
1134 ldconfig -X
1135
1136 %endif
1137
1138 %if %{build_nscd}
1139 %pre -n nscd
1140 %_pre_useradd nscd / /bin/false
1141
1142 %post -n nscd
1143 %_tmpfilescreate nscd
1144 %_post_service nscd
1145
1146 %preun -n nscd
1147 %_preun_service nscd
1148
1149 %postun -n nscd
1150 %_postun_userdel nscd
1151
1152 if [ "$1" -ge "1" ]; then
1153 /sbin/service nscd condrestart > /dev/null 2>&1 || :
1154 fi
1155 %endif
1156
1157 #
1158 # glibc
1159 #
1160 %files -f rpm.filelist
1161 %if "%{name}" == "glibc"
1162 %if %{build_timezone}
1163 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/localtime
1164 %endif
1165 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/nsswitch.conf
1166 %verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ld.so.conf
1167 %dir %{_sysconfdir}/ld.so.conf.d
1168 %config(noreplace) %{_sysconfdir}/rpc
1169 #doc nis/nss
1170 %doc posix/gai.conf
1171 %{_datadir}/locale/locale.alias
1172 /sbin/sln
1173 %dir %{_prefix}/libexec/getconf
1174 %{_prefix}/libexec/getconf/*
1175 %endif
1176 %{_slibdir}/ld-%{glibcversion}.so
1177 %if %isarch i386
1178 %{_slibdir}/ld-linux.so.2
1179 %endif
1180 %if %isarch %arm
1181 %if %isarch armv7hl
1182 %{_slibdir}/ld-linux-armhf.so.3
1183 %endif
1184 %{_slibdir}/ld-linux.so.3
1185 %endif
1186 %if %isarch x86_64
1187 %{_slibdir}/ld-linux-x86-64.so.2
1188 %endif
1189 %if %isarch aarch64
1190 %{_slibdir}/ld-linux-aarch64.so.1
1191 %endif
1192 %{_slibdir}/lib*-[.0-9]*.so
1193 %{_slibdir}/lib*.so.[0-9]*
1194 %{_slibdir}/libSegFault.so
1195 %if "%{name}" == "glibc"
1196 %dir %{_libdir}/audit
1197 %{_libdir}/audit/sotruss-lib.so
1198 %dir %{_libdir}/gconv
1199 %{_libdir}/gconv/*.so
1200 %{_libdir}/gconv/gconv-modules
1201 %ghost %{_libdir}/gconv/gconv-modules.cache
1202 %{_bindir}/catchsegv
1203 %{_bindir}/gencat
1204 %{_bindir}/getconf
1205 %{_bindir}/getent
1206 %{_bindir}/iconv
1207 %{_bindir}/ldd
1208 %if %isarch i386
1209 %{_bindir}/lddlibc4
1210 %endif
1211 %{_bindir}/locale
1212 %{_bindir}/localedef
1213 %{_bindir}/makedb
1214 %{_bindir}/pldd
1215 %{_bindir}/sotruss
1216 %{_bindir}/sprof
1217 %{_bindir}/tzselect
1218 %{_sbindir}/iconvconfig
1219 %{_sbindir}/glibc-post-wrapper
1220 %endif
1221
1222 %if %isarch aarch64
1223 %{_slibdir32}/ld-linux-aarch64.so.1
1224 %endif
1225
1226 %if %{build_biarch}
1227 %{_slibdir32}/ld-%{glibcversion}.so
1228 %{_slibdir32}/ld-linux*.so.2
1229 %{_slibdir32}/lib*-[.0-9]*.so
1230 %{_slibdir32}/lib*.so.[0-9]*
1231 %{_slibdir32}/libSegFault.so
1232 %dir %{_prefix}/lib/audit
1233 %{_prefix}/lib/audit/sotruss-lib.so
1234 %dir %{_prefix}/lib/gconv
1235 %{_prefix}/lib/gconv/*
1236 %endif
1237
1238 #
1239 # ldconfig
1240 #
1241 %if "%{name}" == "glibc"
1242 /sbin/ldconfig
1243 %ghost %{_sysconfdir}/ld.so.cache
1244 %dir %{_var}/cache/ldconfig
1245 %ghost %{_var}/cache/ldconfig/aux-cache
1246 %endif
1247
1248 #
1249 # glibc-devel
1250 #
1251 %files devel -f devel.filelist
1252 %doc README NEWS INSTALL
1253 # (tmb) FIXME, figure out rpm doc breakage/change
1254 #doc COPYING COPYING.LIB
1255 #doc documentation/*
1256 #doc hesiod/README.hesiod
1257 #doc crypt/README.ufc-crypt
1258 %{_libdir}/libc_nonshared.a
1259 %{_libdir}/libg.a
1260 %{_libdir}/libmcheck.a
1261 %if %isarch x86_64
1262 %{_libdir}/libm-%{glibcversion}.a
1263 %{_libdir}/libmvec.a
1264 %endif
1265
1266 %if %{build_biarch}
1267 %{_prefix}/lib/libc_nonshared.a
1268 %{_prefix}/lib/libg.a
1269 %{_prefix}/lib/libmcheck.a
1270 %endif
1271
1272 #
1273 # glibc-static-devel
1274 #
1275 %files static-devel
1276 %doc COPYING COPYING.LIB
1277 %{_libdir}/libBrokenLocale.a
1278 %{_libdir}/libanl.a
1279 %{_libdir}/libc.a
1280 %{_libdir}/libdl.a
1281 %{_libdir}/libm.a
1282 %{_libdir}/libpthread.a
1283 %{_libdir}/libresolv.a
1284 %{_libdir}/librt.a
1285 %{_libdir}/libutil.a
1286
1287 %if %{build_biarch}
1288 %{_prefix}/lib/libBrokenLocale.a
1289 %{_prefix}/lib/libanl.a
1290 %{_prefix}/lib/libc.a
1291 %{_prefix}/lib/libdl.a
1292 %{_prefix}/lib/libm.a
1293 %{_prefix}/lib/libpthread.a
1294 %{_prefix}/lib/libresolv.a
1295 %{_prefix}/lib/librt.a
1296 %{_prefix}/lib/libutil.a
1297 %endif
1298
1299 #
1300 # glibc-doc
1301 #
1302 %if %{build_doc}
1303 %files doc
1304 %{_infodir}/libc.info*
1305 %endif
1306
1307 #
1308 # glibc-doc-pdf
1309 #
1310 %if %{build_pdf_doc}
1311 %files doc-pdf
1312 %doc manual/libc.pdf
1313 %endif
1314
1315 #
1316 # glibc-profile
1317 #
1318 %if %{build_profile}
1319 %files profile
1320 %{_libdir}/lib*_p.a
1321 %if %{build_biarch}
1322 %{_prefix}/lib/lib*_p.a
1323 %endif
1324 %endif
1325
1326 #
1327 # glibc-utils
1328 #
1329 %if %{build_utils}
1330 %files utils
1331 %if %{build_biarch}
1332 %{_slibdir32}/libmemusage.so
1333 %{_slibdir32}/libpcprofile.so
1334 %endif
1335 %{_slibdir}/libmemusage.so
1336 %{_slibdir}/libpcprofile.so
1337 %{_bindir}/memusage
1338 %{_bindir}/memusagestat
1339 %{_bindir}/mtrace
1340 %{_bindir}/pcprofiledump
1341 %{_bindir}/xtrace
1342 %endif
1343
1344 #
1345 # nscd
1346 #
1347 %if %{build_nscd}
1348 %files -n nscd
1349 %config(noreplace) %{_sysconfdir}/nscd.conf
1350 %{_sbindir}/nscd
1351 %{_unitdir}/nscd.service
1352 %{_unitdir}/nscd.socket
1353 %{_tmpfilesdir}/nscd.conf
1354 %dir %{_var}/db/nscd
1355 %endif
1356
1357 #
1358 # timezone
1359 #
1360 %if %{build_timezone}
1361 %files -n timezone
1362 %{_sbindir}/zdump
1363 %{_sbindir}/zic
1364 %dir %{_datadir}/zoneinfo
1365 %{_datadir}/zoneinfo/*
1366 %endif
1367
1368 #
1369 # glibc-i18ndata
1370 #
1371 %if %{build_i18ndata}
1372 %files i18ndata
1373 %dir %{_datadir}/i18n
1374 %dir %{_datadir}/i18n/charmaps
1375 %{_datadir}/i18n/charmaps/*
1376 %dir %{_datadir}/i18n/locales
1377 %{_datadir}/i18n/locales/*
1378 %{_datadir}/i18n/SUPPORTED
1379 %endif
1380
1381 %if %{build_debug}
1382 %files debuginfo -f debuginfo.filelist
1383
1384 %files debugsource
1385 %dir %{_prefix}/src/debug/%{name}-%{version}
1386 %{_prefix}/src/debug/%{name}-%{version}/*
1387 %endif

  ViewVC Help
Powered by ViewVC 1.1.30