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