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