]>
Commit | Line | Data |
---|---|---|
a5677c9e | 1 | Summary: Single threaded NSCD (Name Service Caching Daemon) |
0acbfe51 | 2 | Name: unscd |
46b8b813 ER |
3 | Version: 0.49 |
4 | Release: 1 | |
0acbfe51 ER |
5 | License: GPL v2 |
6 | Group: Networking/Daemons | |
7 | Source0: http://busybox.net/~vda/unscd/nscd-%{version}.c | |
46b8b813 | 8 | # Source0-md5: ee9cdaac340635e0c14551febbc0fd22 |
09c4871c ER |
9 | Source1: nscd.init |
10 | Source2: nscd.sysconfig | |
11 | Source3: nscd.logrotate | |
12 | Source4: nscd.conf | |
f89d5ba4 ER |
13 | Source5: http://svn.donarmstrong.com/deb_pkgs/unscd/trunk/debian/nscd.8 |
14 | # Source5-md5: eac364084cae21114174404790dfc0df | |
96a75a87 | 15 | Source6: nscd.tmpfiles |
96f723d5 | 16 | URL: http://busybox.net/~vda/unscd/ |
5c1495e5 | 17 | BuildRequires: rpmbuild(macros) >= 1.644 |
09c4871c ER |
18 | Provides: group(nscd) |
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.2.0 | |
28 | Provides: user(nscd) | |
5c1495e5 | 29 | Obsoletes: gnscd |
09c4871c | 30 | Obsoletes: nscd |
0acbfe51 ER |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
56b4846c ER |
33 | # glibc private symbols |
34 | %define _noautoreq libc.so.6(GLIBC_PRIVATE) | |
35 | ||
0acbfe51 | 36 | %description |
a5677c9e ER |
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+. | |
0acbfe51 | 40 | |
a5677c9e ER |
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. | |
46 | ||
47 | It should mostly be a drop-in replacement for existing installs using | |
48 | nscd. | |
0acbfe51 ER |
49 | |
50 | %prep | |
51 | %setup -qcT | |
069666de | 52 | sed -ne '/Description:/,/\*\*\*/p' %{SOURCE0} > README |
0acbfe51 ER |
53 | |
54 | %build | |
09c4871c | 55 | %{__cc} -o nscd %{rpmcflags} -Os %{rpmcppflags} %{rpmldflags} -Wall -Wunused-parameter -Wl,--sort-section -Wl,alignment -Wl,--sort-common %{SOURCE0} |
0acbfe51 ER |
56 | |
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
5c1495e5 | 59 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8,/var/log,/var/run/nscd,/etc/{logrotate.d,rc.d/init.d,sysconfig},%{systemdtmpfilesdir}} |
09c4871c ER |
60 | install -p nscd $RPM_BUILD_ROOT%{_sbindir} |
61 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nscd | |
f89d5ba4 ER |
62 | cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man8 |
63 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/nscd | |
64 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/nscd | |
65 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir} | |
5c1495e5 | 66 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/nscd.conf |
09c4871c | 67 | : > $RPM_BUILD_ROOT/var/log/nscd |
0acbfe51 ER |
68 | |
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
09c4871c ER |
72 | %pre |
73 | %groupadd -P nscd -g 144 -r nscd | |
74 | %useradd -P nscd -u 144 -r -d /tmp -s /bin/false -c "Name Service Cache Daemon" -g nscd nscd | |
75 | ||
76 | %post | |
77 | if [ ! -f /var/log/nscd ]; then | |
78 | umask 027 | |
79 | touch /var/log/nscd | |
80 | chown root:root /var/log/nscd | |
81 | chmod 640 /var/log/nscd | |
82 | fi | |
83 | /sbin/chkconfig --add nscd | |
84 | %service nscd restart "Name Service Cache Daemon" | |
85 | ||
86 | %preun | |
87 | if [ "$1" = "0" ]; then | |
88 | %service nscd stop | |
89 | /sbin/chkconfig --del nscd | |
90 | fi | |
91 | ||
92 | %postun | |
93 | if [ "$1" = "0" ]; then | |
94 | %userremove nscd | |
95 | %groupremove nscd | |
96 | fi | |
97 | ||
0acbfe51 ER |
98 | %files |
99 | %defattr(644,root,root,755) | |
100 | %doc README | |
09c4871c ER |
101 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nscd |
102 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nscd.conf | |
103 | %attr(754,root,root) /etc/rc.d/init.d/nscd | |
104 | %attr(755,root,root) %{_sbindir}/nscd | |
f89d5ba4 | 105 | %{_mandir}/man8/nscd.8* |
09c4871c ER |
106 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/nscd |
107 | %attr(640,root,root) %ghost /var/log/nscd | |
5c1495e5 | 108 | %{systemdtmpfilesdir}/nscd.conf |
09c4871c | 109 | %dir /var/run/nscd |