1 Summary: Single threaded NSCD (Name Service Caching Daemon)
6 Group: Networking/Daemons
7 Source0: http://busybox.net/~vda/unscd/nscd-%{version}.c
8 # Source0-md5: 846d108ed997a3cbd94fe953bea40a48
10 Source2: nscd.sysconfig
11 Source3: nscd.logrotate
13 Source5: http://svn.donarmstrong.com/deb_pkgs/unscd/trunk/debian/nscd.8
14 # Source5-md5: eac364084cae21114174404790dfc0df
15 Source6: nscd.tmpfiles
16 URL: http://busybox.net/~vda/unscd/
17 BuildRequires: rpmbuild(macros) >= 1.644
19 Requires(post): fileutils
20 Requires(post,preun): /sbin/chkconfig
21 Requires(postun): /usr/sbin/groupdel
22 Requires(postun): /usr/sbin/userdel
23 Requires(pre): /bin/id
24 Requires(pre): /usr/bin/getgid
25 Requires(pre): /usr/sbin/groupadd
26 Requires(pre): /usr/sbin/useradd
27 Requires: rc-scripts >= 0.4.1.26
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 # glibc private symbols
34 %define _noautoreq GLIBC_PRIVATE
37 A daemon which handles passwd, group and host lookups for running
38 programs and caches the results for the next query. You only need this
39 package if you are using slow Name Services like LDAP, NIS or NIS+.
41 This particular NSCD is a complete rewrite of the GNU glibc nscd which
42 is a single threaded server process which offloads all NSS lookups to
43 worker children; cache hits are handled by the parent, and only cache
44 misses start worker children, making the parent immune to resource
45 leaks, hangs, and crashes in NSS libraries.
47 It should mostly be a drop-in replacement for existing installs using
52 %{__sed} -ne '/Description:/,/\*\*\*/p' %{SOURCE0} > README
54 %{__sed} -e '/#define DEBUG_BUILD/ s,^,// ,' %{SOURCE0} > %{name}.c
57 %{__cc} -o %{name} %{rpmcflags} %{!?debug:-Os} %{rpmcppflags} -DDEBUG_BUILD=0%{?debug:1} %{rpmldflags} -Wall -Wunused-parameter -Wl,--sort-section -Wl,alignment -Wl,--sort-common %{name}.c
60 rm -rf $RPM_BUILD_ROOT
61 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8,/var/log,/var/run/nscd,/etc/{logrotate.d,rc.d/init.d,sysconfig},%{systemdtmpfilesdir}}
62 install -p %{name} $RPM_BUILD_ROOT%{_sbindir}/nscd
63 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nscd
64 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man8
65 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/nscd
66 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/nscd
67 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}
68 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/nscd.conf
69 : > $RPM_BUILD_ROOT/var/log/nscd
72 rm -rf $RPM_BUILD_ROOT
75 %groupadd -P nscd -g 144 -r nscd
76 %useradd -P nscd -u 144 -r -d /tmp -s /bin/false -c "Name Service Cache Daemon" -g nscd nscd
79 if [ ! -f /var/log/nscd ]; then
82 chown root:root /var/log/nscd
83 chmod 640 /var/log/nscd
85 /sbin/chkconfig --add nscd
86 %service nscd restart "Name Service Cache Daemon"
89 if [ "$1" = "0" ]; then
91 /sbin/chkconfig --del nscd
95 if [ "$1" = "0" ]; then
101 %defattr(644,root,root,755)
103 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nscd
104 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nscd.conf
105 %attr(754,root,root) /etc/rc.d/init.d/nscd
106 %attr(755,root,root) %{_sbindir}/nscd
107 %{_mandir}/man8/nscd.8*
108 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/nscd
109 %attr(640,root,root) %ghost /var/log/nscd
110 %{systemdtmpfilesdir}/nscd.conf