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