source: projects/specs/trunk/g/glibc/glibc-vl.spec @ 12525

Revision 12525, 69.0 KB checked in by tomop, 3 years ago (diff)

updated 10 packages

binutils-2.36.1-1

elfutils-0.183-1

gcc-10.2.1-1

gdb-10.1-1

glibc-2.33-1

isl-0.23-1

libtirpc-1.3.1-1

libtool-2.4.6-7

libxcrypt-4.4.17-1

valgrind-3.16.1-2

Line 
1%bcond_with gcc5
2%bcond_with systemd
3
4%define glibcversion 2.33
5%define glibcsrcdir glibc-%{glibcversion}
6%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
7### glibc.spec.in follows:
8%define run_glibc_tests 1
9%define auxarches athlon sparcv9v sparc64v alphaev6
10%if %{build_compat32}
11%define auxarches i586 athlon sparcv9 alphaev6
12%endif
13%define xenarches i686 athlon
14%ifarch %{xenarches}
15%define buildxen 1
16%define xenpackage 0
17%else
18%define buildxen 0
19%define xenpackage 0
20%endif
21%ifarch ppc64
22%define buildpower6 1
23%else
24%define buildpower6 0
25%endif
26%define biarcharches %{ix86} x86_64 ppc ppc64 s390 s390x
27%global _enable_debug_packages 1
28%define debuginfocommonarches %{biarcharches} alpha alphaev6
29%define multiarcharches ppc ppc64 %{ix86} x86_64 %{sparc}
30# Remove -s to get verbose output.
31%define silentrules PARALLELMFLAGS=-s
32
33Summary: The GNU libc libraries
34Summary(ja): GNU libc ライブラリ
35Name: glibc
36Version: %{glibcversion}
37Release: 1%{?_dist_release}%{?with_systemd:.systemd}
38Group: system
39Vendor: Project Vine
40Distribution: Vine Linux
41# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
42# Things that are linked directly into dynamically linked programs
43# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
44# exception which allows linking it into any kind of programs or shared
45# libraries without restrictions.
46License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
47URL: http://www.gnu.org/software/glibc/
48Source0: https://ftp.gnu.org/gnu/glibc/%{glibcsrcdir}.tar.xz
49Source1: build-locale-archive.c
50Source4: nscd.conf
51Source7: nsswitch.conf.vine
52Source8: power6emul.c
53Source9: bench.mk
54Source10: glibc-bench-compare
55# A copy of localedata/SUPPORTED in the Source0 tarball.  The
56# SUPPORTED file is used below to generate the list of locale
57# packages, using a Lua snippet.
58Source11: SUPPORTED
59
60Source1000: rpm-old-changelog.txt
61
62# patched form upstream
63Patch0: glibc-2.33-20210209.patch
64
65# patches from Fedora
66#Patch1: glibc-post_upgrade.patch
67Patch2: glibc-fedora-nscd.patch
68Patch3: glibc-rh697421.patch
69Patch4: glibc-fedora-linux-tcsetattr.patch
70#Patch5: glibc-rh741105.patch
71Patch6: glibc-fedora-localedef.patch
72#Patch7: glibc-fedora-nis-rh188246.patch
73Patch8: glibc-fedora-manual-dircategory.patch
74Patch9: glibc-rh827510.patch
75# needed by build-locale-archive.c
76Patch10: glibc-fedora-locarchive.patch
77Patch12: glibc-rh819430.patch
78Patch13: glibc-fedora-localedata-rh61908.patch
79#Patch14: glibc-fedora-__libc_multiple_libcs.patch
80Patch15: glibc-rh1070416.patch
81Patch16: glibc-nscd-sysconfig.patch
82Patch17: glibc-cs-path.patch
83Patch18: glibc-c-utf8-locale.patch
84Patch23: glibc-python3.patch
85Patch29: glibc-fedora-nsswitch.patch
86
87# patch for Vine
88#Patch10001: glibc-2.18-vine-build-env.patch
89
90# security
91
92Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
93Obsoletes: glibc-profile < 2.4
94Provides: ldconfig
95# The dynamic linker supports DT_GNU_HASH
96Provides: rtld(GNU_HASH)
97Requires: glibc-common = %{version}-%{release}
98# Require libgcc in case some program calls pthread_cancel in its %%post
99Requires(pre): basesystem, libgcc
100# This is for building auxiliary programs like memusage, nscd
101# For initial glibc bootstraps it can be commented out
102BuildRequires: gd-devel libpng-devel zlib-devel texinfo
103BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext, nss-devel
104BuildRequires: python3-devel
105BuildRequires: bison
106BuildRequires: /bin/ps, /bin/kill, /bin/awk
107# This is to ensure that __frame_state_for is exported by glibc
108# will be compatible with egcs 1.x.y
109BuildRequires: gcc >= 3.2
110%define enablekernel 3.2
111Conflicts: kernel < %{enablekernel}
112%ifarch i386
113%define target_cpu i486
114%else
115%define target_cpu %{_target_cpu}
116%endif
117
118%define target %{_target_cpu}-vine-linux
119%ifarch %{arm}
120%define target %{_target_cpu}-vine-linuxeabi
121%endif
122%ifarch %{power64}
123%define target ppc64-vine-linux
124%endif
125
126%ifarch %{multiarcharches}
127# Need STT_IFUNC support
128%ifarch ppc ppc64
129BuildRequires: binutils >= 2.20.51.0.2
130Conflicts: binutils < 2.20.51.0.2
131%else
132BuildRequires: binutils >= 2.19.51.0.10
133Conflicts: binutils < 2.19.51.0.10
134%endif
135# Earlier releases have broken support for IRELATIVE relocations
136Conflicts: prelink < 0.4.2
137%else
138# Need AS_NEEDED directive
139# Need --hash-style=* support
140BuildRequires: binutils >= 2.17.50.0.2-5
141%endif
142BuildRequires: gcc >= 3.2.1-5
143%ifarch ppc s390 s390x
144BuildRequires: gcc >= 4.1.0-0.17
145%endif
146%if 0%{?_enable_debug_packages}
147BuildRequires: elfutils >= 0.72
148BuildRequires: rpm >= 4.2-0.56
149%endif
150
151# The testsuite builds static C++ binaries that require a static
152# C++ runtime from libstdc++-static.
153BuildRequires: libstdc++-static
154
155BuildRequires: tzdata
156
157%define __find_provides %{SOURCE10}
158%define __find_requires %{SOURCE11}
159%define _filter_GLIBC_PRIVATE 1
160
161%description
162The glibc package contains standard libraries which are used by
163multiple programs on the system. In order to save disk space and
164memory, as well as to make upgrading easier, common system code is
165kept in one place and shared between programs. This particular package
166contains the most important sets of shared libraries: the standard C
167library and the standard math library. Without these two libraries, a
168Linux system will not function.
169
170%description -l ja
171glibc パッケージはシステム上の複数のプログラムで使われる標準ライブラリを
172ふくみます。ディスクスペースとメモリを節約したり、アップグレードを
173用意にするために、共通のシステムコードは一つの場所におかれ、プログラム
174間で共有されます。この部分的なパッケージはシェアドライブラリのかなり
175重要なセットをふくみます: 標準 C ライブラリと標準数値ライブラリです。
176この二つのライブラリ抜きでは、Linux システムは機能しません。
177
178
179%package -n compat32-%{name}
180Summary: The GNU libc libraries.
181Summary(ja): GNU libc ライブラリ
182Group: system
183Requires: %{name} >= %{version}-%{release}
184
185%description -n compat32-%{name}
186The glibc package contains standard libraries which are used by
187multiple programs on the system. In order to save disk space and
188memory, as well as to make upgrading easier, common system code is
189kept in one place and shared between programs. This particular package
190contains the most important sets of shared libraries: the standard C
191library and the standard math library. Without these two libraries, a
192Linux system will not function.
193
194%description -n compat32-%{name} -l ja
195glibc パッケージはシステム上の複数のプログラムで使われる標準ライブラリを
196ふくみます。ディスクスペースとメモリを節約したり、アップグレードを
197用意にするために、共通のシステムコードは一つの場所におかれ、プログラム
198間で共有されます。この部分的なパッケージはシェアドライブラリのかなり
199重要なセットをふくみます: 標準 C ライブラリと標準数値ライブラリです。
200この二つのライブラリ抜きでは、Linux システムは機能しません。
201
202
203%if %{xenpackage}
204%package xen
205Summary: The GNU libc libraries (optimized for running under Xen)
206Group: system
207Requires: glibc = %{version}-%{release}, glibc-utils = %{version}-%{release}
208
209%description xen
210The standard glibc package is optimized for native kernels and does not
211perform as well under the Xen hypervisor.  This package provides alternative
212library binaries that will be selected instead when running under Xen.
213
214Install glibc-xen if you might run your system under the Xen hypervisor.
215%endif
216
217
218%package devel
219Summary: Object files for development using standard C libraries.
220Summary(ja): 標準 C ライブラリで使われるオブジェクトファイル
221Group: programming
222Requires(pre): /sbin/install-info
223Requires(pre): %{name}-headers
224Requires: %{name}-headers = %{version}-%{release}
225Requires: %{name} = %{version}-%{release}
226
227%description devel
228The glibc-devel package contains the object files necessary
229for developing programs which use the standard C libraries (which are
230used by nearly all programs).  If you are developing programs which
231will use the standard C libraries, your system needs to have these
232standard object files available in order to create the
233executables.
234
235Install glibc-devel if you are going to develop programs which will
236use the standard C libraries.
237
238%description devel -l ja
239glibc-devel パッケージには (ほとんどすべてのプログラムで使われる)
240標準 C ライブラリを使用したプログラムを開発するためのオブジェクトファイルが
241含まれます。標準 C ライブラリを使用するプログラムを開発する場合には、
242これらオブジェクトファイルを使用して実行ファイルを作成できます。
243
244標準 C ライブラリを使用するプログラムを開発するなら glibc-devel
245をインストールしてください。
246
247
248%package -n compat32-%{name}-devel
249Summary: Object files for development using standard C libraries.
250Summary(ja): 標準 C ライブラリで使われるオブジェクトファイル
251Group: programming
252Requires: %{name}-devel = %{version}-%{release}
253Requires: compat32-%{name} = %{version}-%{release}
254
255%description -n compat32-%{name}-devel
256The glibc-devel package contains the object files necessary
257for developing programs which use the standard C libraries (which are
258used by nearly all programs).  If you are developing programs which
259will use the standard C libraries, your system needs to have these
260standard object files available in order to create the
261executables.
262
263Install glibc-devel if you are going to develop programs which will
264use the standard C libraries.
265
266%description -n compat32-%{name}-devel -l ja
267glibc-devel パッケージには (ほとんどすべてのプログラムで使われる)
268標準 C ライブラリを使用したプログラムを開発するためのオブジェクトファイルが
269含まれます。標準 C ライブラリを使用するプログラムを開発する場合には、
270これらオブジェクトファイルを使用して実行ファイルを作成できます。
271
272標準 C ライブラリを使用するプログラムを開発するなら glibc-devel
273をインストールしてください。
274
275
276%package static
277Summary: C library static libraries for -static linking.
278Summary(ja): -static リンクのための静的 C ライブラリ
279Group: programming
280Requires: %{name}-devel = %{version}-%{release}
281
282%description static
283The glibc-static package contains the C library static libraries
284for -static linking.  You don't need these, unless you link statically,
285which is highly discouraged.
286
287%description static -l ja
288glibc-static パッケージには -static リンクで使用する静的 C ライブラリが
289入っています。
290静的ライブラリが必要な場合でなければ、このパッケージをインストールする
291ことは避けて下さい。
292
293
294%package -n compat32-%{name}-static
295Summary: C library static libraries for -static linking.
296Summary(ja): -static リンクのための静的 C ライブラリ
297Group: programming
298Requires: %{name}-devel = %{version}-%{release}
299Requires: %{name}-static = %{version}-%{release}
300Requires: compat32-%{name}-devel = %{version}-%{release}
301
302%description -n compat32-%{name}-static
303The glibc-static package contains the C library static libraries
304for -static linking.  You don't need these, unless you link statically,
305which is highly discouraged.
306
307%description -n compat32-%{name}-static -l ja
308glibc-static パッケージには -static リンクで使用する静的 C ライブラリが
309入っています。
310静的ライブラリが必要な場合でなければ、このパッケージをインストールする
311ことは避けて下さい。
312
313
314%package headers
315Summary: Header files for development using standard C libraries.
316Summary(ja): 標準 C ライブラリで使われるヘッダーファイル
317Group: programming
318Provides: %{name}-headers(%{_target_cpu})
319%ifarch x86_64
320# If both -m32 and -m64 is to be supported on AMD64, x86_64 glibc-headers
321# have to be installed, not i586 ones.
322Obsoletes: %{name}-headers(i586)
323Obsoletes: %{name}-headers(i686)
324%endif
325Requires(pre): kernel-headers
326Requires: kernel-headers >= 2.2.1, %{name} = %{version}-%{release}
327BuildRequires: kernel-headers >= 2.6.22
328
329%description headers
330The glibc-headers package contains the header files necessary
331for developing programs which use the standard C libraries (which are
332used by nearly all programs).  If you are developing programs which
333will use the standard C libraries, your system needs to have these
334standard header files available in order to create the
335executables.
336
337Install glibc-headers if you are going to develop programs which will
338use the standard C libraries.
339
340%description headers -l ja
341glibc-headers パッケージには (ほとんどすべてのプログラムで使われる)
342標準 C ライブラリを使用したプログラムを開発するためのヘッダーファイルが
343含まれます。標準 C ライブラリを使用するプログラムを開発する場合には、
344これら標準ヘッダーファイルを使用して実行ファイルを作成できます。
345
346標準 C ライブラリを使用するプログラムを開発するなら glibc-headers
347をインストールしてください。
348
349
350%package common
351Summary: Common binaries and locale data for glibc
352Summary(ja): glibc 用共通バイナリとロケールデータ
353Requires: %{name} = %{version}-%{release}
354Requires: tzdata >= 2003a
355Group: system
356
357%description common
358The glibc-common package includes common binaries for the GNU libc
359libraries, as well as national language (locale) support.
360This package include ja and en locale-archive.
361
362%description common -l ja
363glibc-common パッケージには GNU libc ライブラリ用の共用バイナリに
364加えて、言語(ロケール)サポートや時間帯データベースが収められています。
365このパッケージには日本語と英語のみの locale-archive が含まれます。
366
367
368%package common-extra
369Summary: Extra Locale data for glibc
370Summary(ja): glibc 用ロケールデータ(日本語以外)
371Group: system
372Autoreq: false
373Requires(pre): %{name}-common = %{version}-%{release}
374
375%description common-extra
376The glibc-common-extra package includes national language (locale)
377support except for English and Japanese.
378
379%description common-extra -l ja
380glibc-common-extra パッケージには GNU libc ライブラリ用の英語と
381日本語以外の言語(ロケール)が収められています。
382
383
384%package locale-source
385Summary: The sources for the locales of glibc
386Summary(ja): glibc 用ロケールデータのソース
387Group: system
388Requires: %{name} = %{version}-%{release}
389Requires: %{name}-common = %{version}-%{release}
390
391%description locale-source
392The sources for all locales provided in glibc. If you are building
393custom locales you will most likely use these sources as the basis
394for your new locale.
395
396
397%package -n nscd
398Summary: A Name Service Caching Daemon (nscd).
399Summary(ja): ネームサービスキャッシングデーモン (nscd)
400Group: system
401Requires: %{name} = %{version}-%{release}
402Requires: audit-libs >= 1.1.3
403Requires(pre): /usr/sbin/useradd, coreutils
404Requires(postun): /usr/sbin/userdel
405%if %{with systemd}
406Requires(post): systemd
407Requires(preun): systemd
408Requires(postun): systemd
409%else
410Requires(pre): /sbin/chkconfig
411%endif
412
413%description -n nscd
414Nscd caches name service lookups and can dramatically improve
415performance with NIS+, and may help with DNS as well.
416
417%description -n nscd -l ja
418nscd はネームサービス参照をキャッシュし、NIS+ のパフォーマンスを
419劇的にに改善することができます。DNS のパフォーマンス向上にも同様に寄与します。
420
421
422%package utils
423Summary: Development utilities from GNU C library
424Summary(ja): GNU C ライブラリの開発ユーティリティ
425Group: programming,admin-tools
426Requires: %{name} = %{version}-%{release}
427
428%description utils
429The glibc-utils package contains memusage, a memory usage profiler,
430mtrace, a memory leak tracer and xtrace, a function call tracer
431which can be helpful during program debugging.
432
433If unsure if you need this, don't install this package.
434
435%description utils -l ja
436glibc-utils にはプログラムのデバッグに便利な以下のツールが収録されています:
437memusage (メモリ使用量プロファイラ)、mtrace (メモリリークトレーサ)、
438xtrace (関数呼出しトレーサ)。
439
440これらが必要かどうか分からない場合は、インストールする必要はありません。
441
442
443%if 0%{?_enable_debug_packages}
444%define debug_package %{nil}
445%define __debug_install_post %{nil}
446%global __debug_package 1
447
448%package debuginfo
449Summary: Debug information for package %{name}
450Group: Development/Debug
451AutoReqProv: no
452%ifarch %{debuginfocommonarches}
453Requires: glibc-debuginfo-common = %{version}-%{release}
454%else
455%ifarch %{ix86}
456Obsoletes: glibc-debuginfo-common
457%endif
458%endif
459
460%description debuginfo
461This package provides debug information for package %{name}.
462Debug information is useful when developing applications that use this
463package or when debugging this package.
464
465This package also contains static standard C libraries with
466debugging information.  You need this only if you want to step into
467C library routines during debugging programs statically linked against
468one or more of the standard C libraries.
469To use this debugging information, you need to link binaries
470with -static -L%{_prefix}/lib/debug%{_prefix}/%{_lib} compiler options.
471
472%ifarch %{debuginfocommonarches}
473
474%package debuginfo-common
475Summary: Debug information for package %{name}
476Group: Development/Debug
477AutoReqProv: no
478
479%description debuginfo-common
480This package provides debug information for package %{name}.
481Debug information is useful when developing applications that use this
482package or when debugging this package.
483
484%endif
485%endif
486
487%prep
488%autosetup -n %{glibcsrcdir} -p1
489
490# Make benchmark scripts executable
491chmod +x benchtests/scripts/*.py scripts/pylint
492
493# Remove all files generated from patching.
494find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;
495
496# Ensure timestamps on configure files are current to prevent
497# regenerating them.
498touch `find . -name configure`
499
500# Ensure *-kw.h files are current to prevent regenerating them.
501touch locale/programs/*-kw.h
502
503# Verify that our copy of localedata/SUPPORTED matches the glibc
504# version.
505#
506# The separate file copy is used by the Lua parser above.
507# Patches or new upstream versions may change the list of locales,
508# which changes the set of langpacks we need to build.  Verify the
509# differences then update the copy of SUPPORTED.  This approach has
510# two purposes: (a) avoid spurious changes to the set of langpacks,
511# and (b) the Lua snippet can use a fully patched-up version
512# of the localedata/SUPPORTED file.
513diff -u %{SOURCE11} localedata/SUPPORTED
514
515cp -f %{SOURCE1000} ./
516
517%build
518
519# We build using the native system compilers.
520GCC=gcc
521GXX=g++
522
523# Part of rpm_inherit_flags.  Is overridden below.
524rpm_append_flag ()
525{
526    BuildFlags="$BuildFlags $*"
527}
528
529# Propagates the listed flags to rpm_append_flag if supplied by
530# redhat-rpm-config.
531BuildFlags="-O2 -g"
532rpm_inherit_flags ()
533{
534        local reference=" $* "
535        local flag
536        for flag in $RPM_OPT_FLAGS $RPM_LD_FLAGS ; do
537                if echo "$reference" | grep -q -F " $flag " ; then
538                        rpm_append_flag "$flag"
539                fi
540        done
541}
542
543# Propgate select compiler flags from redhat-rpm-config.  These flags
544# are target-dependent, so we use only those which are specified in
545# redhat-rpm-config.  We keep the -m32/-m32/-m64 flags to support
546# multilib builds.
547#
548# Note: For building alternative run-times, care is required to avoid
549# overriding the architecture flags which go into CC/CXX.  The flags
550# below are passed in CFLAGS.
551
552rpm_inherit_flags \
553        "-Wp,-D_GLIBCXX_ASSERTIONS" \
554        "-fasynchronous-unwind-tables" \
555%if %{without gcc5}
556        "-fstack-clash-protection" \
557%endif
558        "-funwind-tables" \
559        "-m31" \
560        "-m32" \
561        "-m64" \
562        "-march=i686" \
563        "-march=x86-64" \
564        "-march=z13" \
565        "-march=z14" \
566        "-march=zEC12" \
567        "-mfpmath=sse" \
568        "-msse2" \
569        "-mstackrealign" \
570        "-mtune=generic" \
571        "-mtune=z13" \
572        "-mtune=z14" \
573        "-mtune=zEC12" \
574        "-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1" \
575
576# Propagate additional build flags to BuildFlagsNonshared.  This is
577# very special because some of these files are part of the startup
578# code.  We essentially hope that these flags have little effect
579# there, and only specify the, for consistency, so that annobin
580# records the expected compiler flags.
581BuildFlagsNonshared=
582rpm_append_flag () {
583    BuildFlagsNonshared="$BuildFlagsNonshared $*"
584}
585rpm_inherit_flags \
586        "-Wp,-D_FORTIFY_SOURCE=2" \
587
588# Special flag to enable annobin annotations for statically linked
589# assembler code.  Needs to be passed to make; not preserved by
590# configure.
591%define glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes"
592%define glibc_make_flags %{glibc_make_flags_as}
593
594##############################################################################
595# %%build - Generic options.
596##############################################################################
597EnableKernel="--enable-kernel=%{enablekernel}"
598# Save the used compiler and options into the file "Gcc" for use later
599# by %%install.
600echo "$GCC" > Gcc
601
602##############################################################################
603# build()
604#       Build glibc in `build-%{target}$1', passing the rest of the arguments
605#       as CFLAGS to the build (not the same as configure CFLAGS). Several
606#       global values are used to determine build flags, kernel version,
607#       system tap support, etc.
608##############################################################################
609build()
610{
611        local builddir=build-%{target}${1:+-$1}
612        ${1+shift}
613        rm -rf $builddir
614        mkdir $builddir
615        pushd $builddir
616        ../configure CC="$GCC" CXX="$GXX" CFLAGS="$BuildFlags $*" \
617                --prefix=%{_prefix} \
618                --with-headers=%{_prefix}/include $EnableKernel \
619                --with-nonshared-cflags="$BuildFlagsNonshared" \
620                --enable-bind-now \
621                --build=%{target} \
622                --enable-stack-protector=strong \
623%ifarch %{pie_arches}
624                --enable-static-pie \
625%endif
626                --enable-tunables \
627%if 0
628                --enable-systemtap \
629%endif
630                ${core_with_options} \
631%ifarch x86_64 %{ix86}
632%if %{without gcc5}
633               --enable-cet \
634%endif
635%endif
636%ifarch %{ix86}
637                --disable-multi-arch \
638%endif
639%if %{without werror}
640                --disable-werror \
641%endif
642                --disable-profile \
643                --without-selinux \
644                --disable-crypt ||
645                { cat config.log; false; }
646
647        make %{?_smp_mflags} -O -r %{glibc_make_flags}
648        popd
649}
650
651# Default set of compiler options.
652build
653
654
655%install
656rm -rf %{buildroot}
657# The built glibc is installed into a subdirectory of $RPM_BUILD_ROOT.
658# For a system glibc that subdirectory is "/" (the root of the filesystem).
659# This is called a sysroot (system root) and can be changed if we have a
660# distribution that supports multiple installed glibc versions.
661%define glibc_sysroot $RPM_BUILD_ROOT
662
663# Remove existing file lists.
664find . -type f -name '*.filelist' -exec rm -rf {} \;
665
666# Reload compiler and build options that were used during %%build.
667GCC=`cat Gcc`
668
669# Build and install:
670make -j1 install_root=%{glibc_sysroot} install -C build-%{target}
671
672# If we are not building an auxiliary arch then install all of the supported
673# locales.
674%ifnarch %{auxarches}
675pushd build-%{target}
676# Do not use a parallel make here because the hardlink optimization in
677# localedef is not fully reproducible when running concurrently.
678make install_root=%{glibc_sysroot} \
679        install-locales -C ../localedata objdir=`pwd`
680popd
681%endif
682
683# install_different:
684#       Install all core libraries into DESTDIR/SUBDIR. Either the file is
685#       installed as a copy or a symlink to the default install (if it is the
686#       same). The path SUBDIR_UP is the prefix used to go from
687#       DESTDIR/SUBDIR to the default installed libraries e.g.
688#       ln -s SUBDIR_UP/foo.so DESTDIR/SUBDIR/foo.so.
689#       When you call this function it is expected that you are in the root
690#       of the build directory, and that the default build directory is:
691#       "../build-%{target}" (relatively).
692#       The primary use of this function is to install alternate runtimes
693#       into the build directory and avoid duplicating this code for each
694#       runtime.
695install_different()
696{
697        local lib libbase libbaseso dlib
698        local destdir="$1"
699        local subdir="$2"
700        local subdir_up="$3"
701        local libdestdir="$destdir/$subdir"
702        # All three arguments must be non-zero paths.
703        if ! [ "$destdir" \
704               -a "$subdir" \
705               -a "$subdir_up" ]; then
706                echo "One of the arguments to install_different was emtpy."
707                exit 1
708        fi
709        # Create the destination directory and the multilib directory.
710        mkdir -p "$destdir"
711        mkdir -p "$libdestdir"
712        # Walk all of the libraries we installed...
713        for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db
714        do
715                libbase=${lib#*/}
716                # Take care that `libbaseso' has a * that needs expanding so
717                # take care with quoting.
718                libbaseso=$(basename %{glibc_sysroot}/%{_lib}/${libbase}-*.so)
719                # Only install if different from default build library.
720                if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then
721                        ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso
722                else
723                        cp -a ${lib}.so $libdestdir/$libbaseso
724                fi
725                dlib=$libdestdir/$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*)
726                ln -sf $libbaseso $dlib
727        done
728}
729
730##############################################################################
731# Remove the files we don't want to distribute
732##############################################################################
733
734# Remove the libNoVersion files.
735# XXX: This looks like a bug in glibc that accidentally installed these
736#      wrong files. We probably don't need this today.
737rm -f %{glibc_sysroot}/%{_libdir}/libNoVersion*
738rm -f %{glibc_sysroot}/%{_lib}/libNoVersion*
739
740# Remove the old nss modules.
741rm -f %{glibc_sysroot}/%{_lib}/libnss1-*
742rm -f %{glibc_sysroot}/%{_lib}/libnss-*.so.1
743
744# This statically linked binary is no longer necessary in a world where
745# the default Fedora install uses an initramfs, and further we have rpm-ostree
746# which captures the whole userspace FS tree.
747# Further, see https://github.com/projectatomic/rpm-ostree/pull/1173#issuecomment-355014583
748rm -f %{glibc_sysroot}/{usr/,}sbin/sln
749
750######################################################################
751# Run ldconfig to create all the symbolic links we need
752######################################################################
753
754# Note: This has to happen before creating /etc/ld.so.conf.
755
756mkdir -p %{glibc_sysroot}/var/cache/ldconfig
757truncate -s 0 %{glibc_sysroot}/var/cache/ldconfig/aux-cache
758
759# ldconfig is statically linked, so we can use the new version.
760%{glibc_sysroot}/sbin/ldconfig -N -r %{glibc_sysroot}
761
762##############################################################################
763# Install info files
764##############################################################################
765
766%if %{with docs}
767# Move the info files if glibc installed them into the wrong location.
768if [ -d %{glibc_sysroot}%{_prefix}/info -a "%{_infodir}" != "%{_prefix}/info" ]; then
769  mkdir -p %{glibc_sysroot}%{_infodir}
770  mv -f %{glibc_sysroot}%{_prefix}/info/* %{glibc_sysroot}%{_infodir}
771  rm -rf %{glibc_sysroot}%{_prefix}/info
772fi
773
774# Compress all of the info files.
775gzip -9nvf %{glibc_sysroot}%{_infodir}/libc*
776
777%else
778rm -f %{glibc_sysroot}%{_infodir}/dir
779rm -f %{glibc_sysroot}%{_infodir}/libc.info*
780%endif
781
782##############################################################################
783# Create locale sub-package file lists
784##############################################################################
785
786rm -f %{glibc_sysroot}/etc/localtime
787cp -f %{_datadir}/zoneinfo/Asia/Tokyo %{glibc_sysroot}/etc/localtime
788
789%ifnarch %{auxarches}
790olddir=`pwd`
791pushd %{glibc_sysroot}%{_prefix}/lib/locale
792rm -f locale-archive
793# Intentionally we do not pass --alias-file=, aliases will be added
794# by build-locale-archive.
795$olddir/build-%{target}/elf/ld.so \
796        --library-path $olddir/build-%{target}/ \
797        $olddir/build-%{target}/locale/localedef \
798        --prefix %{glibc_sysroot} --add-to-archive \
799        eo *_*
800# Setup the locale-archive template for use by glibc-all-langpacks.
801mv locale-archive{,-extra.tmpl}
802$olddir/build-%{target}/elf/ld.so \
803        --library-path $olddir/build-%{target}/ \
804        $olddir/build-%{target}/locale/localedef \
805        --prefix %{glibc_sysroot} --add-to-archive \
806        ja_JP* en_US*
807mv locale-archive{,.tmpl}
808cp -a locale-archive{.tmpl,-ja.tmpl}
809# Create the file lists for the language specific sub-packages:
810for i in eo *_*
811do
812    lang=${i%%_*}
813#    if [ ! -e langpack-${lang}.filelist ]; then
814#        echo "%dir %{_prefix}/lib/locale" >> locales.filelist
815#    fi
816    echo "%dir  %{_prefix}/lib/locale/$i" >> locales.filelist
817    echo "%{_prefix}/lib/locale/$i/*" >> locales.filelist
818done
819popd
820pushd %{glibc_sysroot}%{_prefix}/share/locale
821for i in */LC_MESSAGES/libc.mo
822do
823    locale=${i%%%%/*}
824    lang=${locale%%%%_*}
825    echo "%lang($lang) %{_prefix}/share/locale/${i}" \
826         >> %{glibc_sysroot}%{_prefix}/lib/locale/locales.filelist
827done
828popd
829mv  %{glibc_sysroot}%{_prefix}/lib/locale/*.filelist .
830%endif
831
832##############################################################################
833# Install configuration files for services
834##############################################################################
835
836install -p -m 644 %{SOURCE7} %{glibc_sysroot}/etc/nsswitch.conf
837
838%ifnarch %{auxarches}
839# This is for ncsd - in glibc 2.2
840install -m 644 nscd/nscd.conf %{glibc_sysroot}/etc
841%if %{with systemd}
842mkdir -p %{glibc_sysroot}%{_tmpfilesdir}
843install -m 644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}
844mkdir -p %{glibc_sysroot}%{_unitdir}
845install -m 644 nscd/nscd.service nscd/nscd.socket %{glibc_sysroot}%{_unitdir}/
846%else
847mkdir -p %{glibc_sysroot}/etc/rc.d/init.d
848install -m 755 nscd/nscd.init %{glibc_sysroot}/etc/rc.d/init.d/nscd
849%endif
850%endif
851
852# Include ld.so.conf
853echo 'include ld.so.conf.d/*.conf' > %{glibc_sysroot}/etc/ld.so.conf
854truncate -s 0 %{glibc_sysroot}/etc/ld.so.cache
855chmod 644 %{glibc_sysroot}/etc/ld.so.conf
856mkdir -p %{glibc_sysroot}/etc/ld.so.conf.d
857%ifnarch %{auxarches}
858mkdir -p %{glibc_sysroot}/etc/sysconfig
859truncate -s 0 %{glibc_sysroot}/etc/sysconfig/nscd
860truncate -s 0 %{glibc_sysroot}/etc/gai.conf
861%endif
862
863# Include %{_libdir}/gconv/gconv-modules.cache
864truncate -s 0 %{glibc_sysroot}%{_libdir}/gconv/gconv-modules.cache
865chmod 644 %{glibc_sysroot}%{_libdir}/gconv/gconv-modules.cache
866
867##############################################################################
868# Install debug copies of unstripped static libraries
869# - This step must be last in order to capture any additional static
870#   archives we might have added.
871##############################################################################
872
873# If we are building a debug package then copy all of the static archives
874# into the debug directory to keep them as unstripped copies.
875%if 0%{?_enable_debug_packages}
876mkdir -p %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}
877cp -a %{glibc_sysroot}%{_libdir}/*.a \
878        %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}/
879rm -f %{glibc_sysroot}%{_prefix}/lib/debug%{_libdir}/*_p.a
880%endif
881
882# Remove any zoneinfo files; they are maintained by tzdata.
883rm -rf %{glibc_sysroot}%{_prefix}/share/zoneinfo
884
885# Make sure %config files have the same timestamp across multilib packages.
886#
887# XXX: Ideally ld.so.conf should have the timestamp of the spec file, but there
888# doesn't seem to be any macro to give us that.  So we do the next best thing,
889# which is to at least keep the timestamp consistent.  The choice of using
890# glibc_post_upgrade.c is arbitrary.
891touch -r %{SOURCE0} %{glibc_sysroot}/etc/ld.so.conf
892touch -r inet/etc.rpc %{glibc_sysroot}/etc/rpc
893
894pushd build-%{target}
895$GCC -Os -g -static -o build-locale-archive %{SOURCE1} \
896        ../build-%{target}/locale/locarchive.o \
897        ../build-%{target}/locale/md5.o \
898        ../build-%{target}/locale/record-status.o \
899        -I. -DDATADIR=\"%{_datadir}\" -DPREFIX=\"%{_prefix}\" \
900        -L../build-%{target} \
901        -B../build-%{target}/csu/ -lc -lc_nonshared
902install -m 700 build-locale-archive %{glibc_sysroot}%{_prefix}/sbin/build-locale-archive
903popd
904
905# Lastly copy some additional documentation for the packages.
906rm -rf documentation
907mkdir documentation
908cp timezone/README documentation/README.timezone
909cp posix/gai.conf documentation/
910
911%ifarch s390x
912# Compatibility symlink
913mkdir -p %{glibc_sysroot}/lib
914ln -sf /%{_lib}/ld64.so.1 %{glibc_sysroot}/lib/ld64.so.1
915%endif
916
917%if %{with benchtests}
918# Build benchmark binaries.  Ignore the output of the benchmark runs.
919pushd build-%{target}
920make BENCH_DURATION=1 bench-build
921popd
922
923# Copy over benchmark binaries.
924mkdir -p %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests
925cp $(find build-%{target}/benchtests -type f -executable) %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
926# ... and the makefile.
927for b in %{SOURCE9} %{SOURCE10}; do
928        cp $b %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
929done
930# .. and finally, the comparison scripts.
931cp benchtests/scripts/benchout.schema.json %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
932cp benchtests/scripts/compare_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
933cp benchtests/scripts/import_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
934cp benchtests/scripts/validate_benchout.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
935%endif
936
937%if 0%{?_enable_debug_packages}
938# The #line directives gperf generates do not give the proper
939# file name relative to the build directory.
940pushd locale
941ln -sf programs/*.gperf .
942popd
943pushd iconv
944ln -sf ../locale/programs/charmap-kw.gperf .
945popd
946%endif # %{?_enable_debug_packages}
947
948%if %{with docs}
949# Remove the `dir' info-heirarchy file which will be maintained
950# by the system as it adds info files to the install.
951rm -f %{glibc_sysroot}%{_infodir}/dir
952%endif
953
954%ifnarch %{auxarches}
955truncate -s 0 %{glibc_sysroot}/%{_prefix}/lib/locale/locale-archive
956mkdir -p %{glibc_sysroot}/var/{db,run}/nscd
957touch %{glibc_sysroot}/var/{db,run}/nscd/{passwd,group,hosts,services}
958touch %{glibc_sysroot}/var/run/nscd/{socket,nscd.pid}
959%endif
960
961# Move libpcprofile.so and libmemusage.so into the proper library directory.
962# They can be moved without any real consequences because users would not use
963# them directly.
964mkdir -p %{glibc_sysroot}%{_libdir}
965mv -f %{glibc_sysroot}/%{_lib}/lib{pcprofile,memusage}.so \
966        %{glibc_sysroot}%{_libdir}
967
968# Strip all of the installed object files.
969strip -g %{glibc_sysroot}%{_libdir}/*.o
970
971###############################################################################
972# Rebuild libpthread.a using --whole-archive to ensure all of libpthread
973# is included in a static link. This prevents any problems when linking
974# statically, using parts of libpthread, and other necessary parts not
975# being included. Upstream has decided that this is the wrong approach to
976# this problem and that the full set of dependencies should be resolved
977# such that static linking works and produces the most minimally sized
978# static application possible.
979###############################################################################
980pushd %{glibc_sysroot}%{_prefix}/%{_lib}/
981$GCC -r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a
982rm libpthread.a
983ar rcs libpthread.a libpthread.o
984rm libpthread.o
985popd
986
987# The xtrace and memusage scripts have hard-coded paths that need to be
988# translated to a correct set of paths using the $LIB token which is
989# dynamically translated by ld.so as the default lib directory.
990for i in %{glibc_sysroot}%{_prefix}/bin/{xtrace,memusage}; do
991%if %{with bootstrap}
992  test -w $i || continue
993%endif
994  sed -e 's~=/%{_lib}/libpcprofile.so~=%{_libdir}/libpcprofile.so~' \
995      -e 's~=/%{_lib}/libmemusage.so~=%{_libdir}/libmemusage.so~' \
996      -e 's~='\''/\\\$LIB/libpcprofile.so~='\''%{_prefix}/\\$LIB/libpcprofile.so~' \
997      -e 's~='\''/\\\$LIB/libmemusage.so~='\''%{_prefix}/\\$LIB/libmemusage.so~' \
998      -i $i
999done
1000
1001##############################################################################
1002# Build an empty libpthread_nonshared.a for compatiliby with applications
1003# that have old linker scripts that reference this file. We ship this only
1004# in compat-libpthread-nonshared sub-package.
1005##############################################################################
1006ar cr %{glibc_sysroot}%{_prefix}/%{_lib}/libpthread_nonshared.a
1007
1008##############################################################################
1009# Beyond this point in the install process we no longer modify the set of
1010# installed files, with one exception, for auxarches we cleanup the file list
1011# at the end and remove files which we don't intend to ship. We need the file
1012# list to effect a proper cleanup, and so it happens last.
1013##############################################################################
1014
1015##############################################################################
1016# Build the file lists used for describing the package and subpackages.
1017##############################################################################
1018# There are several main file lists (and many more for
1019# the langpack sub-packages (langpack-${lang}.filelist)):
1020# * master.filelist
1021#       - Master file list from which all other lists are built.
1022# * glibc.filelist
1023#       - Files for the glibc packages.
1024# * common.filelist
1025#       - Flies for the common subpackage.
1026# * utils.filelist
1027#       - Files for the utils subpackage.
1028# * nscd.filelist
1029#       - Files for the nscd subpackage.
1030# * devel.filelist
1031#       - Files for the devel subpackage.
1032# * headers.filelist
1033#       - Files for the headers subpackage.
1034# * static.filelist
1035#       - Files for the static subpackage.
1036# * libnsl.filelist
1037#       - Files for the libnsl subpackage
1038# * nss_db.filelist
1039# * nss_hesiod.filelist
1040#       - File lists for nss_* NSS module subpackages.
1041# * nss-devel.filelist
1042#       - File list with the .so symbolic links for NSS packages.
1043# * compat-libpthread-nonshared.filelist.
1044#       - File list for compat-libpthread-nonshared subpackage.
1045# * debuginfo.filelist
1046#       - Files for the glibc debuginfo package.
1047# * debuginfocommon.filelist
1048#       - Files for the glibc common debuginfo package.
1049#
1050
1051# Create the main file lists. This way we can append to any one of them later
1052# wihtout having to create it. Note these are removed at the start of the
1053# install phase.
1054touch master.filelist
1055touch glibc.filelist
1056touch common.filelist
1057touch utils.filelist
1058touch nscd.filelist
1059touch devel.filelist
1060touch headers.filelist
1061touch static.filelist
1062touch libnsl.filelist
1063touch nss_db.filelist
1064touch nss_hesiod.filelist
1065touch nss-devel.filelist
1066touch compat-libpthread-nonshared.filelist
1067touch debuginfo.filelist
1068touch debuginfocommon.filelist
1069
1070###############################################################################
1071# Master file list, excluding a few things.
1072###############################################################################
1073{
1074  # List all files or links that we have created during install.
1075  # Files with 'etc' are configuration files, likewise 'gconv-modules'
1076  # and 'gconv-modules.cache' are caches, and we exclude them.
1077  find %{glibc_sysroot} \( -type f -o -type l \) \
1078       \( \
1079         -name etc -printf "%%%%config " -o \
1080         -name gconv-modules \
1081         -printf "%%%%verify(not md5 size mtime) %%%%config(noreplace) " -o \
1082         -name gconv-modules.cache \
1083         -printf "%%%%verify(not md5 size mtime) " \
1084         , \
1085         ! -path "*/lib/debug/*" -printf "/%%P\n" \)
1086  # List all directories with a %%dir prefix.  We omit the info directory and
1087  # all directories in (and including) /usr/share/locale.
1088  find %{glibc_sysroot} -type d \
1089       \( -path '*%{_prefix}/share/locale' -prune -o \
1090       \( -path '*%{_prefix}/share/*' \
1091%if %{with docs}
1092        ! -path '*%{_infodir}' -o \
1093%endif
1094          -path "*%{_prefix}/include/*" \
1095       \) -printf "%%%%dir /%%P\n" \)
1096} | {
1097  # Also remove the *.mo entries.  We will add them to the
1098  # language specific sub-packages.
1099  # libnss_ files go into subpackages related to NSS modules.
1100  # and .*/share/i18n/charmaps/.*), they go into the sub-package
1101  # "locale-source":
1102  sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \
1103      -e '\,.*/share/i18n/locales/.*,d' \
1104      -e '\,.*/share/i18n/charmaps/.*,d' \
1105      -e '\,.*/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \
1106      -e '\,.*/%{_libdir}/lib\(pcprofile\|memusage\)\.so,d' \
1107      -e '\,.*/bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
1108} | sort > master.filelist
1109
1110# The master file list is now used by each subpackage to list their own
1111# files. We go through each package and subpackage now and create their lists.
1112# Each subpackage picks the files from the master list that they need.
1113# The order of the subpackage list generation does not matter.
1114
1115# Make the master file list read-only after this point to avoid accidental
1116# modification.
1117chmod 0444 master.filelist
1118
1119###############################################################################
1120# glibc
1121###############################################################################
1122
1123# Add all files with the following exceptions:
1124# - The info files '%{_infodir}/dir'
1125# - The partial (lib*_p.a) static libraries, include files.
1126# - The static files, objects, unversioned DSOs, and nscd.
1127# - The bin, locale, some sbin, and share.
1128#   - The use of [^gi] is meant to exclude all files except glibc_post_upgrade,
1129#     and iconvconfig, which we want in the main packages.
1130# - All the libnss files (we add back the ones we want later).
1131# - All bench test binaries.
1132# - The aux-cache, since it's handled specially in the files section.
1133# - The build-locale-archive binary since it's in the common package.
1134cat master.filelist \
1135        | grep -v \
1136        -e '%{_infodir}' \
1137        -e '%{_libdir}/lib.*_p.a' \
1138        -e '%{_prefix}/include' \
1139        -e '%{_libdir}/lib.*\.a' \
1140        -e '%{_libdir}/.*\.o' \
1141        -e '%{_libdir}/lib.*\.so' \
1142        -e 'nscd' \
1143        -e '%{_prefix}/bin' \
1144        -e '%{_prefix}/lib/locale' \
1145        -e '%{_prefix}/sbin/[^gi]' \
1146        -e '%{_prefix}/share' \
1147        -e '/var/db/Makefile' \
1148        -e '/libnss_.*\.so[0-9.]*$' \
1149        -e '/libnsl' \
1150        -e 'glibc-benchtests' \
1151        -e 'aux-cache' \
1152        -e 'build-locale-archive' \
1153        > glibc.filelist
1154
1155# Add specific files:
1156# - The nss_files, nss_compat, and nss_db files.
1157# - The libmemusage.so and libpcprofile.so used by utils.
1158for module in compat files db dns hesiod; do
1159    cat master.filelist \
1160        | grep -E \
1161        -e "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \
1162        >> glibc.filelist
1163done
1164grep -e "libmemusage.so" -e "libpcprofile.so" master.filelist >> glibc.filelist
1165
1166cat glibc.filelist \
1167        | grep -v \
1168        -e '/sbin/ldconfig' \
1169        > compat32-glibc.filelist
1170
1171###############################################################################
1172# glibc-devel
1173###############################################################################
1174
1175%if %{with docs}
1176# Put the info files into the devel file list, but exclude the generated dir.
1177grep '%{_infodir}' master.filelist | grep -v '%{_infodir}/dir' > devel.filelist
1178%endif
1179
1180# Put some static files into the devel package.
1181grep '%{_libdir}/lib.*\.a' master.filelist \
1182  | grep '/lib\(\(c\|pthread\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\)\.a$' \
1183  >> devel.filelist
1184
1185# Put all of the object files and *.so (not the versioned ones) into the
1186# devel package.
1187grep '%{_libdir}/.*\.o' < master.filelist >> devel.filelist
1188grep '%{_libdir}/lib.*\.so' < master.filelist >> devel.filelist
1189# The exceptions are:
1190# - libmemusage.so and libpcprofile.so in glibc used by utils.
1191# - libnss_*.so which are in nss-devel.
1192sed -i -e '\,libmemusage.so,d' \
1193        -e '\,libpcprofile.so,d' \
1194        -e '\,/libnss_[a-z]*\.so$,d' \
1195        devel.filelist
1196
1197###############################################################################
1198# glibc-headers
1199###############################################################################
1200
1201# The glibc-headers package includes only common files which are identical
1202# across all multilib packages. We must keep gnu/stubs.h and gnu/lib-names.h
1203# in the glibc-headers package, but the -32, -64, -64-v1, and -64-v2 versions
1204# go into the development packages.
1205grep '%{_prefix}/include/gnu/stubs-.*\.h$' < master.filelist >> devel.filelist || :
1206grep '%{_prefix}/include/gnu/lib-names-.*\.h$' < master.filelist >> devel.filelist || :
1207# Put the include files into headers file list.
1208grep '%{_prefix}/include' < master.filelist \
1209  | egrep -v '%{_prefix}/include/gnu/stubs-.*\.h$' \
1210  | egrep -v '%{_prefix}/include/gnu/lib-names-.*\.h$' \
1211  > headers.filelist
1212
1213###############################################################################
1214# glibc-static
1215###############################################################################
1216
1217# Put the rest of the static files into the static package.
1218grep '%{_libdir}/lib.*\.a' < master.filelist \
1219  | grep -v '/lib\(\(c\|pthread\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\)\.a$' \
1220  > static.filelist
1221
1222###############################################################################
1223# glibc-common
1224###############################################################################
1225
1226# All of the bin and certain sbin files go into the common package except
1227# glibc_post_upgrade.* and iconvconfig which need to go in glibc. Likewise
1228# nscd is excluded because it goes in nscd.
1229grep '%{_prefix}/bin' master.filelist >> common.filelist
1230grep '%{_prefix}/sbin/[^gi]' master.filelist \
1231        | grep -v 'nscd' >> common.filelist
1232# All of the files under share go into the common package since they should be
1233# multilib-independent.
1234# Exceptions:
1235# - The actual share directory, not owned by us.
1236# - The info files which go in devel, and the info directory.
1237grep '%{_prefix}/share' master.filelist \
1238        | grep -v \
1239        -e '%{_prefix}/share/info/libc.info.*' \
1240        -e '%%dir %{_prefix}/share/info' \
1241        -e '%%dir %{_prefix}/share' \
1242        >> common.filelist
1243
1244# Add the binary to build locales to the common subpackage.
1245#echo '%{_prefix}/sbin/build-locale-archive' >> common.filelist
1246grep -e "/en_US/" -e "/ja_JP" -e "/ja/" locales.filelist >> common.filelist
1247grep -v -e "/en_US/" -e "/ja_JP" -e "/ja/" locales.filelist >> common-extra.filelist
1248
1249###############################################################################
1250# nscd
1251###############################################################################
1252
1253# The nscd binary must go into the nscd subpackage.
1254echo '%{_prefix}/sbin/nscd' > nscd.filelist
1255
1256###############################################################################
1257# glibc-utils
1258###############################################################################
1259
1260# Add the utils scripts and programs to the utils subpackage.
1261cat > utils.filelist <<EOF
1262%if %{without bootstrap}
1263%{_prefix}/bin/memusage
1264%{_prefix}/bin/memusagestat
1265%endif
1266%{_prefix}/bin/mtrace
1267%{_prefix}/bin/pcprofiledump
1268%{_prefix}/bin/xtrace
1269EOF
1270
1271###############################################################################
1272# nss_db, nss_hesiod
1273###############################################################################
1274
1275# Move the NSS-related files to the NSS subpackages.  Be careful not
1276# to pick up .debug files, and the -devel symbolic links.
1277for module in db hesiod; do
1278  grep -E "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \
1279    master.filelist > nss_$module.filelist
1280done
1281
1282###############################################################################
1283# nss-devel
1284###############################################################################
1285
1286# Symlinks go into the nss-devel package (instead of the main devel
1287# package).
1288grep '/libnss_[a-z]*\.so$' master.filelist > nss-devel.filelist
1289grep '/libnss_[a-z]*\.so$' master.filelist >> devel.filelist
1290
1291###############################################################################
1292# libnsl
1293###############################################################################
1294
1295# Prepare the libnsl-related file lists.
1296grep '/libnsl-[0-9.]*.so$' master.filelist > libnsl.filelist
1297test $(wc -l < libnsl.filelist) -eq 1
1298grep '/libnsl-[0-9.]*.so$' master.filelist >> devel.filelist
1299
1300###############################################################################
1301# glibc-benchtests
1302###############################################################################
1303%if %{with benchtests}
1304
1305# List of benchmarks.
1306find build-%{target}/benchtests -type f -executable | while read b; do
1307        echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)"
1308done >> benchtests.filelist
1309# ... and the makefile.
1310for b in %{SOURCE9} %{SOURCE10}; do
1311        echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" >> benchtests.filelist
1312done
1313# ... and finally, the comparison scripts.
1314echo "%{_prefix}/libexec/glibc-benchtests/benchout.schema.json" >> benchtests.filelist
1315echo "%{_prefix}/libexec/glibc-benchtests/compare_bench.py*" >> benchtests.filelist
1316echo "%{_prefix}/libexec/glibc-benchtests/import_bench.py*" >> benchtests.filelist
1317echo "%{_prefix}/libexec/glibc-benchtests/validate_benchout.py*" >> benchtests.filelist
1318%endif
1319
1320###############################################################################
1321# compat-libpthread-nonshared
1322###############################################################################
1323echo "%{_libdir}/libpthread_nonshared.a" >> compat-libpthread-nonshared.filelist
1324
1325###############################################################################
1326# glibc-debuginfocommon, and glibc-debuginfo
1327###############################################################################
1328%if 0%{?_enable_debug_packages}
1329
1330find_debuginfo_args='--strict-build-id -g'
1331%ifarch %{debuginfocommonarches}
1332find_debuginfo_args="$find_debuginfo_args \
1333        -l common.filelist \
1334        -l utils.filelist \
1335        -l nscd.filelist \
1336        -p '.*/(sbin|libexec)/.*' \
1337        -o debuginfocommon.filelist \
1338        -l nss_db.filelist -l nss_hesiod.filelist \
1339        -l libnsl.filelist -l glibc.filelist \
1340%if %{with benchtests}
1341        -l benchtests.filelist
1342%endif
1343        "
1344%endif
1345
1346/usr/lib/rpm/find-debuginfo.sh $find_debuginfo_args -o debuginfo.filelist
1347
1348# List all of the *.a archives in the debug directory.
1349list_debug_archives()
1350{
1351        local dir=%{_prefix}/lib/debug%{_libdir}
1352        find %{glibc_sysroot}$dir -name "*.a" -printf "$dir/%%P\n"
1353}
1354
1355%ifarch %{debuginfocommonarches}
1356
1357# Remove the source files from the common package debuginfo.
1358sed -i '\#^%{glibc_sysroot}%{_prefix}/src/debug/#d' debuginfocommon.filelist
1359
1360# Create a list of all of the source files we copied to the debug directory.
1361find %{glibc_sysroot}%{_prefix}/src/debug \
1362     \( -type d -printf '%%%%dir ' \) , \
1363     -printf '%{_prefix}/src/debug/%%P\n' > debuginfocommon.sources
1364
1365%ifarch %{biarcharches}
1366
1367# Add the source files to the core debuginfo package.
1368cat debuginfocommon.sources >> debuginfo.filelist
1369
1370%else
1371
1372%ifarch %{ix86}
1373%define basearch i686
1374%endif
1375%ifarch sparc sparcv9
1376%define basearch sparc
1377%endif
1378
1379# The auxarches get only these few source files.
1380auxarches_debugsources=\
1381'/(generic|linux|%{basearch}|nptl(_db)?)/|/%{glibcsrcdir}/build|/dl-osinfo\.h'
1382
1383# Place the source files into the core debuginfo pakcage.
1384egrep "$auxarches_debugsources" debuginfocommon.sources >> debuginfo.filelist
1385
1386# Remove the source files from the common debuginfo package.
1387egrep -v "$auxarches_debugsources" \
1388  debuginfocommon.sources >> debuginfocommon.filelist
1389
1390%endif # %{biarcharches}
1391
1392# Add the list of *.a archives in the debug directory to
1393# the common debuginfo package.
1394list_debug_archives >> debuginfocommon.filelist
1395
1396%endif # %{debuginfocommonarches}
1397
1398# Remove some common directories from the common package debuginfo so that we
1399# don't end up owning them.
1400exclude_common_dirs()
1401{
1402        exclude_dirs="%{_prefix}/src/debug"
1403        exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug{,/%{_lib},/bin,/sbin})"
1404        exclude_dirs="$exclude_dirs $(echo %{_prefix}/lib/debug%{_prefix}{,/%{_lib},/libexec,/bin,/sbin})"
1405
1406        for d in $(echo $exclude_dirs | sed 's/ /\n/g'); do
1407                sed -i "\|^%%dir $d/\?$|d" $1
1408        done
1409}
1410
1411%ifarch %{debuginfocommonarches}
1412exclude_common_dirs debuginfocommon.filelist
1413%endif
1414exclude_common_dirs debuginfo.filelist
1415
1416##############################################################################
1417# Delete files that we do not intended to ship with the auxarch.
1418# This is the only place where we touch the installed files after generating
1419# the file lists.
1420##############################################################################
1421%ifarch %{auxarches}
1422echo Cutting down the list of unpackaged files
1423sed -e '/%%dir/d;/%%config/d;/%%verify/d;s/%%lang([^)]*) //;s#^/*##' \
1424        common.filelist devel.filelist static.filelist headers.filelist \
1425        utils.filelist nscd.filelist \
1426%ifarch %{debuginfocommonarches}
1427        debuginfocommon.filelist \
1428%endif
1429        | (cd %{glibc_sysroot}; xargs --no-run-if-empty rm -f 2> /dev/null || :)
1430%endif # %{auxarches}
1431
1432%endif # %{?_enable_debug_packages}
1433
1434%check
1435%if %{with testsuite}
1436
1437# Run the glibc tests. If any tests fail to build we exit %check with
1438# an error, otherwise we print the test failure list and the failed
1439# test output and continue.  Write to standard error to avoid
1440# synchronization issues with make and shell tracing output if
1441# standard output and standard error are different pipes.
1442run_tests () {
1443  # This hides a test suite build failure, which should be fatal.  We
1444  # check "Summary of test results:" below to verify that all tests
1445  # were built and run.
1446  make %{?_smp_mflags} -O check |& tee rpmbuild.check.log >&2
1447  test -n tests.sum
1448  if ! grep -q '^Summary of test results:$' rpmbuild.check.log ; then
1449    echo "FAIL: test suite build of target: $(basename "$(pwd)")" >& 2
1450    exit 1
1451  fi
1452  set +x
1453  grep -v ^PASS: tests.sum > rpmbuild.tests.sum.not-passing || true
1454  if test -n rpmbuild.tests.sum.not-passing ; then
1455    echo ===================FAILED TESTS===================== >&2
1456    echo "Target: $(basename "$(pwd)")" >& 2
1457    cat rpmbuild.tests.sum.not-passing >&2
1458    while read failed_code failed_test ; do
1459      for suffix in out test-result ; do
1460        if test -e "$failed_test.$suffix"; then
1461          echo >&2
1462          echo "=====$failed_code $failed_test.$suffix=====" >&2
1463          cat -- "$failed_test.$suffix" >&2
1464          echo >&2
1465        fi
1466      done
1467    done <rpmbuild.tests.sum.not-passing
1468  fi
1469
1470  # Unconditonally dump differences in the system call list.
1471  echo "* System call consistency checks:" >&2
1472  cat misc/tst-syscall-list.out >&2
1473  set -x
1474}
1475
1476# Increase timeouts
1477export TIMEOUTFACTOR=16
1478parent=$$
1479echo ====================TESTING=========================
1480
1481# Default libraries.
1482pushd build-%{target}
1483run_tests
1484popd
1485
1486
1487echo ====================TESTING END=====================
1488PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p'
1489echo ====================PLT RELOCS LD.SO================
1490readelf -Wr %{glibc_sysroot}/%{_lib}/ld-*.so | sed -n -e "$PLTCMD"
1491echo ====================PLT RELOCS LIBC.SO==============
1492readelf -Wr %{glibc_sysroot}/%{_lib}/libc-*.so | sed -n -e "$PLTCMD"
1493echo ====================PLT RELOCS END==================
1494
1495# Finally, check if valgrind runs with the new glibc.
1496# We want to fail building if valgrind is not able to run with this glibc so
1497# that we can then coordinate with valgrind to get it fixed before we update
1498# glibc.
1499pushd build-%{target}
1500
1501# Show the auxiliary vector as seen by the new library
1502# (even if we do not perform the valgrind test).
1503LD_SHOW_AUXV=1 elf/ld.so --library-path .:elf:nptl:dlfcn /bin/true
1504
1505%if %{with valgrind}
1506elf/ld.so --library-path .:elf:nptl:dlfcn \
1507        /usr/bin/valgrind --error-exitcode=1 \
1508        elf/ld.so --library-path .:elf:nptl:dlfcn /usr/bin/true
1509%endif
1510popd
1511
1512%endif # %{run_glibc_tests}
1513
1514
1515%pre -p <lua>
1516-- Check that the running kernel is new enough
1517required = '%{enablekernel}'
1518rel = posix.uname("%r")
1519if rpm.vercmp(rel, required) < 0 then
1520  error("FATAL: kernel too old", 0)
1521end
1522
1523%post -p <lua>
1524-- We use lua's posix.exec because there may be no shell that we can
1525-- run during glibc upgrade.  We used to implement much of %%post as a
1526-- C program, but from an overall maintenance perspective the lua in
1527-- the spec file was simpler and safer given the operations required.
1528-- All lua code will be ignored by rpm-ostree; see:
1529-- https://github.com/projectatomic/rpm-ostree/pull/1869
1530-- If we add new lua actions to the %%post code we should coordinate
1531-- with rpm-ostree and ensure that their glibc install is functional.
1532function post_exec (program, ...)
1533  local pid = posix.fork ()
1534  if pid == 0 then
1535    assert (posix.exec (program, ...))
1536  elseif pid > 0 then
1537    posix.wait (pid)
1538  end
1539end
1540
1541-- (1) Remove multilib libraries from previous installs.
1542-- In order to support in-place upgrades, we must immediately remove
1543-- obsolete platform directories after installing a new glibc
1544-- version.  RPM only deletes files removed by updates near the end
1545-- of the transaction.  If we did not remove the obsolete platform
1546-- directories here, they may be preferred by the dynamic linker
1547-- during the execution of subsequent RPM scriptlets, likely
1548-- resulting in process startup failures.
1549
1550-- Full set of libraries glibc may install.
1551install_libs = { "anl", "BrokenLocale", "c", "dl", "m", "mvec",
1552                 "nss_compat", "nss_db", "nss_dns", "nss_files",
1553                 "nss_hesiod", "pthread", "resolv", "rt", "SegFault",
1554                 "thread_db", "util" }
1555
1556-- We are going to remove these libraries. Generally speaking we remove
1557-- all core libraries in the multilib directory.
1558-- We employ a tight match where X.Y is in [2.0,9.9*], so we would
1559-- match "libc-2.0.so" and so on up to "libc-9.9*".
1560remove_regexps = {}
1561for i = 1, #install_libs do
1562  remove_regexps[i] = ("lib" .. install_libs[i]
1563                       .. "%%-[2-9]%%.[0-9]+%%.so$")
1564end
1565
1566-- Two exceptions:
1567remove_regexps[#install_libs + 1] = "libthread_db%%-1%%.0%%.so"
1568remove_regexps[#install_libs + 2] = "libSegFault%%.so"
1569
1570-- We are going to search these directories.
1571local remove_dirs = { "%{_libdir}/i686",
1572                      "%{_libdir}/i686/nosegneg",
1573                      "%{_libdir}/power6",
1574                      "%{_libdir}/power7",
1575                      "%{_libdir}/power8" }
1576
1577-- Walk all the directories with files we need to remove...
1578for _, rdir in ipairs (remove_dirs) do
1579  if posix.access (rdir) then
1580    -- If the directory exists we look at all the files...
1581    local remove_files = posix.files (rdir)
1582    for rfile in remove_files do
1583      for _, rregexp in ipairs (remove_regexps) do
1584        -- Does it match the regexp?
1585        local dso = string.match (rfile, rregexp)
1586        if (dso ~= nil) then
1587          -- Removing file...
1588          os.remove (rdir .. '/' .. rfile)
1589        end
1590      end
1591    end
1592  end
1593end
1594
1595-- (2) Update /etc/ld.so.conf
1596-- Next we update /etc/ld.so.conf to ensure that it starts with
1597-- a literal "include ld.so.conf.d/*.conf".
1598
1599local ldsoconf = "/etc/ld.so.conf"
1600local ldsoconf_tmp = "/etc/glibc_post_upgrade.ld.so.conf"
1601
1602if posix.access (ldsoconf) then
1603
1604  -- We must have a "include ld.so.conf.d/*.conf" line.
1605  local have_include = false
1606  for line in io.lines (ldsoconf) do
1607    -- This must match, and we don't ignore whitespace.
1608    if string.match (line, "^include ld.so.conf.d/%%*%%.conf$") ~= nil then
1609      have_include = true
1610    end
1611  end
1612
1613  if not have_include then
1614    -- Insert "include ld.so.conf.d/*.conf" line at the start of the
1615    -- file. We only support one of these post upgrades running at
1616    -- a time (temporary file name is fixed).
1617    local tmp_fd = io.open (ldsoconf_tmp, "w")
1618    if tmp_fd ~= nil then
1619      tmp_fd:write ("include ld.so.conf.d/*.conf\n")
1620      for line in io.lines (ldsoconf) do
1621        tmp_fd:write (line .. "\n")
1622      end
1623      tmp_fd:close ()
1624      local res = os.rename (ldsoconf_tmp, ldsoconf)
1625      if res == nil then
1626        io.stdout:write ("Error: Unable to update configuration file (rename).\n")
1627      end
1628    else
1629      io.stdout:write ("Error: Unable to update configuration file (open).\n")
1630    end
1631  end
1632end
1633
1634-- (3) Rebuild ld.so.cache early.
1635-- If the format of the cache changes then we need to rebuild
1636-- the cache early to avoid any problems running binaries with
1637-- the new glibc.
1638
1639-- Note: We use _prefix because Fedora's UsrMove says so.
1640post_exec ("/sbin/ldconfig")
1641
1642-- (4) Update gconv modules cache.
1643-- If the /usr/lib/gconv/gconv-modules.cache exists, then update it
1644-- with the latest set of modules that were just installed.
1645-- We assume that the cache is in _libdir/gconv and called
1646-- "gconv-modules.cache".
1647
1648local iconv_dir = "%{_libdir}/gconv"
1649local iconv_cache = iconv_dir .. "/gconv-modules.cache"
1650if (posix.utime (iconv_cache) == 0) then
1651  post_exec ("%{_prefix}/sbin/iconvconfig",
1652             "-o", iconv_cache,
1653             "--nostdlib",
1654             iconv_dir)
1655else
1656  io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n")
1657end
1658
1659%postun -p /sbin/ldconfig
1660
1661%post -n compat32-%{name} -p /sbin/ldconfig
1662%postun -n compat32-%{name} -p /sbin/ldconfig
1663
1664%triggerin common -p <lua> -- glibc
1665if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
1666  pid = posix.fork()
1667  if pid == 0 then
1668    posix.exec("%{_prefix}/sbin/build-locale-archive")
1669  elseif pid > 0 then
1670    posix.wait(pid)
1671  end
1672end
1673
1674%post common -p <lua>
1675if posix.access("/etc/ld.so.cache") then
1676  if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
1677    pid = posix.fork()
1678    if pid == 0 then
1679      posix.exec("%{_prefix}/sbin/build-locale-archive")
1680    elseif pid > 0 then
1681      posix.wait(pid)
1682    end
1683  end
1684end
1685
1686%if %{without systemd}
1687%triggerin common -p <lua> -- tzdata
1688function update (filename, new_data)
1689  local fd = io.open(filename)
1690  if not fd then return end
1691  local data = fd:read("*a")
1692  fd:close()
1693  if not data then return end
1694  -- Don't update the file unnecessarily.
1695  if data == new_data then return end
1696  local tempfilename = filename .. ".tzupdate"
1697  fd = io.open(tempfilename, "w")
1698  if not fd then return end
1699  fd:write(new_data)
1700  fd:close()
1701  posix.chmod(tempfilename, 0644)
1702  if not os.rename(tempfilename, filename) then
1703    os.remove(tempfilename)
1704  end
1705end
1706fd = io.open("/etc/sysconfig/clock")
1707if not fd then return end
1708zonename = nil
1709for l in fd:lines() do
1710  zone = string.match(l, "^[ \t]*ZONE[ \t]*=[ \t]*\"?([^ \t\n\"]*)");
1711  if zone then
1712    zonename = "/usr/share/zoneinfo/" .. zone
1713    break
1714  end
1715end
1716fd:close()
1717if not zonename then return end
1718fd = io.open(zonename)
1719if not fd then return end
1720data = fd:read("*a")
1721fd:close()
1722if not data then return end
1723update("/etc/localtime", data)
1724update("/var/spool/postfix/etc/localtime", data)
1725%endif
1726
1727%post common-extra -p <lua>
1728-- cp -f /usr/lib/locale/locale-archive-extra.tmpl /usr/lib/locale/locale-archive.tmpl
1729if posix.access("/etc/ld.so.cache") then
1730  if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
1731    pid = posix.fork()
1732    if pid == 0 then
1733      posix.exec("%{_prefix}/sbin/build-locale-archive")
1734    elseif pid > 0 then
1735      posix.wait(pid)
1736    end
1737  end
1738end
1739
1740%postun common-extra -p <lua>
1741posix.exec("cp -f /usr/lib/locale/locale-archive-ja.tmpl /usr/lib/locale/locale-archive.tmpl")
1742if posix.access("/etc/ld.so.cache") then
1743  if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
1744    pid = posix.fork()
1745    if pid == 0 then
1746      posix.exec("%{_prefix}/sbin/build-locale-archive")
1747    elseif pid > 0 then
1748      posix.wait(pid)
1749    end
1750  end
1751end
1752
1753%triggerun -- common-extra
1754posix.exec("cp -f /usr/lib/locale/locale-archive-ja.tmpl /usr/lib/locale/locale-archive.tmpl")
1755if posix.access("/etc/ld.so.cache") then
1756  if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
1757    pid = posix.fork()
1758    if pid == 0 then
1759      posix.exec("%{_prefix}/sbin/build-locale-archive")
1760    elseif pid > 0 then
1761      posix.wait(pid)
1762    end
1763  end
1764end
1765
1766
1767%post devel
1768/sbin/install-info %{_infodir}/libc.info.gz %{_infodir}/dir > /dev/null 2>&1 || :
1769
1770%pre headers
1771# this used to be a link and it is causing nightmares now
1772if [ -L %{_prefix}/include/scsi ] ; then
1773  rm -f %{_prefix}/include/scsi
1774fi
1775
1776%preun devel
1777if [ "$1" = 0 ]; then
1778  /sbin/install-info --delete %{_infodir}/libc.info.gz %{_infodir}/dir > /dev/null 2>&1 || :
1779fi
1780
1781%post utils -p /sbin/ldconfig
1782
1783%postun utils -p /sbin/ldconfig
1784
1785%pre -n nscd
1786getent group nscd >/dev/null || /usr/sbin/groupadd -g 28 -r nscd
1787getent passwd nscd >/dev/null ||
1788  /usr/sbin/useradd -M -o -r -d / -s /sbin/nologin \
1789                    -c "NSCD Daemon" -u 28 -g nscd nscd
1790
1791%post -n nscd
1792%if %{with systemd}
1793%systemd_post nscd.service
1794%else
1795/sbin/chkconfig --add nscd
1796%endif
1797
1798%preun -n nscd
1799%if %{with systemd}
1800%systemd_preun nscd.service
1801%else
1802if [ $1 = 0 -o -x /bin/systemctl ] ; then
1803  /sbin/service nscd stop > /dev/null 2>&1
1804  /sbin/chkconfig --del nscd
1805fi
1806%endif
1807
1808%postun -n nscd
1809if [ $1 = 0 ] ; then
1810  /usr/sbin/userdel nscd > /dev/null 2>&1 || :
1811fi
1812%if %{with systemd}
1813%systemd_postun_with_restart nscd.service
1814%else
1815if [ "$1" -ge "1" ]; then
1816  service nscd condrestart > /dev/null 2>&1 || :
1817fi
1818%endif
1819
1820%if %{xenpackage}
1821%post xen -p /sbin/ldconfig
1822%postun xen -p /sbin/ldconfig
1823%endif
1824
1825%clean
1826rm -rf "$RPM_BUILD_ROOT"
1827rm -f *.filelist*
1828
1829%files -f glibc.filelist
1830%defattr(-,root,root)
1831/sbin/ldconfig
1832/%{_lib}/libnsl.so.*
1833%dir %{_prefix}/%{_lib}/audit
1834%if %{with systemd}
1835%exclude /etc/localtime
1836%else
1837%verify(not md5 size mtime) %config(noreplace) /etc/localtime
1838%endif
1839%verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf
1840%verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf
1841%verify(not md5 size mtime) %config(noreplace) /etc/rpc
1842%dir /etc/ld.so.conf.d
1843%dir %{_prefix}/libexec/getconf
1844%dir %{_prefix}/%{_lib}/gconv
1845%dir %{_localstatedir}/db
1846%{_localstatedir}/db/Makefile
1847%dir %attr(0700,root,root) /var/cache/ldconfig
1848%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/cache/ldconfig/aux-cache
1849%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
1850%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf
1851%doc rpm-old-changelog.txt
1852%doc README NEWS INSTALL elf/rtld-debugger-interface.txt
1853%license COPYING COPYING.LIB LICENSES
1854
1855%if %{build_compat32}
1856%files -f compat32-glibc.filelist -n compat32-%{name}
1857/%{_lib}/libnsl.so.*
1858%endif
1859
1860%ifnarch %{auxarches}
1861%files -f common.filelist common
1862%defattr(-,root,root)
1863%dir %{_datadir}/locale
1864%dir %{_prefix}/lib/locale
1865%dir %{_prefix}/lib/locale/C.utf8
1866%{_prefix}/lib/locale/C.utf8/*
1867%attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive-ja.tmpl
1868%attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive.tmpl
1869%attr(0644,root,root) %verify(not md5 size mtime mode) %ghost %config(missingok,noreplace) %{_prefix}/lib/locale/locale-archive
1870%dir %{_prefix}/share/locale
1871%dir %{_prefix}/share/locale/ja
1872%doc documentation/README.timezone
1873%doc documentation/gai.conf
1874
1875%files common-extra -f common-extra.filelist
1876%defattr(-,root,root)
1877%attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive-extra.tmpl
1878
1879%files locale-source
1880%defattr(-,root,root)
1881%dir %{_prefix}/share/i18n/locales
1882%{_prefix}/share/i18n/locales/*
1883%dir %{_prefix}/share/i18n/charmaps
1884%{_prefix}/share/i18n/charmaps/*
1885
1886%files -f devel.filelist devel
1887%defattr(-,root,root)
1888
1889%files -f static.filelist static
1890%defattr(-,root,root)
1891
1892%if %{build_compat32}
1893%files -f devel.filelist -n compat32-%{name}-devel
1894%defattr(-,root,root)
1895%exclude %{_prefix}/share
1896
1897%files -f static.filelist -n compat32-%{name}-static
1898%defattr(-,root,root)
1899%endif
1900
1901%files -f headers.filelist headers
1902%defattr(-,root,root)
1903
1904%files -f utils.filelist utils
1905%defattr(-,root,root)
1906
1907%files -f nscd.filelist -n nscd
1908%defattr(-,root,root)
1909%config(noreplace) /etc/nscd.conf
1910%if %{with systemd}
1911%{_unitdir}/*
1912%{_tmpfilesdir}/*
1913%else
1914%config /etc/rc.d/init.d/nscd
1915%endif
1916%dir %attr(0755,root,root) /var/run/nscd
1917%dir %attr(0755,root,root) /var/db/nscd
1918%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/nscd.pid
1919%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/socket
1920%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/passwd
1921%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/group
1922%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/hosts
1923%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/services
1924%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/passwd
1925%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/group
1926%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/hosts
1927%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/services
1928%ghost %config(missingok,noreplace) /etc/sysconfig/nscd
1929%endif
1930
1931%if 0%{?_enable_debug_packages}
1932%files debuginfo -f debuginfo.filelist
1933%defattr(-,root,root)
1934%ifarch %{debuginfocommonarches}
1935%ifnarch %{auxarches}
1936%files debuginfo-common -f debuginfocommon.filelist
1937%defattr(-,root,root)
1938%endif
1939%endif
1940%endif
1941
1942%changelog
1943* Tue Feb 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.33-1
1944- updated to 2.33.
1945- updated Patch0.
1946- dropped Patch1, 5, 7 and 14.
1947- updated Source11.
1948- updated Source1.
1949
1950* Sat May 09 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.31-2
1951- updated Patch0.
1952- added systemd support (disabled as default).
1953- dropped /sbin/ldconfig from compat32.
1954
1955* Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.31-1
1956- updated to 2.31.
1957- updated Patch0.
1958- dropped Patch28.
1959- imported Patch29 from rawhide.
1960- updated Patch5 and 23.
1961- updated Source11.
1962
1963* Sun Sep 22 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.30-1
1964- updated to 2.30.
1965- updated Patch0.
1966- dropped Patch11, 24 and 25.
1967
1968* Sun Jan 20 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.28-1
1969- updated to 2.28.
1970- dropped Source2, 3, 10 and 11.
1971- imported Source8-11 from rawhide.
1972- dropped Patch11-13.
1973- imported Patch1-28 from rawhide.
1974- dropped Patch10000.
1975- trimmed %%changelog: old logs are rpm-old-changelog.txt.
1976
1977* Tue Jun 20 2017 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> 2.23-5
1978- add patch20005 for fix CVE-2017-1000366
1979
1980* Mon Aug  1 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.23-4
1981- added Patch20000-20004 to fix vulnerabilities.
1982  - CVE-2016-1234
1983  - CVE-2016-3075
1984  - CVE-2016-3706
1985  - CVE-2016-4429
1986
1987* Sun Jun 26 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.23-3
1988- rebuilt with gcc-5.4.0
1989
1990* Tue May 24 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.23-2
1991- rebuilt with new binutils.
1992
1993* Sat May 07 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.23-1
1994- update to 2.23
1995- remove Patch14-18
1996- update SOURCE1 from fedora
Note: See TracBrowser for help on using the repository browser.