1 |
# <epoch>:<version>-<release> tags for glibc main package |
2 |
%define glibcversion 2.31 |
3 |
%define __glibcrelease 9 |
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 |
# Define to bootstrap new glibc |
85 |
%define build_bootstrap 0 |
86 |
%{expand: %{!?build_cross_bootstrap: %global build_cross_bootstrap 0}} |
87 |
|
88 |
%define build_profile 1 |
89 |
%define build_nscd 1 |
90 |
%define build_doc 1 |
91 |
%define build_utils 1 |
92 |
%define build_i18ndata 1 |
93 |
%define build_timezone 0 |
94 |
|
95 |
# Disable a few defaults when cross-compiling a glibc |
96 |
%if %{build_cross} |
97 |
%define build_doc 0 |
98 |
%define build_pdf_doc 0 |
99 |
%define build_biarch 0 |
100 |
%define build_check 0 |
101 |
%define build_nscd 0 |
102 |
%define build_profile 0 |
103 |
%define build_utils 0 |
104 |
%define build_i18ndata 0 |
105 |
%define build_timezone 0 |
106 |
%endif |
107 |
|
108 |
# Allow --with[out] <feature> at rpm command line build |
109 |
%{expand: %{?_without_PDF: %%global build_pdf_doc 0}} |
110 |
%{expand: %{?_without_CHECK: %%global build_check 0}} |
111 |
%{expand: %{?_without_UTILS: %%global build_utils 0}} |
112 |
%{expand: %{?_without_BOOTSTRAP:%%global build_bootstrap 0}} |
113 |
%{expand: %{?_with_PDF: %%global build_pdf_doc 1}} |
114 |
%{expand: %{?_with_CHECK: %%global build_check 1}} |
115 |
%{expand: %{?_with_UTILS: %%global build_utils 1}} |
116 |
%{expand: %{?_with_BOOTSTRAP: %%global build_bootstrap 1}} |
117 |
|
118 |
Summary: The GNU libc libraries |
119 |
Name: %{cross_prefix}glibc |
120 |
Version: %{glibcversion} |
121 |
Release: %{glibcrelease} |
122 |
Epoch: %{glibcepoch} |
123 |
License: LGPL |
124 |
Group: System/Libraries |
125 |
Url: https://www.gnu.org/software/libc/ |
126 |
|
127 |
# FSF source |
128 |
Source0: https://ftpmirror.gnu.org/libc/%{source_package}.tar.xz |
129 |
Source1: https://ftpmirror.gnu.org/libc/%{source_package}.tar.xz.sig |
130 |
Source2: glibc-git.sh |
131 |
|
132 |
Source4: glibc-find-requires.sh |
133 |
Source5: glibc-check.sh |
134 |
Source6: nscd.service |
135 |
Source7: nscd.socket |
136 |
Source8: nsswitch.conf |
137 |
Source9: nscd.conf |
138 |
|
139 |
# wrapper to avoid rpm circular dependencies |
140 |
Source14: glibc-post-wrapper.c |
141 |
|
142 |
%if %{build_cross} |
143 |
Autoreq: false |
144 |
Autoprov: false |
145 |
%else |
146 |
Provides: should-restart = system |
147 |
%if %isarch %{xenarches} |
148 |
Obsoletes: %{name}-xen |
149 |
Provides: %{name}-xen |
150 |
%endif |
151 |
# The dynamic linker supports DT_GNU_HASH |
152 |
Provides: rtld(GNU_HASH) |
153 |
Autoreq: false |
154 |
%endif |
155 |
BuildRequires: bison >= 3.3.1-1 |
156 |
BuildRequires: patch |
157 |
BuildRequires: gettext |
158 |
BuildRequires: perl |
159 |
BuildRequires: kernel-userspace-headers |
160 |
BuildRequires: libstdc++-static-devel |
161 |
BuildRequires: hardlink |
162 |
%if %{build_selinux} |
163 |
BuildRequires: pkgconfig(libselinux) >= 1.17.10 |
164 |
%endif |
165 |
# (tmb) force new gcc 10.1 |
166 |
BuildRequires: %{cross_prefix}gcc >= 10.1.0-1 |
167 |
# (tmb) force latest binutils for aarch64 STO_AARCH64_VARIANT_PCS |
168 |
BuildRequires: %{cross_prefix}binutils >= 1:2.34-10 |
169 |
# we need the static dash |
170 |
%define ash_bin /usr/bin/dash.static |
171 |
Requires(post): dash-static |
172 |
Requires(post): grep |
173 |
Requires: filesystem >= 2.1.9-18 |
174 |
# ensure libxcrypt is installed as glibc crypt is disabled / being obsoleted |
175 |
Requires: %{_lib}xcrypt1 >= 4.1.1-1 |
176 |
|
177 |
BuildRequires: systemtap-sdt-devel |
178 |
|
179 |
BuildRequires: texinfo |
180 |
BuildRequires: texinfo-tex |
181 |
%if %{build_pdf_doc} |
182 |
BuildRequires: texlive |
183 |
%endif |
184 |
%if %{build_utils} |
185 |
BuildRequires: pkgconfig(gdlib) |
186 |
%endif |
187 |
BuildRequires: autoconf2.5 |
188 |
BuildRequires: pkgconfig(libcap) |
189 |
BuildRequires: rpm-mageia-setup-build >= 1.147 |
190 |
BuildRequires: spec-helper >= 0.31.2 |
191 |
|
192 |
### |
193 |
### upstream release/2.31/master branch |
194 |
### git format-patch --start-number 200 glibc-2.31..origin/release/2.31/master |
195 |
### |
196 |
Patch200: 0200-mips-Use-long-int-and-long-long-int-in-linux-syscall.patch |
197 |
Patch201: 0201-mips-Fix-argument-passing-for-inlined-syscalls-on-Li.patch |
198 |
Patch202: 0202-microblaze-Avoid-clobbering-register-parameters-in-s.patch |
199 |
Patch203: 0203-riscv-Avoid-clobbering-register-parameters-in-syscal.patch |
200 |
Patch204: 0204-malloc-tst-mallocfork2-Kill-lingering-process-for-un.patch |
201 |
# CVE-2020-10029 |
202 |
Patch205: 0205-Avoid-ldbl-96-stack-corruption-from-range-reduction-.patch |
203 |
Patch206: 0206-Improve-IFUNC-check-BZ-25506.patch |
204 |
Patch207: 0207-i386-Use-comdat-instead-of-.gnu.linkonce-for-i386-se.patch |
205 |
Patch208: 0208-linux-Clear-mode_t-padding-bits-BZ-25623.patch |
206 |
Patch209: 0209-linux-sysipc-Include-linux-posix_types.h-for-__kerne.patch |
207 |
Patch210: 0210-arm-Fix-softp-fp-Implies-BZ-25635.patch |
208 |
Patch211: 0211-sparc-Move-sigreturn-stub-to-assembly.patch |
209 |
Patch212: 0212-math-test-sinl-pseudo-Use-stack-protector-only-if-av.patch |
210 |
Patch213: 0213-Add-NEWS-entry-for-CVE-2020-10029-bug-25487.patch |
211 |
Patch214: 0214-NEWS-update-list-of-bugs-fixed-on-the-2.31-branch.patch |
212 |
Patch215: 0215-Update-syscall-lists-for-Linux-5.5.patch |
213 |
Patch216: 0216-Fix-use-after-free-in-glob-when-expanding-user-bug-2.patch |
214 |
Patch217: 0217-Add-NEWS-entry-for-CVE-2020-1752-bug-25414.patch |
215 |
Patch218: 0218-posix-Fix-system-error-return-value-BZ-25715.patch |
216 |
Patch219: 0219-Add-NEWS-entry-for-CVE-2020-1751-bug-25423.patch |
217 |
Patch220: 0220-support-shell-container.c-Return-127-if-execve-fails.patch |
218 |
Patch221: 0221-support-shell-container.c-Add-builtin-exit.patch |
219 |
Patch222: 0222-support-shell-container.c-Add-builtin-kill.patch |
220 |
Patch223: 0223-stdlib-Move-tst-system-to-tests-container.patch |
221 |
Patch224: 0224-mips-Fix-bracktrace-result-for-signal-frames.patch |
222 |
Patch225: 0225-nios2-delete-sysdeps-unix-sysv-linux-nios2-kernel-fe.patch |
223 |
Patch226: 0226-Fix-data-race-in-setting-function-descriptors-during.patch |
224 |
Patch227: 0227-Add-new-file-missed-in-previous-hppa-commit.patch |
225 |
Patch228: 0228-Fix-build-with-GCC-10-when-long-double-double.patch |
226 |
Patch229: 0229-x32-Properly-pass-long-to-syscall-BZ-25810.patch |
227 |
Patch230: 0230-Add-SYSCALL_ULONG_ARG_-12-to-pass-long-to-syscall-BZ.patch |
228 |
Patch231: 0231-Add-a-syscall-test-for-BZ-25810.patch |
229 |
Patch232: 0232-Mark-unsigned-long-arguments-with-U-in-more-syscalls.patch |
230 |
Patch233: 0233-Add-C-wrappers-for-process_vm_readv-process_vm_write.patch |
231 |
Patch234: 0234-powerpc-Rename-argN-to-_argN-in-LOADARGS_N-BZ-25902.patch |
232 |
Patch235: 0235-Add-a-C-wrapper-for-prctl-BZ-25896.patch |
233 |
Patch236: 0236-oc_FR-locale-Fix-spelling-of-Thursday-bug-25639.patch |
234 |
Patch237: 0237-oc_FR-locale-Fix-spelling-of-April-bug-25639.patch |
235 |
Patch238: 0238-NEWS-Mention-bug-25639-fixed-in-2.31-branch.patch |
236 |
Patch239: 0239-x86-64-Use-RDX_LP-on-__x86_shared_non_temporal_thres.patch |
237 |
Patch240: 0240-NEWS-Mention-fixes-for-BZ-25810-25896-25902-25966.patch |
238 |
Patch241: 0241-aarch64-Accept-PLT-calls-to-__getauxval-within-libc..patch |
239 |
|
240 |
### |
241 |
### upstream master branch |
242 |
### starts from number 300 |
243 |
### |
244 |
Patch300: 0300-Convert-Python-scripts-to-Python-3.patch |
245 |
Patch301: 0301-AArch64-Improve-integer-memcpy.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 |
# (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 |
############################################################################## |
467 |
# glibc core "debuginfo" sub-package |
468 |
############################################################################## |
469 |
%if 0%{?_enable_debug_packages} |
470 |
%define debug_package %{nil} |
471 |
%define __debug_install_post %{nil} |
472 |
%global __debug_package 1 |
473 |
# Disable thew new features that glibc packages don't use. |
474 |
%undefine _debugsource_packages |
475 |
%undefine _debuginfo_subpackages |
476 |
%undefine _unique_debug_names |
477 |
%undefine _unique_debug_srcs |
478 |
|
479 |
%package debuginfo |
480 |
Summary: Debug information for package %{name} |
481 |
Group: Development/Debug |
482 |
AutoReqProv: no |
483 |
|
484 |
%description debuginfo |
485 |
This package provides debug information for %{name} |
486 |
%endif |
487 |
|
488 |
%package doc |
489 |
Summary: GNU C library documentation |
490 |
Group: Development/Other |
491 |
BuildArch: noarch |
492 |
|
493 |
%description doc |
494 |
The glibc-doc package contains documentation for the GNU C library in |
495 |
info format. |
496 |
|
497 |
%if %{build_pdf_doc} |
498 |
%package doc-pdf |
499 |
Summary: GNU C library documentation |
500 |
Group: Development/Other |
501 |
BuildArch: noarch |
502 |
|
503 |
%description doc-pdf |
504 |
The glibc-doc-pdf package contains the printable documentation for the |
505 |
GNU C library in PDF format. |
506 |
%endif |
507 |
|
508 |
%prep |
509 |
%setup -q -n %{source_dir} |
510 |
%autopatch -p1 |
511 |
|
512 |
%if %{build_selinux} |
513 |
# XXX kludge to build nscd with selinux support as it added -nostdinc |
514 |
# so /usr/include/selinux is not found |
515 |
ln -s %{_includedir}/selinux selinux |
516 |
%endif |
517 |
|
518 |
find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \; |
519 |
|
520 |
# \\(Anssi 03/2008\\) FIXME: use __provides_exclude |
521 |
cat > find_provides.sh << EOF |
522 |
#!/bin/sh |
523 |
%{rpmscripts}/find-provides | grep -v GLIBC_PRIVATE |
524 |
exit 0 |
525 |
EOF |
526 |
chmod +x find_provides.sh |
527 |
|
528 |
cat > find_requires.bootstrap.sh << EOF |
529 |
/bin/sh %{SOURCE4} %{buildroot} %{_target_cpu} | grep -v "\(GLIBC_PRIVATE\|linux-gate\|linux-vdso\)" |
530 |
exit 0 |
531 |
EOF |
532 |
chmod +x find_requires.bootstrap.sh |
533 |
|
534 |
# XXX: use better way later to avoid LD_LIBRARY_PATH issue |
535 |
cat %{rpmscripts}/find-requires | sed '/.*LD_LIBRARY_PATH.*/d;' > find_requires |
536 |
chmod +x find_requires |
537 |
# \\(Anssi 03/2008\\) FIXME: use __requires_exclude |
538 |
cat > find_requires.noprivate.sh << EOF |
539 |
%{_builddir}/%{source_dir}/find_requires %{buildroot} %{_target_cpu} | \ |
540 |
grep -v GLIBC_PRIVATE |
541 |
exit 0 |
542 |
EOF |
543 |
chmod +x find_requires.noprivate.sh |
544 |
|
545 |
# FIXME: fix system rpm find-requires to use the prefix cross version |
546 |
%if %{build_bootstrap} || "%{_target_cpu}" != "%{target_cpu}" |
547 |
ln -s find_requires.bootstrap.sh find_requires.sh |
548 |
%else |
549 |
ln -s find_requires.noprivate.sh find_requires.sh |
550 |
%endif |
551 |
|
552 |
# Remove patch backups from files we ship in glibc packages |
553 |
rm -fr ChangeLog.old |
554 |
rm -f localedata/locales/{???_??,??_??}.* |
555 |
rm -f localedata/locales/[a-z_]*.* |
556 |
|
557 |
%build |
558 |
# Prepare test matrix in the next function |
559 |
CheckList=$PWD/Check.list |
560 |
rm -f $CheckList |
561 |
touch $CheckList |
562 |
|
563 |
# |
564 |
# CompareKver <kernel version> |
565 |
# function to compare the desired kernel version with running kernel |
566 |
# version (package releases not taken into account in comparison). The |
567 |
# function returns: |
568 |
# -1 = <kernel version> is lesser than current running kernel |
569 |
# 0 = <kernel version> is equal to the current running kernel |
570 |
# 1 = <kernel version> is greater than current running kernel |
571 |
# |
572 |
function CompareKver() { |
573 |
v1=`echo $1 | sed 's/\.\?$/./'` |
574 |
v2=`uname -r | sed 's/[^.0-9].*//' | sed 's/\.\?$/./'` |
575 |
n=1 |
576 |
s=0 |
577 |
while true; do |
578 |
c1=`echo "$v1" | cut -d "." -f $n` |
579 |
c2=`echo "$v2" | cut -d "." -f $n` |
580 |
if [ -z "$c1" -a -z "$c2" ]; then |
581 |
break |
582 |
elif [ -z "$c1" ]; then |
583 |
s=-1 |
584 |
break |
585 |
elif [ -z "$c2" ]; then |
586 |
s=1 |
587 |
break |
588 |
elif [ "$c1" -gt "$c2" ]; then |
589 |
s=1 |
590 |
break |
591 |
elif [ "$c2" -gt "$c1" ]; then |
592 |
s=-1 |
593 |
break |
594 |
fi |
595 |
n=$((n + 1)) |
596 |
done |
597 |
echo $s |
598 |
} |
599 |
|
600 |
# |
601 |
# BuildGlibc <arch> [<extra_configure_options>+] |
602 |
# |
603 |
function BuildGlibc() { |
604 |
arch="$1" |
605 |
shift 1 |
606 |
|
607 |
# PowerPC CPU add-on |
608 |
case $arch in |
609 |
cpu-addon,*) |
610 |
cpu=` echo "$arch" | sed -n "/.*,\([^,]*\),.*$/s//\1/p"` |
611 |
arch=`echo "$arch" | sed -n "/.*,.*,\([^,]*\)$/s//\1/p"` |
612 |
;; |
613 |
*) |
614 |
cpu=$arch |
615 |
;; |
616 |
esac |
617 |
|
618 |
# Select optimization flags and compiler to use |
619 |
BuildAltArch="no" |
620 |
BuildCompFlags="" |
621 |
BuildFlags="" |
622 |
case $arch in |
623 |
i[3456]86 | athlon) |
624 |
BuildFlags="-march=$arch -mtune=generic" |
625 |
if [[ "`uname -m`" = "x86_64" ]]; then |
626 |
BuildAltArch="yes" |
627 |
BuildCompFlags="-m32" |
628 |
fi |
629 |
;; |
630 |
x86_64) |
631 |
BuildFlags="-mtune=generic" |
632 |
;; |
633 |
armv4t*) |
634 |
BuildFlags="-march=armv4t" |
635 |
BuildCompFlags="-march=armv4t" |
636 |
;; |
637 |
armv5t*) |
638 |
BuildFlags="-march=armv5t" |
639 |
BuildCompFlags="-march=armv5t" |
640 |
;; |
641 |
# to check |
642 |
armv7h*) |
643 |
BuildFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16" |
644 |
BuildCompFlags="-march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16" |
645 |
;; |
646 |
esac |
647 |
|
648 |
# Choose multiarch support |
649 |
MultiArchFlags= |
650 |
case $arch in |
651 |
i686 | x86_64) |
652 |
MultiArchFlags="--enable-multi-arch" |
653 |
;; |
654 |
esac |
655 |
|
656 |
# Determine C & C++ compilers |
657 |
BuildCC="%{__cc} $BuildCompFlags" |
658 |
BuildCXX="%{__cxx} $BuildCompFlags" |
659 |
|
660 |
# Are we supposed to cross-compile? |
661 |
if [[ "%{target_cpu}" != "%{_target_cpu}" ]]; then |
662 |
# Can't use BuildCC anymore with previous changes. |
663 |
BuildCC="%{cross_program_prefix}gcc $BuildCompFlags" |
664 |
BuildCXX="%{cross_program_prefix}g++ $BuildCompFlags" |
665 |
BuildCross="--build=%{_target_platform}" |
666 |
export libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes |
667 |
fi |
668 |
|
669 |
BuildFlags="$BuildFlags -DNDEBUG=1 -O2 -finline-functions -g" |
670 |
|
671 |
# Do not use direct references against %gs when accessing tls data |
672 |
# XXX make it the default in GCC? (for other non glibc specific usage) |
673 |
case $arch in |
674 |
i[3456]86 | x86_64) |
675 |
BuildFlags="$BuildFlags -mno-tls-direct-seg-refs" |
676 |
;; |
677 |
esac |
678 |
|
679 |
# Arch specific compilation flags |
680 |
if [[ "$arch" = "ppc64" ]]; then |
681 |
BuildFlags="$BuildFlags -fno-inline-functions -mno-minimal-toc" |
682 |
fi |
683 |
|
684 |
# Extra configure flags |
685 |
ExtraFlags= |
686 |
if [[ "%{build_profile}" != "0" ]]; then |
687 |
ExtraFlags="$ExtraFlags --enable-profile" |
688 |
fi |
689 |
|
690 |
# NPTL+TLS are now the default |
691 |
# check for other arches |
692 |
%if %isarch %ports_arch |
693 |
Pthreads="ports nptl" |
694 |
%else |
695 |
Pthreads="nptl" |
696 |
%endif |
697 |
|
698 |
# Add-ons |
699 |
AddOns="libidn" |
700 |
if [[ "$cpu" != "$arch" ]]; then |
701 |
AddOns="$AddOns,powerpc-cpu" |
702 |
BuildFlags="$BuildFlags -mcpu=$cpu" |
703 |
ExtraFlags="$ExtraFlags --with-cpu=$cpu" |
704 |
fi |
705 |
|
706 |
# Build with selinux support? |
707 |
%if %{build_selinux} |
708 |
SElinuxFlags="--with-selinux" |
709 |
%else |
710 |
SElinuxFlags="--without-selinux" |
711 |
%endif |
712 |
|
713 |
# Kernel headers directory |
714 |
KernelHeaders=%{_includedir} |
715 |
|
716 |
# Determine library name |
717 |
glibc_cv_cc_64bit_output=no |
718 |
if echo ".text" | $BuildCC -c -o test.o -xassembler -; then |
719 |
case `/usr/bin/file test.o` in |
720 |
*"ELF 64"*) |
721 |
glibc_cv_cc_64bit_output=yes |
722 |
;; |
723 |
esac |
724 |
fi |
725 |
rm -f test.o |
726 |
|
727 |
# Force a separate and clean object dir |
728 |
rm -rf build-$cpu-linux |
729 |
mkdir build-$cpu-linux |
730 |
pushd build-$cpu-linux |
731 |
[[ "$BuildAltArch" = "yes" ]] && touch ".alt" || touch ".main" |
732 |
CC="$BuildCC" CXX="$BuildCXX" CFLAGS="$BuildFlags -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -Wno-maybe-uninitialized" ../configure \ |
733 |
$arch-%{_real_vendor}-linux%{gnuext} $BuildCross \ |
734 |
--prefix=%{_prefix} \ |
735 |
--libexecdir=%{_prefix}/libexec \ |
736 |
--infodir=%{_infodir} \ |
737 |
--enable-add-ons="$AddOns" --without-cvs \ |
738 |
$ExtraFlags $MultiArchFlags $SElinuxFlags \ |
739 |
--enable-kernel=%{enablekernel} \ |
740 |
--with-headers=$KernelHeaders ${1+"$@"} \ |
741 |
--enable-obsolete-rpc \ |
742 |
--enable-obsolete-nsl \ |
743 |
--enable-systemtap \ |
744 |
--disable-crypt |
745 |
%make_build -r -s |
746 |
popd |
747 |
|
748 |
# All tests are expected to pass on certain platforms, depending also |
749 |
# on the version of the kernel running |
750 |
case $arch in |
751 |
athlon | ia64 | ppc | ppc64) |
752 |
if [ "`CompareKver %{check_min_kver}`" -lt 0 ]; then |
753 |
check_flags="" |
754 |
else |
755 |
check_flags="-k" |
756 |
fi |
757 |
;; |
758 |
*) |
759 |
check_flags="-k" |
760 |
;; |
761 |
esac |
762 |
|
763 |
# Generate test matrix |
764 |
[[ -d "build-$arch-linux" ]] || { |
765 |
echo "ERROR: PrepareGlibcTest: build-$arch-linux does not exist!" |
766 |
return 1 |
767 |
} |
768 |
local BuildJobs="-j`getconf _NPROCESSORS_ONLN`" |
769 |
echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList |
770 |
|
771 |
case $cpu in |
772 |
i686|athlon) base_arch=i586;; |
773 |
power*) base_arch=$arch;; |
774 |
*) base_arch=none;; |
775 |
esac |
776 |
|
777 |
[[ -d "build-$base_arch-linux" ]] && { |
778 |
check_flags="$check_flags -l build-$base_arch-linux/elf/ld.so" |
779 |
echo "$BuildJobs -d build-$arch-linux $check_flags" >> $CheckList |
780 |
} |
781 |
return 0 |
782 |
} |
783 |
|
784 |
# Build main glibc |
785 |
BuildGlibc %{target_cpu} |
786 |
|
787 |
%if %{build_biarch} |
788 |
%if %isarch x86_64 |
789 |
BuildGlibc i686 |
790 |
%endif |
791 |
%endif |
792 |
|
793 |
# Build i686 libraries if not already building for i686/athlon |
794 |
case %{target_cpu} in |
795 |
i686 | athlon) |
796 |
;; |
797 |
i[3-6]86) |
798 |
# BuildGlibc i686 --disable-profile |
799 |
;; |
800 |
esac |
801 |
|
802 |
%if %{build_check} |
803 |
export TMPDIR=/tmp |
804 |
export TIMEOUTFACTOR=16 |
805 |
Check="$PWD/glibc-check.sh" |
806 |
cat %{SOURCE5} > $Check |
807 |
chmod +x $Check |
808 |
while read arglist; do |
809 |
$Check $arglist || exit 1 |
810 |
done < $CheckList |
811 |
%endif |
812 |
|
813 |
%install |
814 |
# force use of _NPROCESSORS_ONLN jobs since RPM_BUILD_NCPUS could be |
815 |
# greater for icecream |
816 |
BuildJobs="-j`getconf _NPROCESSORS_ONLN`" |
817 |
|
818 |
make install_root=$RPM_BUILD_ROOT install -C build-%{target_cpu}-linux |
819 |
%if %{build_i18ndata} |
820 |
(cd build-%{target_cpu}-linux; |
821 |
make $BuildJobs -C ../localedata objdir=`pwd` \ |
822 |
install_root=$RPM_BUILD_ROOT \ |
823 |
install-locales |
824 |
) |
825 |
install -m 0644 localedata/SUPPORTED $RPM_BUILD_ROOT/%{_datadir}/i18n/ |
826 |
%endif |
827 |
|
828 |
# Empty filelist for non i686/athlon targets |
829 |
> extralibs.filelist |
830 |
|
831 |
# Install biarch libraries |
832 |
%if %{build_biarch} |
833 |
%if %isarch x86_64 |
834 |
ALT_ARCHES=i686-linux |
835 |
%endif |
836 |
|
837 |
for ALT_ARCH in $ALT_ARCHES; do |
838 |
mkdir -p $RPM_BUILD_ROOT/$ALT_ARCH |
839 |
make install_root=$RPM_BUILD_ROOT/$ALT_ARCH install -C build-$ALT_ARCH |
840 |
|
841 |
# Dispatch */lib only |
842 |
LIB=/lib |
843 |
%if !%{build_cross} |
844 |
mv $RPM_BUILD_ROOT/$ALT_ARCH/$LIB $RPM_BUILD_ROOT/$LIB |
845 |
mv $RPM_BUILD_ROOT/$ALT_ARCH%{_prefix}/libexec/getconf/* \ |
846 |
$RPM_BUILD_ROOT%{_prefix}/libexec/getconf/ |
847 |
[ ! -d $RPM_BUILD_ROOT/%{_prefix}/$LIB/ ] && mkdir -p $RPM_BUILD_ROOT/%{_prefix}/$LIB/ |
848 |
mv $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/$LIB/* $RPM_BUILD_ROOT/%{_prefix}/$LIB/ |
849 |
%else |
850 |
mv $RPM_BUILD_ROOT/$ALT_ARCH/%{_prefix}/lib $RPM_BUILD_ROOT/$LIB |
851 |
sed -i $RPM_BUILD_ROOT/$LIB/libc.so -e "s!%{_slibdir}!$LIB!g" |
852 |
%endif |
853 |
|
854 |
rm -rf $RPM_BUILD_ROOT/$ALT_ARCH |
855 |
# XXX Dispatch 32-bit stubs |
856 |
(sed '/^@/d' include/stubs-prologue.h; LC_ALL=C sort $(find build-$ALT_ARCH -name stubs)) \ |
857 |
> $RPM_BUILD_ROOT%{_includedir}/gnu/stubs-32.h |
858 |
done |
859 |
%endif |
860 |
|
861 |
# Install extra glibc libraries |
862 |
function InstallGlibc() { |
863 |
local BuildDir="$1" |
864 |
local SubDir="$2" |
865 |
local LibDir="$3" |
866 |
|
867 |
case $BuildDir in |
868 |
*) Pthreads=nptl ;; |
869 |
esac |
870 |
|
871 |
[[ -z "$LibDir" ]] && LibDir="%{_slibdir}" |
872 |
|
873 |
pushd $BuildDir |
874 |
mkdir -p $RPM_BUILD_ROOT$LibDir/$SubDir/ |
875 |
install -m755 libc.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc-*.so` |
876 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libc-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libc.so.*` |
877 |
install -m755 math/libm.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm-*.so` |
878 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libm-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libm.so.*` |
879 |
install -m755 $Pthreads/libpthread.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so` |
880 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libpthread-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libpthread.so.*` |
881 |
install -m755 ${Pthreads}_db/libthread_db.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so` |
882 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/libthread_db-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/libthread_db.so.*` |
883 |
install -m755 rt/librt.so $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt-*.so` |
884 |
ln -sf `basename $RPM_BUILD_ROOT$LibDir/librt-*.so` $RPM_BUILD_ROOT$LibDir/$SubDir/`basename $RPM_BUILD_ROOT$LibDir/librt.so.*` |
885 |
echo "%dir $LibDir/$SubDir" >> ../extralibs.filelist |
886 |
find $RPM_BUILD_ROOT$LibDir/$SubDir -maxdepth 1 -type f -o -type l | sed -e "s|$RPM_BUILD_ROOT||" >> ../extralibs.filelist |
887 |
popd |
888 |
} |
889 |
|
890 |
# Install arch-specific optimized libraries |
891 |
%if %isarch %{ix86} |
892 |
case %{target_cpu} in |
893 |
i[3-5]86) |
894 |
# InstallGlibc build-i686-linux i686 |
895 |
;; |
896 |
esac |
897 |
%endif |
898 |
|
899 |
# Remove the files we don't want to distribute |
900 |
rm -f $RPM_BUILD_ROOT%{_libdir}/libNoVersion* |
901 |
rm -f $RPM_BUILD_ROOT%{_slibdir}/libNoVersion* |
902 |
|
903 |
%if "%{name}" == "glibc" |
904 |
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/nsswitch.conf |
905 |
%endif |
906 |
|
907 |
# This is for ncsd - in glibc 2.2 |
908 |
%if %{build_nscd} |
909 |
install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT%{_sysconfdir} |
910 |
install -d -m 755 %{buildroot}%{_unitdir} |
911 |
install -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/nscd.service |
912 |
install -m 644 %{SOURCE7} %{buildroot}%{_unitdir}/nscd.socket |
913 |
install -D -m 644 %{SOURCE9} %{buildroot}%{_tmpfilesdir}/nscd.conf |
914 |
install -d -m 755 %{buildroot}%{_var}/db/nscd |
915 |
%endif |
916 |
|
917 |
# Useless and takes place |
918 |
rm -rf %buildroot/%{_datadir}/zoneinfo/{posix,right} |
919 |
|
920 |
# Include ld.so.conf |
921 |
%if "%{name}" == "glibc" |
922 |
echo "include /etc/ld.so.conf.d/*.conf" > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf |
923 |
chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf |
924 |
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d |
925 |
|
926 |
# ldconfig cache |
927 |
mkdir -p $RPM_BUILD_ROOT%{_var}/cache/ldconfig |
928 |
touch $RPM_BUILD_ROOT%{_var}/cache/ldconfig/aux-cache |
929 |
%endif |
930 |
|
931 |
# Include %{_libdir}/gconv/gconv-modules.cache |
932 |
> $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache |
933 |
chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache |
934 |
|
935 |
%if "%{name}" == "glibc" |
936 |
touch $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.cache |
937 |
%endif |
938 |
|
939 |
# Are we cross-compiling? |
940 |
Strip="strip" |
941 |
if [[ "%{_target_cpu}" != "%{target_cpu}" ]]; then |
942 |
Strip="%{cross_program_prefix}$Strip" |
943 |
fi |
944 |
|
945 |
# Strip debugging info from all static libraries |
946 |
pushd $RPM_BUILD_ROOT%{_slibdir} |
947 |
for i in *.a; do |
948 |
if [ -f "$i" ]; then |
949 |
case "$i" in |
950 |
*_p.a) ;; |
951 |
*) $Strip -g -R .comment $i ;; |
952 |
esac |
953 |
fi |
954 |
done |
955 |
popd |
956 |
pushd $RPM_BUILD_ROOT%{_libdir} |
957 |
for i in libc_nonshared.a; do |
958 |
if [ -f "$i" ]; then |
959 |
$Strip -g -R .comment $i |
960 |
fi |
961 |
done |
962 |
popd |
963 |
|
964 |
# post install wrapper |
965 |
%__cc -Os -g %{SOURCE14} -static \ |
966 |
-o "$RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper" \ |
967 |
-L "$RPM_BUILD_ROOT%{_libdir}/" \ |
968 |
'-DSLIBDIR="%{_slibdir}"' \ |
969 |
'-DGCONV_DIR="%{_libdir}/gconv"' |
970 |
chmod 700 $RPM_BUILD_ROOT%{_sbindir}/glibc-post-wrapper |
971 |
|
972 |
# rquota.x and rquota.h are now provided by quota |
973 |
rm -f $RPM_BUILD_ROOT%{_includedir}/rpcsvc/rquota.[hx] |
974 |
|
975 |
# Hardlink identical locale files together |
976 |
%if %{build_i18ndata} |
977 |
%{_bindir}/hardlink -vc $RPM_BUILD_ROOT%{_datadir}/locale |
978 |
%endif |
979 |
|
980 |
rm -rf $RPM_BUILD_ROOT%{_includedir}/netatalk/ |
981 |
|
982 |
# Build file list for devel package |
983 |
find $RPM_BUILD_ROOT%{_includedir} -type f -or -type l > devel.filelist |
984 |
find $RPM_BUILD_ROOT%{_includedir} -type d | sed "s/^/%dir /" | \ |
985 |
grep -v "%{_libdir}/libnss1.*.so$" | \ |
986 |
grep -v "%{_includedir}$" | >> devel.filelist |
987 |
find $RPM_BUILD_ROOT%{_libdir} -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist |
988 |
# biarch libs |
989 |
%if %{build_biarch} |
990 |
find $RPM_BUILD_ROOT%{_prefix}/lib -maxdepth 1 -name "*.so" -o -name "*.o" | egrep -v "(libmemusage.so|libpcprofile.so)" >> devel.filelist |
991 |
%endif |
992 |
perl -pi -e "s|$RPM_BUILD_ROOT||" devel.filelist |
993 |
|
994 |
# /etc/localtime - we're proud of our timezone #Well we may put Paris |
995 |
%if %{build_timezone} |
996 |
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
997 |
cp -f $RPM_BUILD_ROOT%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
998 |
#ln -sf ..%{_datadir}/zoneinfo/US/Eastern $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
999 |
%endif |
1000 |
|
1001 |
# [gg] build PDF documentation |
1002 |
%if %{build_pdf_doc} |
1003 |
(cd manual; texi2dvi -p -t @afourpaper -t @finalout libc.texinfo) |
1004 |
%endif |
1005 |
|
1006 |
# Leave a compatibility symlink for the dynamic loader on armhfp targets, |
1007 |
# at least until the world gets rebuilt |
1008 |
%ifarch armv7hl |
1009 |
ln -sf %{_slibdir}/ld-linux-armhf.so.3 $RPM_BUILD_ROOT%{_slibdir}/ld-linux.so.3 |
1010 |
%endif |
1011 |
|
1012 |
# Generate final rpm filelist, with localized libc.mo files |
1013 |
rm -f rpm.filelist |
1014 |
%if "%{name}" == "glibc" |
1015 |
%find_lang libc |
1016 |
perl -ne '/^\s*$/ or print' libc.lang > rpm.filelist |
1017 |
%endif |
1018 |
cat extralibs.filelist >> rpm.filelist |
1019 |
|
1020 |
# Remove unpackaged files |
1021 |
rm -f $RPM_BUILD_ROOT%{_infodir}/dir.old* |
1022 |
rm -rf $RPM_BUILD_ROOT%{_includedir}/asm-*/mach-*/ |
1023 |
rm -f $RPM_BUILD_ROOT%{_datadir}/locale/locale-archive* |
1024 |
rm -f $RPM_BUILD_ROOT%{_var}/db/Makefile |
1025 |
|
1026 |
%if !%{build_utils} |
1027 |
%if %{build_biarch} |
1028 |
rm -f $RPM_BUILD_ROOT%{_slibdir32}/libmemusage.so |
1029 |
rm -f $RPM_BUILD_ROOT%{_slibdir32}/libpcprofile.so |
1030 |
%endif |
1031 |
rm -f $RPM_BUILD_ROOT%{_slibdir}/libmemusage.so |
1032 |
rm -f $RPM_BUILD_ROOT%{_slibdir}/libpcprofile.so |
1033 |
rm -f $RPM_BUILD_ROOT%{_bindir}/memusage |
1034 |
rm -f $RPM_BUILD_ROOT%{_bindir}/memusagestat |
1035 |
rm -f $RPM_BUILD_ROOT%{_bindir}/mtrace |
1036 |
rm -f $RPM_BUILD_ROOT%{_bindir}/pcprofiledump |
1037 |
rm -f $RPM_BUILD_ROOT%{_bindir}/xtrace |
1038 |
%endif |
1039 |
|
1040 |
%if !%{build_timezone} |
1041 |
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime |
1042 |
rm -f $RPM_BUILD_ROOT%{_sbindir}/zdump |
1043 |
rm -f $RPM_BUILD_ROOT%{_sbindir}/zic |
1044 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo |
1045 |
%endif |
1046 |
|
1047 |
%if !%{build_i18ndata} |
1048 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/i18n |
1049 |
%endif |
1050 |
|
1051 |
%if "%{name}" != "glibc" |
1052 |
rm -rf $RPM_BUILD_ROOT/boot |
1053 |
rm -rf $RPM_BUILD_ROOT/sbin |
1054 |
rm -rf $RPM_BUILD_ROOT/usr/share |
1055 |
rm -rf $RPM_BUILD_ROOT%{_bindir} |
1056 |
rm -rf $RPM_BUILD_ROOT%{_sbindir} |
1057 |
rm -rf $RPM_BUILD_ROOT%{_datadir} |
1058 |
rm -rf $RPM_BUILD_ROOT%{_infodir} |
1059 |
rm -rf $RPM_BUILD_ROOT%{_prefix}/etc |
1060 |
rm -rf $RPM_BUILD_ROOT%{_libdir}/gconv |
1061 |
%endif |
1062 |
|
1063 |
# In case we are cross-compiling, don't bother to remake symlinks and |
1064 |
# fool spec-helper when stripping files |
1065 |
%if "%{name}" != "glibc" |
1066 |
export DONT_SYMLINK_LIBS=1 |
1067 |
export PATH=%{_bindir}:$PATH |
1068 |
%endif |
1069 |
|
1070 |
# This will make the '-g' argument to be passed to eu-strip for these |
1071 |
# libraries, so that only debug symbols are stripped and gdb/valgrind continue |
1072 |
# to work without needing glibc-debug package to be installed. |
1073 |
export EXCLUDE_FROM_FULL_STRIP="ld-%{glibcversion}.so libpthread libc-%{glibcversion}.so" |
1074 |
|
1075 |
# If we are building a debug package then copy all of the static archives |
1076 |
# into the debug directory to keep them as unstripped copies. |
1077 |
%if 0%{?_enable_debug_packages} |
1078 |
mkdir -p %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir} |
1079 |
cp -a %{glibc_sysroot}%{_libdir}/*.a \ |
1080 |
%{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}/ |
1081 |
rm -f %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}/*_p.a |
1082 |
%endif |
1083 |
# Strip all of the installed object files. |
1084 |
strip -g %{buildroot}%{_libdir}/*.o |
1085 |
|
1086 |
find_debuginfo_args='--strict-build-id -g -i' |
1087 |
/usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args -o debuginfo.filelist |
1088 |
|
1089 |
# List all of the *.a archives in the debug directory. |
1090 |
list_debug_archives() |
1091 |
{ |
1092 |
local dir=%{_prefix}/lib/debug%{_libdir} |
1093 |
find %{glibc_sysroot}$dir -name "*.a" -printf "$dir/%%P\n" |
1094 |
} |
1095 |
|
1096 |
# Remove some common directories from the common package debuginfo so that we |
1097 |
# don't end up owning them. |
1098 |
exclude_common_dirs() |
1099 |
{ |
1100 |
exclude_dirs="%{_prefix}/src/debug" |
1101 |
exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug{,/%{_lib},/bin,/sbin})" |
1102 |
exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug%{_prefix}{,/%{_lib},/libexec,/bin,/sbin})" |
1103 |
|
1104 |
for d in $(echo $exclude_dirs | sed 's/ /\n/g'); do |
1105 |
sed -i "\|^%%dir $d/\?$|d" $1 |
1106 |
done |
1107 |
} |
1108 |
|
1109 |
exclude_common_dirs debuginfo.filelist |
1110 |
|
1111 |
%if "%{name}" == "glibc" |
1112 |
|
1113 |
%post -p %{_sbindir}/glibc-post-wrapper |
1114 |
|
1115 |
# automatic ldconfig cache update on rpm installs/removals |
1116 |
# (see http://www.rpm.org/wiki/FileTriggers) |
1117 |
# FIXME: port to lua to remove circular dependency with grep |
1118 |
%transfiletriggerin -p %{ash_bin} -P 2000000 -- /lib/ /lib64/ |
1119 |
grep -F '.so.' | ldconfig -X |
1120 |
|
1121 |
%transfiletriggerin -p %{ash_bin} -P 2000000 -- /etc/ld.so.conf.d/ |
1122 |
ldconfig -X |
1123 |
|
1124 |
%endif |
1125 |
|
1126 |
%if %{build_nscd} |
1127 |
%pre -n nscd |
1128 |
%_pre_useradd nscd / /bin/false |
1129 |
|
1130 |
%post -n nscd |
1131 |
%_tmpfilescreate nscd |
1132 |
%_post_service nscd |
1133 |
|
1134 |
%preun -n nscd |
1135 |
%_preun_service nscd |
1136 |
|
1137 |
%postun -n nscd |
1138 |
%_postun_userdel nscd |
1139 |
|
1140 |
if [ "$1" -ge "1" ]; then |
1141 |
/sbin/service nscd condrestart > /dev/null 2>&1 || : |
1142 |
fi |
1143 |
%endif |
1144 |
|
1145 |
# |
1146 |
# glibc |
1147 |
# |
1148 |
%files -f rpm.filelist |
1149 |
%if "%{name}" == "glibc" |
1150 |
%if %{build_timezone} |
1151 |
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/localtime |
1152 |
%endif |
1153 |
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/nsswitch.conf |
1154 |
%verify(not md5 size mtime) %config(noreplace) %{_sysconfdir}/ld.so.conf |
1155 |
%dir %{_sysconfdir}/ld.so.conf.d |
1156 |
%config(noreplace) %{_sysconfdir}/rpc |
1157 |
%doc nis/nss |
1158 |
%doc posix/gai.conf |
1159 |
%{_datadir}/locale/locale.alias |
1160 |
/sbin/sln |
1161 |
%dir %{_prefix}/libexec/getconf |
1162 |
%{_prefix}/libexec/getconf/* |
1163 |
%endif |
1164 |
%{_slibdir}/ld-%{glibcversion}.so |
1165 |
%if %isarch i386 |
1166 |
%{_slibdir}/ld-linux.so.2 |
1167 |
%endif |
1168 |
%if %isarch %arm |
1169 |
%if %isarch armv7hl |
1170 |
%{_slibdir}/ld-linux-armhf.so.3 |
1171 |
%endif |
1172 |
%{_slibdir}/ld-linux.so.3 |
1173 |
%endif |
1174 |
%if %isarch x86_64 |
1175 |
%{_slibdir}/ld-linux-x86-64.so.2 |
1176 |
%endif |
1177 |
%if %isarch aarch64 |
1178 |
%{_slibdir}/ld-linux-aarch64.so.1 |
1179 |
%endif |
1180 |
%{_slibdir}/lib*-[.0-9]*.so |
1181 |
%{_slibdir}/lib*.so.[0-9]* |
1182 |
%{_slibdir}/libSegFault.so |
1183 |
%if "%{name}" == "glibc" |
1184 |
%dir %{_libdir}/audit |
1185 |
%{_libdir}/audit/sotruss-lib.so |
1186 |
%dir %{_libdir}/gconv |
1187 |
%{_libdir}/gconv/*.so |
1188 |
%{_libdir}/gconv/gconv-modules |
1189 |
%ghost %{_libdir}/gconv/gconv-modules.cache |
1190 |
%{_bindir}/catchsegv |
1191 |
%{_bindir}/gencat |
1192 |
%{_bindir}/getconf |
1193 |
%{_bindir}/getent |
1194 |
%{_bindir}/iconv |
1195 |
%{_bindir}/ldd |
1196 |
%if %isarch i386 |
1197 |
%{_bindir}/lddlibc4 |
1198 |
%endif |
1199 |
%{_bindir}/locale |
1200 |
%{_bindir}/localedef |
1201 |
%{_bindir}/makedb |
1202 |
%{_bindir}/pldd |
1203 |
%{_bindir}/rpcgen |
1204 |
%{_bindir}/sotruss |
1205 |
%{_bindir}/sprof |
1206 |
%{_bindir}/tzselect |
1207 |
%{_sbindir}/iconvconfig |
1208 |
%{_sbindir}/glibc-post-wrapper |
1209 |
%endif |
1210 |
|
1211 |
%if %isarch aarch64 |
1212 |
%{_slibdir32}/ld-linux-aarch64.so.1 |
1213 |
%endif |
1214 |
|
1215 |
%if %{build_biarch} |
1216 |
%{_slibdir32}/ld-%{glibcversion}.so |
1217 |
%{_slibdir32}/ld-linux*.so.2 |
1218 |
%{_slibdir32}/lib*-[.0-9]*.so |
1219 |
%{_slibdir32}/lib*.so.[0-9]* |
1220 |
%{_slibdir32}/libSegFault.so |
1221 |
%dir %{_prefix}/lib/audit |
1222 |
%{_prefix}/lib/audit/sotruss-lib.so |
1223 |
%dir %{_prefix}/lib/gconv |
1224 |
%{_prefix}/lib/gconv/* |
1225 |
%endif |
1226 |
|
1227 |
# |
1228 |
# ldconfig |
1229 |
# |
1230 |
%if "%{name}" == "glibc" |
1231 |
/sbin/ldconfig |
1232 |
%ghost %{_sysconfdir}/ld.so.cache |
1233 |
%dir %{_var}/cache/ldconfig |
1234 |
%ghost %{_var}/cache/ldconfig/aux-cache |
1235 |
%endif |
1236 |
|
1237 |
# |
1238 |
# glibc-devel |
1239 |
# |
1240 |
%files devel -f devel.filelist |
1241 |
%doc README NEWS INSTALL |
1242 |
# (tmb) FIXME, figure out rpm doc breakage/change |
1243 |
#doc COPYING COPYING.LIB |
1244 |
#doc documentation/* |
1245 |
#doc hesiod/README.hesiod |
1246 |
#doc crypt/README.ufc-crypt |
1247 |
%{_libdir}/libc_nonshared.a |
1248 |
%{_libdir}/libg.a |
1249 |
%{_libdir}/libmcheck.a |
1250 |
%if %isarch x86_64 |
1251 |
%{_libdir}/libm-%{glibcversion}.a |
1252 |
%{_libdir}/libmvec.a |
1253 |
%endif |
1254 |
#{_libdir}/libpthread_nonshared.a |
1255 |
%if "%{name}" == "glibc" |
1256 |
%{_libdir}/librpcsvc.a |
1257 |
%endif |
1258 |
|
1259 |
%if %{build_biarch} |
1260 |
%{_prefix}/lib/libc_nonshared.a |
1261 |
%{_prefix}/lib/libg.a |
1262 |
%{_prefix}/lib/libmcheck.a |
1263 |
#{_prefix}/lib/libpthread_nonshared.a |
1264 |
%{_prefix}/lib/librpcsvc.a |
1265 |
%endif |
1266 |
|
1267 |
# |
1268 |
# glibc-static-devel |
1269 |
# |
1270 |
%files static-devel |
1271 |
%doc COPYING COPYING.LIB |
1272 |
%{_libdir}/libBrokenLocale.a |
1273 |
%{_libdir}/libanl.a |
1274 |
%{_libdir}/libc.a |
1275 |
%{_libdir}/libdl.a |
1276 |
%{_libdir}/libm.a |
1277 |
%{_libdir}/libnsl.a |
1278 |
%{_libdir}/libpthread.a |
1279 |
%{_libdir}/libresolv.a |
1280 |
%{_libdir}/librt.a |
1281 |
%{_libdir}/libutil.a |
1282 |
|
1283 |
%if %{build_biarch} |
1284 |
%{_prefix}/lib/libBrokenLocale.a |
1285 |
%{_prefix}/lib/libanl.a |
1286 |
%{_prefix}/lib/libc.a |
1287 |
%{_prefix}/lib/libdl.a |
1288 |
%{_prefix}/lib/libm.a |
1289 |
%{_prefix}/lib/libnsl.a |
1290 |
%{_prefix}/lib/libpthread.a |
1291 |
%{_prefix}/lib/libresolv.a |
1292 |
%{_prefix}/lib/librt.a |
1293 |
%{_prefix}/lib/libutil.a |
1294 |
%endif |
1295 |
|
1296 |
# |
1297 |
# glibc-doc |
1298 |
# |
1299 |
%if %{build_doc} |
1300 |
%files doc |
1301 |
%{_infodir}/libc.info* |
1302 |
%endif |
1303 |
|
1304 |
# |
1305 |
# glibc-doc-pdf |
1306 |
# |
1307 |
%if %{build_pdf_doc} |
1308 |
%files doc-pdf |
1309 |
%doc manual/libc.pdf |
1310 |
%endif |
1311 |
|
1312 |
# |
1313 |
# glibc-profile |
1314 |
# |
1315 |
%if %{build_profile} |
1316 |
%files profile |
1317 |
%{_libdir}/lib*_p.a |
1318 |
%if %{build_biarch} |
1319 |
%{_prefix}/lib/lib*_p.a |
1320 |
%endif |
1321 |
%endif |
1322 |
|
1323 |
# |
1324 |
# glibc-utils |
1325 |
# |
1326 |
%if %{build_utils} |
1327 |
%files utils |
1328 |
%if %{build_biarch} |
1329 |
%{_slibdir32}/libmemusage.so |
1330 |
%{_slibdir32}/libpcprofile.so |
1331 |
%endif |
1332 |
%{_slibdir}/libmemusage.so |
1333 |
%{_slibdir}/libpcprofile.so |
1334 |
%{_bindir}/memusage |
1335 |
%{_bindir}/memusagestat |
1336 |
%{_bindir}/mtrace |
1337 |
%{_bindir}/pcprofiledump |
1338 |
%{_bindir}/xtrace |
1339 |
%endif |
1340 |
|
1341 |
# |
1342 |
# nscd |
1343 |
# |
1344 |
%if %{build_nscd} |
1345 |
%files -n nscd |
1346 |
%config(noreplace) %{_sysconfdir}/nscd.conf |
1347 |
%{_sbindir}/nscd |
1348 |
%{_unitdir}/nscd.service |
1349 |
%{_unitdir}/nscd.socket |
1350 |
%{_tmpfilesdir}/nscd.conf |
1351 |
%dir %{_var}/db/nscd |
1352 |
%endif |
1353 |
|
1354 |
# |
1355 |
# timezone |
1356 |
# |
1357 |
%if %{build_timezone} |
1358 |
%files -n timezone |
1359 |
%{_sbindir}/zdump |
1360 |
%{_sbindir}/zic |
1361 |
%dir %{_datadir}/zoneinfo |
1362 |
%{_datadir}/zoneinfo/* |
1363 |
%endif |
1364 |
|
1365 |
# |
1366 |
# glibc-i18ndata |
1367 |
# |
1368 |
%if %{build_i18ndata} |
1369 |
%files i18ndata |
1370 |
%dir %{_datadir}/i18n |
1371 |
%dir %{_datadir}/i18n/charmaps |
1372 |
%{_datadir}/i18n/charmaps/* |
1373 |
%dir %{_datadir}/i18n/locales |
1374 |
%{_datadir}/i18n/locales/* |
1375 |
%{_datadir}/i18n/SUPPORTED |
1376 |
%endif |
1377 |
|
1378 |
%if 0%{?_enable_debug_packages} |
1379 |
%files debuginfo -f debuginfo.filelist |
1380 |
%endif |