]> git.pld-linux.org Git - packages/glibc.git/blobdiff - glibc.spec
- updated paths patch: set nscd persistent storage dir to /var/lib/nscd
[packages/glibc.git] / glibc.spec
index 02c8e5f9b7665af67be59e492258e7f493eb4e93..10f68aeef7aef7e13a1c88cc67e637214bd7e2f3 100644 (file)
 %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)
 # - 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 tls}
 # sparc temporarily removed (broken)
-%ifnarch %{ix86} amd64 ia64 alpha s390 s390x  sparcv9 ppc ppc64
+%ifnarch %{ix86} amd64 ia64 alpha s390 s390x sparc64 sparcv9 ppc ppc64
 %undefine      with_tls
 %endif
 %endif
 
 %if %{with nptl}
-# nptl on x86 uses cmpxchgl (available since i486)
-%ifnarch i486 i586 i686 pentium3 pentium4 athlon amd64 ia64 alpha s390 s390x sparcv9 ppc ppc64
+# 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}
@@ -61,7 +67,6 @@
 %endif
 
 %define                llh_version     7:2.6.6.0
-%define                _snap           20041122
 
 Summary:       GNU libc
 Summary(de):   GNU libc
@@ -74,15 +79,14 @@ Summary(tr):        GNU libc
 Summary(uk):   GNU libc ×ÅÒÓ¦§ 2.3
 Name:          glibc
 Version:       2.3.4
-Release:       0.%{_snap}.1.1
+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: f001b42f639d5030d2c4dd16803b393d
-#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
@@ -92,7 +96,6 @@ Source5:      %{name}-man-pages.tar.bz2
 #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
@@ -118,17 +121,23 @@ Patch20:  %{name}-tzfile-noassert.patch
 Patch21:       %{name}-morelocales.patch
 Patch22:       %{name}-locale_ZA.patch
 Patch23:       %{name}-locale_fixes.patch
-Patch24:       %{name}-LD_DEBUG.patch
-# PaX
-Patch25:       %{name}-pax_iconvconfig.patch
-Patch26:       %{name}-pax_dl-execstack.patch
-Patch27:       %{name}-sparc_comdat.patch
-Patch28:       %{name}-ia64_unwind.patch
-Patch29:       %{name}-ZA_collate.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: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 %{without kernelheaders}
@@ -138,6 +147,7 @@ BuildRequires:      linux-libc-headers >= %{llh_version}
 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
@@ -159,10 +169,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                debugcflags     -O1 -g
 # avoid -s here (ld.so must not be stripped to allow any program debugging)
 %define                rpmldflags      %{nil}
-%ifarch sparc64
-%define        specflags_sparc64       -mvis -fcall-used-g6
-%define                _libdir                 /usr/lib64
-%endif
+%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
@@ -316,6 +323,7 @@ Group:              Development/Libraries
 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
@@ -378,9 +386,18 @@ Summary(ru):       
 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
@@ -729,7 +746,7 @@ Summary:    GNU libc - 64-bit libraries
 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
@@ -781,8 +798,7 @@ Bibliotecas est
 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
@@ -808,14 +824,12 @@ Statyczne 64-bitowe biblioteki GNU libc.
 %patch21 -p1
 %patch22 -p1
 %patch23 -p1
-%patch24 -p0
-# DROP
-#%patch25 -p1
-# DROP
-#%patch26 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
 %patch27 -p1
 %patch28 -p1
-%patch29 -p1
+%{?with_cross:%patch29 -p1}
 
 chmod +x scripts/cpp
 
@@ -828,8 +842,12 @@ cd nptl/sysdeps/unix/sysv/linux/i386 && ln -s i686 i786 && cd -
 cp -f /usr/share/automake/config.sub scripts
 %{__aclocal}
 %{__autoconf}
+rm -rf builddir
 install -d builddir
 cd builddir
+%ifarch sparc64
+CC="%{__cc} -m64 -mcpu=ultrasparc -mvis -fcall-used-g6"
+%endif
 %if %{with linuxthreads}
 ../%configure \
        --enable-kernel="%{min_kernel}" \
@@ -845,6 +863,7 @@ cd builddir
 %if %{with nptl}
 %if %{with dual}
 cd ..
+rm -rf builddir-nptl
 install -d builddir-nptl
 cd builddir-nptl
 %endif
@@ -855,7 +874,7 @@ cd builddir-nptl
        --with%{!?with_selinux:out}-selinux \
        --with-tls \
         --enable-add-ons=nptl \
-       --disable-profile
+       --enable-profile
 # simulate cross-compiling so we can perform dual builds on 2.4.x kernel
 %{__make} \
        %{?with_dual:cross-compiling=yes}
@@ -887,7 +906,7 @@ done
 
 %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 \
@@ -948,9 +967,7 @@ 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 %{with linuxthreads}
 install linuxthreads/man/*.3thr                $RPM_BUILD_ROOT%{_mandir}/man3
@@ -990,6 +1007,9 @@ 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
@@ -1011,9 +1031,7 @@ 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
@@ -1079,8 +1097,7 @@ 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
@@ -1088,7 +1105,7 @@ rm -rf $RPM_BUILD_ROOT
 /sbin/ldconfig
 -/sbin/telinit u
 
-%ifarch amd64
+%ifarch amd64 ppc64 s390x sparc64
 %postun        -n %{name}64 -p /sbin/postshell
 %else
 %postun        -p /sbin/postshell
@@ -1096,7 +1113,7 @@ rm -rf $RPM_BUILD_ROOT
 /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
@@ -1114,6 +1131,24 @@ rm -rf $RPM_BUILD_ROOT
 %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
@@ -1133,10 +1168,14 @@ if [ "$1" = "0" ]; then
        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
@@ -1165,7 +1204,7 @@ fi
 %attr(755,root,root) /%{_lib}/tls/lib[cmprt]*
 %endif
 %{?with_localedb:%dir %{_libdir}/locale}
-%config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/ld.so.conf
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ld.so.conf
 %ghost %{_sysconfdir}/ld.so.cache
 
 #%files -n nss_dns
@@ -1179,15 +1218,16 @@ fi
 %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 amd64 ia64 ppc sparc64
+%ifarch %{ix86} m68k sparc sparcv9
 %attr(755,root,root) %{_bindir}/lddlibc4
 %endif
 %attr(755,root,root) %{_bindir}/locale
@@ -1198,12 +1238,16 @@ fi
 %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*
@@ -1324,7 +1368,6 @@ fi
 %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
 
@@ -1346,7 +1389,11 @@ fi
 %{_libdir}/librpcsvc.a
 
 %if %{with dual}
-%{_libdir}/nptl
+%dir %{_libdir}/nptl
+# ld scripts
+%{_libdir}/nptl/libc.so
+%{_libdir}/nptl/libpthread.so
+%{_libdir}/nptl/libpthread_nonshared.a
 %{_includedir}/nptl
 %endif
 
@@ -1376,7 +1423,6 @@ fi
 
 %{_infodir}/libc.info*
 
-%{_mandir}/man1/getconf.1*
 %{_mandir}/man1/sprof.1*
 %{_mandir}/man3/*
 %lang(cs) %{_mandir}/cs/man3/*
@@ -1396,13 +1442,17 @@ fi
 
 %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) %config(noreplace) %verify(not size mtime md5) /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*
@@ -1447,12 +1497,15 @@ fi
 %{_libdir}/libresolv.a
 %{_libdir}/librt.a
 %{_libdir}/libutil.a
+%if %{with dual}
+%{_libdir}/nptl/libc.a
+%{_libdir}/nptl/libpthread.a
+%endif
 
-%if %{with linuxthreads}
 %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)
@@ -1460,44 +1513,3 @@ fi
 %{_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
This page took 0.069732 seconds and 4 git commands to generate.