Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > 6057bb7d62d16441ede62fc6398ceb43 > files > 4

pdnsd-1.1.11.par-1mdk.src.rpm

%define srcver 1.1.7a
%define ver 1.1.11-par
# '-' are denied in %version
%define version %(echo '%ver' | sed 's/-/./')

# Force value, use --without to disable
%define _with_ipv6 1
%define _with_ntpl 1

%{?_without_ntpl: %{expand: %%define %_with_ntpl 0}}
%{?_without_ipv6: %{expand: %%define %_with_ipv6 0}}
%{?_without_poll: %{expand: %%define %_with_poll 0}}
%{?_without_underscores: %{expand: %%define %_with_underscores 0}}
%{?_without_tcpqueries: %{expand: %%define %_with_tcpqueries 0}}
%{?_without_debug: %{expand: %%define %_with_debug 0}}
%{?_without_isdn: %{expand: %%define %_with_isdn 0}}

%{!?cachedir: %{expand: %%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.1.11.par
Release: 1mdk
License: GPL
Group:  Networking/Other
Source: http://home.t-online.de/home/Moestl/pdnsd-%{srcver}.tar.bz2
Source1: %name.initscript.bz2
Patch: %{name}-%{ver}.diff.bz2
URL: http://home.t-online.de/home/Moestl/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prereq: rpm-helper

%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}

Source rpm support those options (--without options to disable):

--with ntpl %{?_with_ntpl: (activate)}: use the Native POSIX Thread Library (NPTL);
--with isdn %{?_with_isdn: (activate)}: enable isdn support;
--with ipv6 %{?_with_ipv6: (activate)}: enable ipv6 support;
--with poll %{?_with_poll: (activate)}: use the select(2) function instead of poll(2);
--with underscores %{?_with_underscores: (activate)}: built with underscores enabled;
--with tcp_queries %{?_with_underscores: (activate)}.

%prep
%setup -q -n %{name}-%{srcver}
%patch -p2 -E

%build
%configure \
	--with-cachedir="%{cachedir}" \
	%{?_with_isdn:--enable-isdn} \
	%{?_without_poll:--disable-poll} \
	%{?_with_nptl:--with-thread-lib=nptl} \
	%{?_with_underscores:--enable-underscores} \
	%{?_with_ipv6:--enable-ipv6} \
	%{?_with_tcpqueries:--enable-tcp-queries} \
	%{?_without_debug:--with-debug=0}

%make

%install
rm -rf "$RPM_BUILD_ROOT"
%makeinstall_std

mkdir -p %buildroot%_initrddir %buildroot%_sysconfdir/sysconfig
bzcat %SOURCE1 > %buildroot%_initrddir/%name

cat > %buildroot%_sysconfdir/sysconfig/%name <<EOF
# You can define options to pass to %name daemon
# See %name man page (8)
OPTIONS=""
EOF

%clean
rm -rf "$RPM_BUILD_ROOT"

%pre
%_pre_useradd %name %_localstatedir/%name /bin/true

%postun
%_postun_userdel %name

%post
# Creating ghost file
[ ! -f %_var/cache/pdnsd/pdnsd.cache ] && echo -n -e "pd11\0\0\0\0" > %_var/cache/pdnsd/pdnsd.cache


%files
%defattr(-,root,root)
%doc THANKS TODO AUTHORS README README.par NEWS ChangeLog
%doc doc/html doc/txt
%config(noreplace) %_sysconfdir/pdnsd.conf.sample
%attr(755,root,root) %config(noreplace) %_sysconfdir/sysconfig/%name
%attr(755,root,root) %config(noreplace) %_initrddir/%name
%_sbindir/pdnsd
%_sbindir/pdnsd-ctl
%_mandir/man8/pdnsd.8*
%_mandir/man8/pdnsd-ctl.8*
%attr(755,pdnsd,pdnsd) %dir %_var/cache/%name
%attr(644,pdnsd,pdnsd) %ghost %_var/cache/pdnsd/pdnsd.cache

%changelog
* Wed May 12 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 1.1.11.par-1mdk
- mdk adaptation
 
* Sun Feb 08 2004 Paul Rombouts <p.a.rombouts@home.nl>
- Remove obsolete source files after patching.
* Sun Jul 20 2003 Paul Rombouts <p.a.rombouts@home.nl>
- Changed default run_as ID from "nobody" to "pdnsd"
* Fri Jun 20 2003 Paul Rombouts <p.a.rombouts@home.nl>
- Added configuration option for NPTL.
* Sat Jun 07 2003 Paul Rombouts <p.a.rombouts@home.nl>
- Added automatic definition of distro using _vendor macro.
* Thu May 22 2003 Paul Rombouts <p.a.rombouts@home.nl>
- 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 <p.a.rombouts@home.nl>
- Applied my customized patch file. See READ.par for details.
* Sun May 16 2001 Thomas Moestl <tmoestl@gmx.net>
- Make use of chkconfig for Red Hat (patch by Christian Engstler)
* Sun Mar 25 2001 Thomas Moestl <tmoestl@gmx.net>
- Merged SuSE fixes by Christian Engstler
* Fri Feb 09 2001 Thomas Moestl <tmoestl@gmx.net>
- Merged in a spec fix for mapage inclusion contributed by Sourav K.
  Mandal
* Sun Nov 26 2000 Thomas Moestl <tmoestl@gmx.net>
- Added some patches contributed by Bernd Leibing
* Tue Aug 15 2000 Thomas Moestl <tmoestl@gmx.net>
- Added the distro for configure
* Tue Jul 11 2000 Sourav K. Mandal <smandal@mit.edu>
- autoconf/automake modifications