#
# 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)
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
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
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
%patch25 -p1
%patch26 -p1
%patch27 -p1
-%{?with_cross:%patch28 -p1}
+%patch28 -p1
+%{?with_cross:%patch29 -p1}
chmod +x scripts/cpp
%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 \
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
%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
/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)
%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
%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
%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*