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