%define run_as_uid 96 %define cachedir /var/cache/pdnsd %define conffile %{_sysconfdir}/pdnsd.conf Summary: A caching dns proxy for small networks or dialin accounts Name: pdnsd Version: 1.2.1 Release: 1.n0i.3 License: GPL Group: System Environment/Daemons Source: http://www.phys.uu.nl/~rombouts/pdnsd/%{name}-%{version}-par.tar.gz URL: http://www.phys.uu.nl/~rombouts/pdnsd/ Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description pdnsd is a proxy DNS daemon with permanent (disk-)cache and the ability to serve local records. It is designed to detect network outages or hangups and to prevent DNS-dependent applications like Netscape Navigator from hanging. This is a customized version with modifications made by Paul A. Rombouts. For a description of the changes see http://www.phys.uu.nl/~rombouts/pdnsd.html and the file README.par in %{_docdir}/%{name}-%{version} %prep %setup %build %configure \ --with-cachedir="%{cachedir}" \ --with-distribution=RedHat \ --enable-specbuild \ --with-default-id=pdnsd \ %{?_with_isdn:--enable-isdn} \ %{?_without_poll:--disable-poll} \ %{?!_without_nptl:--with-thread-lib=nptl} \ %{?_with_underscores:--enable-underscores} \ %{?_with_ipv6:--enable-ipv6} \ %{?_with_tcpqueries:--enable-tcp-queries} \ %{?!_with_debug:--with-debug=0} make %{?_smp_mflags} %install rm -rf "$RPM_BUILD_ROOT" perl -pi -e 's{\Q/etc/rc.d/init.d}{%{_initrddir}}g' src/rc/RedHat/{pdnsd,Makefile} make DESTDIR="$RPM_BUILD_ROOT" install mv $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf rm -f $RPM_BUILD_ROOT/%{cachedir}/pdnsd.cache %clean rm -rf "$RPM_BUILD_ROOT" %files %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/%{name}.conf %{_sbindir}/* %{_initrddir}/%{name} %{_mandir}/*/* %attr(0770,pdnsd,pdnsd) %dir %{cachedir} %doc AUTHORS ChangeLog COPYING doc/html doc/txt %pre # Add the "pdnsd" user id -u %{run_as_user} > /dev/null 2>&1 || /usr/sbin/useradd -c "Proxy DNS daemon" -u %{run_as_uid} \ -s /sbin/nologin -r -d "%{cachedir}" pdnsd 2>/dev/null || : %post if [ "$1" = 1 ]; then /sbin/chkconfig --add pdnsd fi %preun if [ $1 = 0 ]; then /usr/sbin/userdel pdnsd 2>/dev/null || : /usr/sbin/groupdel pdnsd 2>/dev/null || : /sbin/chkconfig --del pdnsd 2>/dev/null || : [ -f /var/lock/subsys/pdnsd ] && /sbin/service pdnsd stop >/dev/null 2>&1 fi exit 0 %postun if [ "$1" -ge 1 ]; then /sbin/service pdnsd condrestart >/dev/null 2>&1 fi %changelog * Sat Dec 04 2004 Marius FERARU 0:1.2.1-1.n0i.3 - version 1.2.1 * Fri Jul 30 2004 Marius FERARU 0:1.1.11-1.n0i.1 - some spec re-worked (Fedora style) - rebuild * Sun Jul 20 2003 Paul Rombouts - Changed default run_as ID from "nobody" to "pdnsd" * Fri Jun 20 2003 Paul Rombouts - Added configuration option for NPTL. * Sat Jun 07 2003 Paul Rombouts - Added automatic definition of distro using _vendor macro. * Thu May 22 2003 Paul Rombouts - Ensured that modification times of acconfig.h and configure.in are not changed by patching to avoid unwanted reconfigure during make phase. * Tue May 20 2003 Paul Rombouts - Applied my customized patch file. See READ.par for details. * Sun May 16 2001 Thomas Moestl - Make use of chkconfig for Red Hat (patch by Christian Engstler) * Sun Mar 25 2001 Thomas Moestl - Merged SuSE fixes by Christian Engstler * Fri Feb 09 2001 Thomas Moestl - Merged in a spec fix for mapage inclusion contributed by Sourav K. Mandal * Sun Nov 26 2000 Thomas Moestl - Added some patches contributed by Bernd Leibing * Tue Aug 15 2000 Thomas Moestl - Added the distro for configure * Tue Jul 11 2000 Sourav K. Mandal - autoconf/automake modifications