File unscd.spec of Package unscd
Name: unscd
Version: 0.39
Release: 1
Summary: Alternative Name Service Caching Daemon
Group: System/Daemons
License: GPL
URL: http://busybox.net/~vda/unscd/
BuildRoot: %_tmppath/%name-%version-%release-root-%(%__id_u -n)
Provides: nscd
Conflicts: nscd
Source0: nscd-%version.c
Source1: init.d
Source2: nscd.conf
%description
unscd caches application requests for resolving hostnames,
user and group names and other things, and can dramatically improve
performance e.g. when using NIS or LDAP or even when just caching
DNS requests.
This is an alternative to the glibc-supplied nscd that has been
designed to be much simpler and more robust.
%prep
%setup -c -T
cp $RPM_SOURCE_DIR/nscd-%version.c .
%build
cc $RPM_OPT_FLAGS -fpie -pie -o unscd nscd-%version.c
%install
install -m 0755 -D unscd $RPM_BUILD_ROOT/%_sbindir/nscd
install -m 0644 -D $RPM_SOURCE_DIR/nscd.conf $RPM_BUILD_ROOT/etc/nscd.conf
install -m 0755 -D $RPM_SOURCE_DIR/init.d $RPM_BUILD_ROOT/etc/init.d/nscd
ln -sf /etc/init.d/nscd $RPM_BUILD_ROOT/usr/sbin/rcnscd
mkdir -p $RPM_BUILD_ROOT/var/run/nscd
touch $RPM_BUILD_ROOT/var/run/nscd/{socket,nscd.pid}
%clean
rm -rf $RPM_BUILD_ROOT
%preun
%stop_on_removal nscd
%post
%{insserv_force_if_yast nscd}
%postun
%restart_on_update nscd
%insserv_cleanup
exit 0
%files
%defattr(-,root,root,-)
%config(noreplace) /etc/nscd.conf
%config /etc/init.d/nscd
%attr(0755,root,root) %_sbindir/*
%dir %attr(0755,root,root) /var/run/nscd
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/nscd.pid
%attr(0666,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/run/nscd/socket
%changelog
* Mon Jan 26 2008 pasky@suse.cz
- Initial package, slightly based on Jon Nelson <jnelson@boa.org>.