]> git.pld-linux.org Git - packages/unscd.git/blob - unscd.spec
- up to 0.48:
[packages/unscd.git] / unscd.spec
1 Summary:        Single threaded NSCD implementation
2 Name:           unscd
3 Version:        0.48
4 Release:        0.1
5 License:        GPL v2
6 Group:          Networking/Daemons
7 Source0:        http://busybox.net/~vda/unscd/nscd-%{version}.c
8 # Source0-md5:  d0e2ea863aa4f6724901c8fec24022b9
9 Source1:        nscd.init
10 Source2:        nscd.sysconfig
11 Source3:        nscd.logrotate
12 Source4:        nscd.conf
13 Provides:       group(nscd)
14 Requires(post): fileutils
15 Requires(post,preun):   /sbin/chkconfig
16 Requires(postun):       /usr/sbin/groupdel
17 Requires(postun):       /usr/sbin/userdel
18 Requires(pre):  /bin/id
19 Requires(pre):  /usr/bin/getgid
20 Requires(pre):  /usr/sbin/groupadd
21 Requires(pre):  /usr/sbin/useradd
22 Requires:       rc-scripts >= 0.2.0
23 Provides:       user(nscd)
24 Obsoletes:      nscd
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 Single threaded NSCD (Name Service Caching Daemon) implementation.
29
30 nscd caches name service lookups; it can dramatically improve
31 performance with NIS+, and may help with DNS as well.
32
33 %prep
34 %setup -qcT
35 sed -ne '/Description:/,/\*\*\*/p' %{SOURCE0} > README
36
37 %build
38 %{__cc} -o nscd %{rpmcflags} -Os %{rpmcppflags} %{rpmldflags} -Wall -Wunused-parameter -Wl,--sort-section -Wl,alignment -Wl,--sort-common %{SOURCE0}
39
40 %install
41 rm -rf $RPM_BUILD_ROOT
42 install -d $RPM_BUILD_ROOT{%{_sbindir},/var/log,/var/run/nscd,/etc/{logrotate.d,rc.d/init.d,sysconfig}}
43 install -p nscd $RPM_BUILD_ROOT%{_sbindir}
44 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nscd
45 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/nscd
46 cp -a %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/nscd
47 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}
48 : > $RPM_BUILD_ROOT/var/log/nscd
49
50 %clean
51 rm -rf $RPM_BUILD_ROOT
52
53 %pre
54 %groupadd -P nscd -g 144 -r nscd
55 %useradd -P nscd -u 144 -r -d /tmp -s /bin/false -c "Name Service Cache Daemon" -g nscd nscd
56
57 %post
58 if [ ! -f /var/log/nscd ]; then
59         umask 027
60         touch /var/log/nscd
61         chown root:root /var/log/nscd
62         chmod 640 /var/log/nscd
63 fi
64 /sbin/chkconfig --add nscd
65 %service nscd restart "Name Service Cache Daemon"
66
67 %preun
68 if [ "$1" = "0" ]; then
69         %service nscd stop
70         /sbin/chkconfig --del nscd
71 fi
72
73 %postun
74 if [ "$1" = "0" ]; then
75         %userremove nscd
76         %groupremove nscd
77 fi
78
79 %files
80 %defattr(644,root,root,755)
81 %doc README
82 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/nscd
83 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/nscd.conf
84 %attr(754,root,root) /etc/rc.d/init.d/nscd
85 %attr(755,root,root) %{_sbindir}/nscd
86 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/nscd
87 %attr(640,root,root) %ghost /var/log/nscd
88 %dir /var/run/nscd
This page took 0.083525 seconds and 4 git commands to generate.