#
# You can define min_kernel macro by "rpm --define 'min_kernel version'"
-# default is 2.4.6
+# default is 2.4.6 for linuxthreads, 2.6.0 for NPTL
#
# Conditional build:
%bcond_with omitfp # build without frame pointer (pass \--enable-omitfp)
%bcond_without memusage # don't build memusage utility
-%bcond_with kernelheaders # use headers from kernel-headers instead of
+%bcond_with kernelheaders # use headers from %{_kernelsrcdir} instead of
# linux-libc-headers (evil, breakage etc., don't use)
-%bcond_without dist_kernel # for above, allow non-distribution kernel
-%bcond_with nptl # use nptl instead of linuxthreads (implies tls)
-%bcond_with tls # use tls
+%bcond_without linuxthreads # don't build linuxthreads version (NPTL only)
+%bcond_without nptl # don't build NPTL version (linuxthreads only)
+%bcond_without tls # don't support TLS at all (implies no NPTL)
+%bcond_with __thread # use TLS in linuxthreads
+%bcond_without selinux # without SELinux support (in nscd)
%bcond_with tests # perform "make test"
-
+%bcond_with tests_nptl # perform NPTL tests on dual build (requires 2.6.x kernel)
+%bcond_without localedb # don't build localedb-all (is time consuming)
+%bcond_with cross # build using crossgcc (without libgcc_eh)
#
# TODO:
+# - look at locale fixes/updates in bugzilla
+# - usable persitent storage in nscd:
+# - change persistent storage paths to /var/lib/nscd (to be FHS 2.3 compliant)
+# (see glibc/nscd/nscd.h)
+# - create nscd user, use it in nscd.conf (see -pld.patch)
+# [OLD]
# - localedb-gen man pages(?)
# - fix what trojan broke while upgreading (getaddrinfo-workaround)
-# - fix ld.so.conf (while upgrading glibc it do NOW mv ld.so.conf ld.so.conf.rpmsave)
-#
-# WARNING:
-# posix zoneinfo dir removed, /etc/rc.d/init.d/timezone must be changed
-# in order to use this version!
+# - math/{test-fenv,test-tgmath,test-float,test-ifloat},
+# linuxthreads/tst-cancel8, debug/backtrace-tst(SEGV) fail on alpha
+# - problem compiling with --enable-bounded (must be reported to libc-alpha)
+# (is this comment still valid???)
#
%{!?min_kernel:%global min_kernel 2.4.6}
-
-%if %{with nptl}
-# it seems that nptl uses cmpxchgl (available since i486) on x86
-%ifarch i486 i586 i686 pentium3 pentium4 athlon amd64 ia64 s390 s390x sparcv9 ppc ppc64
%if "%{min_kernel}" < "2.6.0"
-%global min_kernel 2.6.0
-%endif
-# NPTL requires TLS
-%define with_tls 1
+%global nptl_min_kernel 2.6.0
%else
-%undefine with_nptl
-%endif
+%global nptl_min_kernel %{min_kernel}
%endif
%if %{with tls}
-%ifnarch %{ix86} amd64 ia64 s390 s390x sparc sparcv9 ppc ppc64
+# sparc temporarily removed (broken)
+%ifnarch %{ix86} amd64 ia64 alpha s390 s390x sparc64 sparcv9 ppc ppc64
%undefine with_tls
%endif
%endif
+%if %{with nptl}
+# on x86 uses cmpxchgl (available since i486)
+# on sparc only sparcv9 is supported
+%ifnarch i486 i586 i686 pentium3 pentium4 athlon amd64 ia64 alpha s390 s390x sparc64 sparcv9 ppc ppc64
+%undefine with_nptl
+%else
+%if %{without tls}
+%undefine with_nptl
+%endif
+%endif
+%endif
+
%ifarch sparc64
%undefine with_memusage
%endif
+%if %{with linuxthreads} && %{with nptl}
+%define with_dual 1
+%endif
+
%define llh_version 7:2.6.6.0
-%define _snap 20040623
Summary: GNU libc
Summary(de): GNU libc
Summary(uk): GNU libc ×ÅÒÓ¦§ 2.3
Name: glibc
Version: 2.3.4
-Release: 0.%{_snap}.1%{?with_nptl:+nptl}
+Release: 0.99999999.2
Epoch: 6
License: LGPL
Group: Libraries
-#Source0: ftp://sources.redhat.com/pub/glibc/releases/%{name}-%{version}.tar.bz2
-Source0: %{name}-%{_snap}.tar.bz2
-# Source0-md5: a3632078c6a578c135d352d017180c82
-#Source1: ftp://sources.redhat.com/pub/glibc/releases/%{name}-linuxthreads-%{version}.tar.bz2
-#Source1: %{name}-linuxthreads-2.3.3.tar.bz2
+Source0: ftp://sources.redhat.com/pub/glibc/releases/%{name}-%{version}.tar.bz2
+# Source0-md5: 174ac5ed4f2851fcc866a3bac1e4a6a5
+Source1: ftp://sources.redhat.com/pub/glibc/releases/%{name}-linuxthreads-%{version}.tar.bz2
+# Source1-md5: 7a199cd4965eb5622163756ae64358fe
Source2: nscd.init
Source3: nscd.sysconfig
Source4: nscd.logrotate
#Source6: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
Source6: %{name}-non-english-man-pages.tar.bz2
# Source6-md5: 6159f0a9b6426b5f6fc1b0d8d21b9b76
-# borrowed from util-linux
Source7: %{name}-localedb-gen
Patch0: %{name}-info.patch
Patch1: %{name}-pl.po-update.patch
Patch4: %{name}-linuxthreads-lock.patch
Patch5: %{name}-pthread_create-manpage.patch
Patch6: %{name}-paths.patch
-Patch7: %{name}-i786.patch
-Patch8: %{name}-postshell.patch
-Patch9: %{name}-missing-nls.patch
-Patch10: %{name}-java-libc-wait.patch
-Patch11: %{name}-lthrds_noomit.patch
-Patch12: %{name}-no_opt_override.patch
-# this is broken (hardcoded /usr/src/linux)
-Patch13: %{name}-kernel_includes.patch
-Patch14: %{name}-includes.patch
-Patch15: %{name}-soinit-EH_FRAME.patch
-Patch16: %{name}-sparc-errno_fix.patch
-Patch17: %{name}-csu-quotes.patch
-Patch18: %{name}-tests-noproc.patch
-Patch19: %{name}-new-charsets.patch
-Patch20: %{name}-sr_CS.patch
-Patch21: %{name}-alpha-relro.patch
-Patch22: %{name}-sparc64-dl-machine.patch
-# PaX
-Patch30: %{name}-pax_iconvconfig.patch
-Patch31: %{name}-pax_dl-execstack.patch
+Patch7: %{name}-postshell.patch
+Patch8: %{name}-missing-nls.patch
+Patch9: %{name}-java-libc-wait.patch
+Patch10: %{name}-lthrds_noomit.patch
+Patch11: %{name}-no_opt_override.patch
+Patch12: %{name}-includes.patch
+Patch13: %{name}-soinit-EH_FRAME.patch
+Patch14: %{name}-sparc-errno_fix.patch
+Patch15: %{name}-csu-quotes.patch
+Patch16: %{name}-tests-noproc.patch
+Patch17: %{name}-new-charsets.patch
+Patch18: %{name}-sr_CS.patch
+Patch19: %{name}-sparc64-dl-machine.patch
+Patch20: %{name}-tzfile-noassert.patch
+Patch21: %{name}-morelocales.patch
+Patch22: %{name}-locale_ZA.patch
+Patch23: %{name}-locale_fixes.patch
+Patch24: %{name}-ZA_collate.patch
+Patch25: %{name}-tls_fix.patch
+Patch26: %{name}-nscd.patch
+Patch27: %{name}-iconvconfig-nxstack.patch
+Patch28: %{name}-gcc4.patch
+Patch29: %{name}-cross-gcc_eh.patch
+# PaX hack (dropped)
+#Patch30: %{name}-pax_dl-execstack.patch
URL: http://www.gnu.org/software/libc/
BuildRequires: automake
-BuildRequires: binutils >= 2.15.90.0.3
+BuildRequires: binutils >= 2:2.15.90.0.3
BuildRequires: gcc >= 3.2
+%ifarch ppc ppc64 sparc sparcv9 sparc64
+%if %{with nptl} || %{with __thread}
+BuildRequires: gcc >= 5:3.4
+%endif
+%endif
%{?with_memusage:BuildRequires: gd-devel >= 2.0.1}
BuildRequires: gettext-devel >= 0.10.36
-%if %{with kernelheaders}
-%{?with_dist_kernel:BuildRequires: kernel-headers < 2.5}
-%else
+%if %{without kernelheaders}
BuildRequires: linux-libc-headers >= %{llh_version}
%endif
+%{?with_selinux:BuildRequires: libselinux-devel >= 1.18}
BuildRequires: perl-base
BuildRequires: rpm-build >= 4.3-0.20030610.28
BuildRequires: rpm-perlprov
+BuildRequires: rpmbuild(macros) >= 1.159
BuildRequires: sed >= 4.0.5
BuildRequires: texinfo
AutoReq: false
PreReq: basesystem
Requires: glibc-misc = %{epoch}:%{version}-%{release}
%{?with_tls:Provides: glibc(tls)}
-Provides: ld.so.2
Provides: ldconfig
Provides: /sbin/ldconfig
Obsoletes: %{name}-common
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define debugcflags -O1 -g
-%ifarch sparc64
-%define specflags_sparc64 -mvis -fcall-used-g6
-%define _libdir /usr/lib64
-%endif
+# avoid -s here (ld.so must not be stripped to allow any program debugging)
+%define rpmldflags %{nil}
+%define specflags_sparc64 -mcpu=ultrasparc -mvis -fcall-used-g6
+# we don't want perl dependency in glibc-devel
+%define _noautoreqfiles %{_bindir}/mtrace
# hack: don't depend on rpmlib(PartialHardlinkSets) for easier upgrade from Ra
# (hardlinks here are unlikely to be "partial"... and rpm 4.0.2 from Ra was
# patched not to crash on partial hardlinks too)
%define _hack_dontneed_PartialHardlinkSets 1
+%define _noautochrpath .*\\(ldconfig\\|sln\\)
+%if %{with kernelheaders}
+%define sysheaders %{_kernelsrcdir}/include
+%else
+%define sysheaders %{_includedir}
+%endif
%description
Contains the standard libraries that are used by multiple programs on
%description -l pl
W pakiecie znajduj± siê podstawowe biblioteki, u¿ywane przez ró¿ne
programy w Twoim systemie. U¿ywanie przez programy bibliotek z tego
-pakietu oszczêdza miejsce na dysku i pamiêæ. Wiekszo¶æ kodu
+pakietu oszczêdza miejsce na dysku i pamiêæ. Wiêkszo¶æ kodu
systemowego jest usytuowane w jednym miejscu i dzielone miêdzy wieloma
programami. Pakiet ten zawiera bardzo wa¿ny zbiór bibliotek
standardowych, wspó³dzielonych (dynamicznych) bibliotek C i
Summary(pl): Narzêdzia i dane u¿ywane przez glibc
Group: Development/Libraries
AutoReq: false
-Requires: %{name} = %{epoch}:%{version}-%{release}
+PreReq: %{name} = %{epoch}:%{version}-%{release}
%description misc
Utilities and data used by glibc.
Requires: %{name} = %{epoch}:%{version}-%{release}
%{!?with_kernelheaders:Requires: linux-libc-headers >= %{llh_version}}
Obsoletes: libiconv-devel
+Obsoletes: glibc-headers
%description devel
To develop programs which use the standard C libraries (which nearly
Summary(uk): ëÅÛÕÀÞÉÊ ÄÅÍÏÎ ÓÅ×¦Ó¦× ¦ÍÅÎ
Group: Networking/Daemons
PreReq: rc-scripts >= 0.2.0
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
Requires(post,preun): /sbin/chkconfig
Requires(post): fileutils
+Requires(postun): /usr/sbin/groupdel
+Requires(postun): /usr/sbin/userdel
Requires: %{name} = %{epoch}:%{version}-%{release}
+%{?with_selinux:Requires: libselinux >= 1.18}
+Provides: group(nscd)
+Provides: user(nscd)
%description -n nscd
nscd caches name service lookups; it can dramatically improve
-performance with NIS+, and may help with DNS as well. You cannot use
-nscd with 2.0 kernels, due to bugs in the kernel-side thread support.
-nscd happens to hit these bugs particularly hard.
+performance with NIS+, and may help with DNS as well.
%description -n nscd -l es
nscd guarda las peticiones del servicio de nombres en una caché; eso
puede aumentar drásticamente las prestaciones de NIS+, y también puede
-ayudar con DNS. No puede usar nscd con núcleos 2.0, por contener éstos
-errores en el soporte de hilos. Resulta que estos errores impactan el
-nscd de manera realmente grave.
+ayudar con DNS.
%description -n nscd -l ja
Nscd ¤Ï¥Í¡¼¥à¥µ¡¼¥Ó¥¹»²¾È¤ò¥¥ã¥Ã¥·¥å¤·¡¢NIS+ ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò
-¥É¥é¥Þ¥Æ¥£¥Ã¥¯¤Ë²þÁ±¤¹¤ë¤³¤È¤¬¤Ç¤¡¢DNS ¤òƱÍͤËÊä½õ¤·¤Þ¤¹¡£ 2.0
-¥«¡¼¥Í¥ë¤Ç nscd ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤½¤ì¤Ï¡¢¥«¡¼¥Í¥ë¦¤Î¥¹¥ì¥Ã¥É¥µ¥Ý¡¼¥È¤Ë¥Ð¥°¤¬¤¢¤ë¤«¤é¤Ç¤¹¡£ÉÔ¹¬¤Ê¤³¤È¤Ë¡¢
-nscd ¤Ï¤³¤ì¤é¤Î¥Ð¥°¤ËÆäˤϤ²¤·¤¯¤¢¤¿¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
+¥É¥é¥Þ¥Æ¥£¥Ã¥¯¤Ë²þÁ±¤¹¤ë¤³¤È¤¬¤Ç¤¡¢DNS ¤òƱÍͤËÊä½õ¤·¤Þ¤¹¡£
%description -n nscd -l pl
nscd zapamiêtuje zapytania i odpowiedzi NIS oraz DNS. Pozwala
-drastycznie poprawiæ szybko¶æ dzia³ania NIS+. Nie jest mo¿liwe
-u¿ywanie nscd z j±drami serii 2.0.x z powodu b³êdów po stronie j±dra w
-obs³udze w±tków.
+drastycznie poprawiæ szybko¶æ dzia³ania NIS+.
%description -n nscd -l ru
nscd ËÜÛÉÒÕÅÔ ÒÅÚÕÌØÔÁÔÙ ÚÁÐÒÏÓÏ× Ë ÓÅÒ×ÉÓÁÍ ÉÍÅÎ; ÜÔÏ ÍÏÖÅÔ ÒÅÚËÏ
Summary(pl): Kod ¼ród³owy bazy locale
Group: Daemons
Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: gzip
Requires: sed
%description -n localedb-src
Summary(tr): Ölçüm desteði olan glibc
Summary(uk): GNU libc Ú Ð¦ÄÔÒÉÍËÏÀ ÐÒÏÆÁÊÌÅÒÁ
Group: Development/Libraries/Libc
-Obsoletes: libc-profile
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
+Obsoletes: libc-profile
%description profile
When programs are being profiled using gprof, they must use these
%description pic -l pl
Archiwum PIC biblioteki GNU C zawiera archiwaln± bibliotekê (plik ar)
-z³o¿on± z pojedyñczych obiektów wspó³dzielonych. U¿ywana jest do
+z³o¿on± z pojedynczych obiektów wspó³dzielonych. U¿ywana jest do
tworzenia biblioteki bêd±cej mniejszym podzestawem standardowej
biblioteki wspó³dzielonej libc.
Summary(es): GNU libc - bibliotecas de 64 bits
Summary(pl): GNU libc - biblioteki 64-bitowe
Group: Libraries
-%ifarch amd64
+%ifarch amd64 ppc64 s390x sparc64
Provides: glibc = %{epoch}:%{version}-%{release}
Requires: glibc-misc = %{epoch}:%{version}-%{release}
%else
Statyczne 64-bitowe biblioteki GNU libc.
%prep
-#setup -q -a 1 -n libc
-%setup -q -n libc
+%setup -q -a1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
-%patch11 -p1
# don't know, if it is good idea, for brave ones
-#%patch12 -p1
-%{?with_kernelheaders:%patch13}
-%{?!with_kernelheaders:%patch14 -p1}
+#%patch11 -p1
+%{!?with_kernelheaders:%patch12 -p1}
+%patch13 -p1
+%patch14 -p0
%patch15 -p1
-%patch16 -p0
+%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
-
-%patch30 -p1
-%patch31 -p1
+%patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
+%patch28 -p1
+%{?with_cross:%patch29 -p1}
chmod +x scripts/cpp
+# i786 (aka pentium4) hack
+cd nptl/sysdeps/i386 && ln -s i686 i786 && cd -
+cd nptl/sysdeps/unix/sysv/linux/i386 && ln -s i686 i786 && cd -
+
%build
# Build glibc
-cp %{_datadir}/automake/config.sub .
-cp %{_datadir}/automake/config.sub scripts
+cp -f /usr/share/automake/config.sub scripts
%{__aclocal}
%{__autoconf}
-# i786 (aka pentium4) hack
-cd nptl/sysdeps/i386 && ln -s i686 i786 && cd -
-cd nptl/sysdeps/unix/sysv/linux/i386 && ln -s i686 i786 && cd -
-#
-[ -d builddir ] || mkdir builddir
+rm -rf builddir
+install -d builddir
cd builddir
-# avoid stripping ld.so by -s in rpmldflags
-LDFLAGS=" " ; export LDFLAGS
+%ifarch sparc64
+CC="%{__cc} -m64 -mcpu=ultrasparc -mvis -fcall-used-g6"
+%endif
+%if %{with linuxthreads}
../%configure \
--enable-kernel="%{min_kernel}" \
--%{?with_omitfp:en}%{!?with_omitfp:dis}able-omitfp \
- %{?with_tls:--with-tls} \
-%if %{with nptl}
- --enable-add-ons=nptl \
- --disable-profile \
-%else
+ --with%{!?with___thread:out}-__thread \
+ --with-headers=%{sysheaders} \
+ --with%{!?with_selinux:out}-selinux \
+ --with%{!?with_tls:out}-tls \
--enable-add-ons=linuxthreads \
- --enable-profile \
+ --enable-profile
+%{__make}
%endif
-%if %{with kernelheaders}
- CPPFLAGS="-I%{_kernelsrcdir}/include" \
- --with-headers=%{_kernelsrcdir}/include
-%else
- CPPFLAGS="-I%{_includedir}" \
- --with-headers=%{_includedir}
+%if %{with nptl}
+%if %{with dual}
+cd ..
+rm -rf builddir-nptl
+install -d builddir-nptl
+cd builddir-nptl
%endif
+../%configure \
+ --enable-kernel="%{nptl_min_kernel}" \
+ --%{?with_omitfp:en}%{!?with_omitfp:dis}able-omitfp \
+ --with-headers=%{sysheaders} \
+ --with%{!?with_selinux:out}-selinux \
+ --with-tls \
+ --enable-add-ons=nptl \
+ --enable-profile
+# simulate cross-compiling so we can perform dual builds on 2.4.x kernel
+%{__make} \
+ %{?with_dual:cross-compiling=yes}
+%endif
+cd ..
-# problem compiling with --enable-bounded (must be reported to libc-alpha)
-
-%{__make} %{?parallelmkflags}
+%if %{with linuxthreads}
+%{__make} -C linuxthreads/man
+%endif
%if %{with tests}
+for d in builddir %{?with_tests_nptl:builddir-nptl} ; do
+cd $d
env LANGUAGE=C LC_ALL=C \
%{__make} tests 2>&1 | awk '
BEGIN { file = "" }
{
- if (($0 ~ /\*\*\* \[.*\.out\] Error/) && (file == "")) {
+ if (($0 ~ /\*\*\* \[.*\.out\] Error/) && ($0 !~ /annexc/) && (file == "")) {
file=$0;
gsub(/.*\[/, NIL, file);
gsub(/\].*/, NIL, file);
print $0;
}
END { if (file != "") { print "ERROR OUTPUT FROM " file; system("cat " file); exit(1); } }'
+cd ..
+done
%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_mandir}/man{3,8},/var/log,/var/run/nscd}
+install -d $RPM_BUILD_ROOT{/etc/{logrotate.d,rc.d/init.d,sysconfig},%{_mandir}/man{3,8},/var/log,/var/{lib,run}/nscd}
cd builddir
-
env LANGUAGE=C LC_ALL=C \
%{__make} install \
- %{?parallelmkflags} \
install_root=$RPM_BUILD_ROOT \
infodir=%{_infodir} \
mandir=%{_mandir}
+%if %{with localedb}
env LANGUAGE=C LC_ALL=C \
%{__make} localedata/install-locales \
- %{?parallelmkflags} \
install_root=$RPM_BUILD_ROOT
+%endif
PICFILES="libc_pic.a libc.map
math/libm_pic.a libm.map
install elf/sofini.os $RPM_BUILD_ROOT%{_libdir}/sofini.o
install elf/postshell $RPM_BUILD_ROOT/sbin
+cd ..
+
+%if %{with dual}
+env LANGUAGE=C LC_ALL=C \
+%{__make} -C builddir-nptl install \
+ cross-compiling=yes \
+ install_root=$RPM_BUILD_ROOT/nptl
+
+install -d $RPM_BUILD_ROOT{/%{_lib}/tls,%{_libdir}/nptl,%{_includedir}/nptl}
+for f in libc libm libpthread libthread_db librt; do
+ mv -f $RPM_BUILD_ROOT/nptl/%{_lib}/${f}[-.]* $RPM_BUILD_ROOT/%{_lib}/tls
+done
+$RPM_BUILD_ROOT/sbin/ldconfig -n $RPM_BUILD_ROOT/%{_lib}/tls
+
+for f in libc.so libpthread.so ; do
+ cat $RPM_BUILD_ROOT/nptl%{_libdir}/$f | sed \
+ -e "s|/libc.so.6|/tls/libc.so.6|g" \
+ -e "s|/libpthread.so.0|/tls/libpthread.so.0|g" \
+ -e "s|/libpthread_nonshared.a|/nptl/libpthread_nonshared.a|g" \
+ > $RPM_BUILD_ROOT%{_libdir}/nptl/$f
+done
+for f in libc.a libpthread.a libpthread_nonshared.a; do
+ mv -f $RPM_BUILD_ROOT/nptl%{_libdir}/$f $RPM_BUILD_ROOT%{_libdir}/nptl
+done
+cd $RPM_BUILD_ROOT/nptl%{_prefix}/include
+ for f in `find . -type f`; do
+ if ! [ -f $RPM_BUILD_ROOT%{_prefix}/include/$f ] \
+ || ! cmp -s $f $RPM_BUILD_ROOT%{_prefix}/include/$f ; then
+ install -d $RPM_BUILD_ROOT%{_prefix}/include/nptl/`dirname $f`
+ cp -a $f $RPM_BUILD_ROOT%{_prefix}/include/nptl/$f
+ fi
+ done
+cd -
+rm -rf $RPM_BUILD_ROOT/nptl
+%endif
%{?with_memusage:mv -f $RPM_BUILD_ROOT/%{_lib}/libmemusage.so $RPM_BUILD_ROOT%{_libdir}}
-%ifnarch sparc64
mv -f $RPM_BUILD_ROOT/%{_lib}/libpcprofile.so $RPM_BUILD_ROOT%{_libdir}
-%endif
-%if %{without nptl}
-%{__make} -C ../linuxthreads/man
-install ../linuxthreads/man/*.3thr $RPM_BUILD_ROOT%{_mandir}/man3
+%if %{with linuxthreads}
+install linuxthreads/man/*.3thr $RPM_BUILD_ROOT%{_mandir}/man3
%endif
rm -rf $RPM_BUILD_ROOT%{_datadir}/zoneinfo/{localtime,posixtime,posixrules,posix/*}
rm -f $RPM_BUILD_ROOT%{_sysconfdir}/localtime
# make symlinks across top-level directories absolute
-for l in anl BrokenLocale crypt dl m nsl pthread resolv rt thread_db util ; do
+for l in anl BrokenLocale crypt dl m nsl resolv rt thread_db util ; do
rm -f $RPM_BUILD_ROOT%{_libdir}/lib${l}.so
ln -sf /%{_lib}/`cd $RPM_BUILD_ROOT/%{_lib} ; echo lib${l}.so.*` $RPM_BUILD_ROOT%{_libdir}/lib${l}.so
done
install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/nscd
install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/nscd
install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/nscd
-install ../nscd/nscd.conf $RPM_BUILD_ROOT%{_sysconfdir}
-install ../nss/nsswitch.conf $RPM_BUILD_ROOT%{_sysconfdir}
+install nscd/nscd.conf $RPM_BUILD_ROOT%{_sysconfdir}
+install nss/nsswitch.conf $RPM_BUILD_ROOT%{_sysconfdir}
bzip2 -dc %{SOURCE5} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
bzip2 -dc %{SOURCE6} | tar xf - -C $RPM_BUILD_ROOT%{_mandir}
rm -f $RPM_BUILD_ROOT%{_mandir}/hu/man7/man.7
:> $RPM_BUILD_ROOT/var/log/nscd
+:> $RPM_BUILD_ROOT/var/lib/nscd/passwd
+:> $RPM_BUILD_ROOT/var/lib/nscd/group
+:> $RPM_BUILD_ROOT/var/lib/nscd/hosts
-rm -rf ../documentation
-install -d ../documentation
+rm -rf documentation
+install -d documentation
-%if %{without nptl}
-cp -f ../linuxthreads/ChangeLog ../documentation/ChangeLog.threads
-cp -f ../linuxthreads/Changes ../documentation/Changes.threads
-cp -f ../linuxthreads/README ../documentation/README.threads
+%if %{with linuxthreads}
+for f in ChangeLog Changes README ; do
+ cp -f linuxthreads/$f documentation/${f}.linuxthreads
+done
+%endif
+%if %{with nptl}
+for f in ANNOUNCE ChangeLog DESIGN-{barrier,condvar,rwlock,sem}.txt TODO{,-kernel,-testing} ; do
+ cp -f nptl/$f documentation/${f}.nptl
+done
%endif
-cp -f ../crypt/README.ufc-crypt ../documentation/
+cp -f crypt/README.ufc-crypt documentation
-cp -f ../ChangeLog* ../documentation
+cp -f ChangeLog* documentation
rm -f $RPM_BUILD_ROOT%{_libdir}/libnss_*.so
# strip ld.so with --strip-debug only (other ELFs are stripped by rpm):
-%ifnarch sparc64
%{!?debug:strip -g -R .comment -R .note $RPM_BUILD_ROOT/%{_lib}/ld-*.so}
-%endif
# Collect locale files and mark them with %%lang()
-rm -f ../glibc.lang
-echo '%defattr(644,root,root,755)' > ../glibc.lang
+rm -f glibc.lang
+echo '%defattr(644,root,root,755)' > glibc.lang
for i in $RPM_BUILD_ROOT%{_datadir}/locale/* $RPM_BUILD_ROOT%{_libdir}/locale/* ; do
if [ -d $i ]; then
lang=`echo $i | sed -e 's/.*locale\///' -e 's/\/.*//'`
twochar=1
# list of long %%lang values we do support
- for j in de_AT de_BE de_CH de_LU es_AR es_MX ja_JP.SJIS ko_KR.utf8 pt_BR \
+ for j in de_AT de_BE de_CH de_LU es_AR es_MX pt_BR \
zh_CN zh_CN.gbk zh_HK zh_TW ; do
if [ $j = "$lang" ]; then
twochar=
fi
fi
dir=`echo $i | sed "s#$RPM_BUILD_ROOT##"`
- echo "%lang($lang) $dir" >> ../glibc.lang
+ echo "%lang($lang) $dir" >> glibc.lang
fi
done
# XXX: to be added when become supported by glibc
-# ia,li (used by GNOME)
-# nso,ss,ven (used by KDE)
+# tk, yo (used by GNOME)
+# ven -> ve (used by KDE)
# NOTES:
# bn is used for bn_BD or bn_IN?
# omitted here - already existing (with libc.mo):
# be,ca,cs,da,de,el,en_GB,es,fi,fr,gl,hr,hu,it,ja,ko,nb,nl,pl,pt_BR,sk,sv,tr,zh_CN,zh_TW
-for i in af am ar az bg bn br bs cy de_AT en en_AU eo es_AR es_MX et eu fa ga \
- gr he hi id is ja_JP.SJIS ka kn lg lt lv mk ml mn ms mt nn pt ro ru \
- se sl sq sr sr@Latn ta tg th uk uz vi wa xh yi zu ; do
+for i in af am ang ar az bg bn br bs cy de_AT en en@boldquot en@quot en_AU \
+ en_CA en_US eo es_AR es_MX et eu fa fo ga gu he hi hsb ia id is ka kn \
+ leet lg li lo lt lv mi mk ml mn mr ms mt nds ne nn nso or pa pt ro ru se \
+ sl sq sr sr@Latn sr@ije ss ta tg th tlh uk uz ve vi wa xh yi zu ; do
if [ ! -d $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES ]; then
install -d $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES
lang=`echo $i | sed -e 's/_.*//'`
- echo "%lang($lang) %{_datadir}/locale/$i" >> ../glibc.lang
+ echo "%lang($lang) %{_datadir}/locale/$i" >> glibc.lang
fi
done
+cd $RPM_BUILD_ROOT%{_datadir}/locale
+ln -s zh_CN zh_SG
+ln -s zh_CN zh_HK
+cd -
# localedb-gen infrastructure
install %{SOURCE7} $RPM_BUILD_ROOT%{_bindir}/localedb-gen
-install ../localedata/SUPPORTED $RPM_BUILD_ROOT%{_datadir}/i18n
+install localedata/SUPPORTED $RPM_BUILD_ROOT%{_datadir}/i18n
# shutup check-files
rm -f $RPM_BUILD_ROOT%{_mandir}/README.*
# we don't support kernel without ptys support
rm -f $RPM_BUILD_ROOT%{_libdir}/pt_chown
-# no longer supported (/dev/null has the same, but expected behaviour)
-rm -f $RPM_BUILD_ROOT%{_bindir}/glibcbug
-
%clean
rm -rf $RPM_BUILD_ROOT
# don't run iconvconfig in %%postun -n iconv because iconvconfig doesn't exist
# when %%postun is run
-%ifnarch sparc64
-%ifarch amd64
+%ifarch amd64 ppc64 s390x sparc64
%post -n %{name}64 -p /sbin/postshell
%else
%post -p /sbin/postshell
/sbin/ldconfig
-/sbin/telinit u
-%ifarch amd64
+%ifarch amd64 ppc64 s390x sparc64
%postun -n %{name}64 -p /sbin/postshell
%else
%postun -p /sbin/postshell
/sbin/ldconfig
-/sbin/telinit u
-%ifarch amd64
+%ifarch amd64 ppc64 s390x sparc64
%triggerpostun -n %{name}64 -p /sbin/postshell -- glibc-misc < 6:2.3.4-0.20040505.1
%else
%triggerpostun -p /sbin/postshell -- glibc-misc < 6:2.3.4-0.20040505.1
%postun devel
[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+%pre -n nscd
+if [ -n "`/usr/bin/getgid nscd`" ]; then
+ if [ "`/usr/bin/getgid nscd`" != "144" ]; then
+ echo "Error: group nscd doesn't have gid=144. Correct this before installing nscd." 1>&2
+ exit 1
+ fi
+else
+ /usr/sbin/groupadd -g 144 -r nscd
+fi
+if [ -n "`/bin/id -u nscd 2>/dev/null`" ]; then
+ if [ "`/bin/id -u nscd`" != "144" ]; then
+ echo "Error: user nscd doesn't have uid=144. Correct this before installing nscd." 1>&2
+ exit 1
+ fi
+else
+ /usr/sbin/useradd -u 144 -r -d /tmp -s /bin/false -c "nscd" -g nscd nscd 1>&2
+fi
+
%post -n nscd
/sbin/chkconfig --add nscd
touch /var/log/nscd
fi
/sbin/chkconfig --del nscd
fi
-%endif
-%ifnarch sparc64
-%ifarch amd64
+%postun -n nscd
+if [ "$1" = "0" ]; then
+ %userremove nscd
+ %groupremove nscd
+fi
+
+%ifarch amd64 ppc64 s390x sparc64
%files -n glibc64
%defattr(644,root,root,755)
%else
%attr(755,root,root) /sbin/ldconfig
# ld* and libc.so.6 SONAME symlinks must be in package because of
# chicken-egg problem (postshell is dynamically linked with libc);
-# ld-*.so SONAME is ld.so.1 on ppc, ld-linux.so.2 on other archs
+# ld-*.so SONAME is:
+# ld.so.1 on ppc
+# ld64.so.1 on ppc64,s390x
+# ld-linux-ia64.so.2 on ia64
+# ld-linux-x86-64.so.2 on amd64
+# ld-linux.so.2 on other archs
%attr(755,root,root) /%{_lib}/ld*
%attr(755,root,root) /%{_lib}/libanl*
%attr(755,root,root) /%{_lib}/libdl*
%attr(755,root,root) /%{_lib}/libnsl*
%attr(755,root,root) /%{_lib}/lib[BScmprtu]*
-%dir %{_libdir}/locale
-%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/ld.so.conf
+%if %{with dual}
+%dir /%{_lib}/tls
+%attr(755,root,root) /%{_lib}/tls/lib[cmprt]*
+%endif
+%{?with_localedb:%dir %{_libdir}/locale}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ld.so.conf
%ghost %{_sysconfdir}/ld.so.cache
#%files -n nss_dns
%defattr(644,root,root,755)
%attr(755,root,root) /%{_lib}/libnss_files*.so*
-
%files misc -f %{name}.lang
%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/nsswitch.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nsswitch.conf
%config %{_sysconfdir}/rpc
%attr(755,root,root) /sbin/sln
%attr(755,root,root) %{_bindir}/catchsegv
+%attr(755,root,root) %{_bindir}/getconf
%attr(755,root,root) %{_bindir}/getent
%attr(755,root,root) %{_bindir}/iconv
%attr(755,root,root) %{_bindir}/ldd
-%ifnarch alpha ppc sparc64 amd64
+%ifarch %{ix86} m68k sparc sparcv9
%attr(755,root,root) %{_bindir}/lddlibc4
%endif
%attr(755,root,root) %{_bindir}/locale
%attr(755,root,root) %{_sbindir}/zdump
%attr(755,root,root) %{_sbindir}/zic
+%dir %{_libexecdir}/getconf
+%attr(755,root,root) %{_libexecdir}/getconf/*
+
%dir %{_datadir}/locale
%{_datadir}/locale/locale.alias
%{_datadir}/zoneinfo
%exclude %{_datadir}/zoneinfo/right
%{_mandir}/man1/catchsegv.1*
+%{_mandir}/man1/getconf.1*
%{_mandir}/man1/getent.1*
%{_mandir}/man1/iconv.1*
%{_mandir}/man1/ldd.1*
%defattr(644,root,root,755)
%doc documentation/* NOTES PROJECTS
%attr(755,root,root) %{_bindir}/gencat
-%attr(755,root,root) %{_bindir}/getconf
%attr(755,root,root) %{_bindir}/*prof*
%attr(755,root,root) %{_bindir}/*trace
+%attr(755,root,root) %{_libdir}/lib[!cmp]*.so
+%attr(755,root,root) %{_libdir}/libcrypt.so
+%attr(755,root,root) %{_libdir}/libm.so
+%attr(755,root,root) %{_libdir}/libpcprofile.so
+%attr(755,root,root) %{_libdir}/*crt*.o
+# ld scripts
+%{_libdir}/libc.so
+%{_libdir}/libpthread.so
+
+%{_libdir}/libbsd-compat.a
+%{_libdir}/libbsd.a
+%{_libdir}/libc_nonshared.a
+%{_libdir}/libg.a
+%{_libdir}/libieee.a
+%{_libdir}/libpthread_nonshared.a
+%{_libdir}/librpcsvc.a
+
+%if %{with dual}
+%dir %{_libdir}/nptl
+# ld scripts
+%{_libdir}/nptl/libc.so
+%{_libdir}/nptl/libpthread.so
+%{_libdir}/nptl/libpthread_nonshared.a
+%{_includedir}/nptl
+%endif
+
%{_includedir}/*.h
%ifarch alpha
%{_includedir}/alpha
%{_infodir}/libc.info*
-%attr(755,root,root) %{_libdir}/lib[!m]*.so
-%attr(755,root,root) %{_libdir}/libm.so
-%attr(755,root,root) %{_libdir}/*crt*.o
-%{_libdir}/libbsd-compat.a
-%{_libdir}/libbsd.a
-%{_libdir}/libc_nonshared.a
-%{_libdir}/libg.a
-%{_libdir}/libieee.a
-%{_libdir}/libpthread_nonshared.a
-%{_libdir}/librpcsvc.a
-
-%{_mandir}/man1/getconf.1*
%{_mandir}/man1/sprof.1*
%{_mandir}/man3/*
%lang(cs) %{_mandir}/cs/man3/*
%files -n nscd
%defattr(644,root,root,755)
-%attr(640,root,root) %config %verify(not md5 size mtime) /etc/sysconfig/nscd
-%attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/nscd.*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nscd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nscd.*
%attr(754,root,root) /etc/rc.d/init.d/nscd
%attr(755,root,root) %{_sbindir}/nscd*
-%attr(640,root,root) /etc/logrotate.d/nscd
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/nscd
%attr(640,root,root) %ghost /var/log/nscd
%dir /var/run/nscd
+%dir /var/lib/nscd
+%attr(600,root,root) %ghost /var/lib/nscd/passwd
+%attr(600,root,root) %ghost /var/lib/nscd/group
+%attr(600,root,root) %ghost /var/lib/nscd/hosts
%{_mandir}/man5/nscd.conf.5*
%{_mandir}/man8/nscd.8*
%{_mandir}/man8/nscd_nischeck.8*
%{_datadir}/i18n
%{_mandir}/man1/localedef.1*
+%if %{with localedb}
%files localedb-all
%defattr(644,root,root,755)
%{_libdir}/locale/locale-archive
+%endif
%files -n iconv
%defattr(644,root,root,755)
%{_libdir}/libresolv.a
%{_libdir}/librt.a
%{_libdir}/libutil.a
+%if %{with dual}
+%{_libdir}/nptl/libc.a
+%{_libdir}/nptl/libpthread.a
+%endif
-%if %{without nptl}
%files profile
%defattr(644,root,root,755)
+#{?with_dual:%{_libdir}/nptl/lib*_p.a}
%{_libdir}/lib*_p.a
-%endif
%files pic
%defattr(644,root,root,755)
%{_libdir}/lib*.map
%{_libdir}/soinit.o
%{_libdir}/sofini.o
-
-%else
-
-%files -n glibc64
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/ld-*
-%attr(755,root,root) %{_libdir}/libanl*
-%attr(755,root,root) %{_libdir}/libdl*
-%attr(755,root,root) %{_libdir}/libnsl*
-%attr(755,root,root) %{_libdir}/lib[BScmprtu]*
-%attr(755,root,root) %{_libdir}/libnss_dns*.so*
-%attr(755,root,root) %{_libdir}/libnss_files*.so*
-
-%files -n glibc64-devel
-%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib[!m]*.so
-%attr(755,root,root) %{_libdir}/libm.so
-%attr(755,root,root) %{_libdir}/*crt*.o
-%{_libdir}/libbsd-compat.a
-%{_libdir}/libbsd.a
-%{_libdir}/libc_nonshared.a
-%{_libdir}/libg.a
-%{_libdir}/libieee.a
-%{_libdir}/libpthread_nonshared.a
-%{_libdir}/librpcsvc.a
-
-%files -n glibc64-static
-%defattr(644,root,root,755)
-%{_libdir}/libanl.a
-%{_libdir}/libBrokenLocale.a
-%{_libdir}/libc.a
-%{_libdir}/libcrypt.a
-%{_libdir}/libdl.a
-%{_libdir}/libm.a
-%{_libdir}/libmcheck.a
-%{_libdir}/libnsl.a
-%{_libdir}/libpthread.a
-%{_libdir}/libresolv.a
-%{_libdir}/librt.a
-%{_libdir}/libutil.a
-%endif