]> 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 e25ba6c7cb647fa8b07a44ff1beee7dccc81c8b1..10f68aeef7aef7e13a1c88cc67e637214bd7e2f3 100644 (file)
 #
 # 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)
@@ -120,10 +124,10 @@ Patch23:  %{name}-locale_fixes.patch
 Patch24:       %{name}-ZA_collate.patch
 Patch25:       %{name}-tls_fix.patch
 Patch26:       %{name}-nscd.patch
-Patch27:       %{name}-gcc4.patch
-Patch28:       %{name}-cross-gcc_eh.patch
-# PaX hacks (dropped)
-#Patch29:      %{name}-pax_iconvconfig.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
@@ -143,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
@@ -381,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
@@ -814,7 +828,8 @@ Statyczne 64-bitowe biblioteki GNU libc.
 %patch25 -p1
 %patch26 -p1
 %patch27 -p1
-%{?with_cross:%patch28 -p1}
+%patch28 -p1
+%{?with_cross:%patch29 -p1}
 
 chmod +x scripts/cpp
 
@@ -891,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 \
@@ -992,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
@@ -1113,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,6 +1169,12 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del nscd
 fi
 
+%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)
@@ -1162,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
@@ -1176,7 +1218,7 @@ 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
@@ -1400,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*
This page took 0.036562 seconds and 4 git commands to generate.