-Summary: This is the DENTS nameserver
-%define PACKAGE_NAME dents
-NAME: %PACKAGE_NAME
-VERSION: 0.3.1
-Release: 1
-Source: dents-0.3.1.tar.gz
-Copyright: GPL
-BuildRoot: /tmp/dents-0.3.1-rpm-build-root
-Group: Utilities/Network
-Provides: dents
+Summary: This is the DENTS nameserver
+Name: dents
+Version: 0.3.1
+Release: 1
+License: GPL
+Group: Networking/Daemons
+Group(de): Netzwerkwesen/Server
+Group(pl): Sieciowe/Serwery
+Source0: http://ftp1.sourceforge.net/dents/%{name}-%{version}.tar.gz
+URL: http://sourceforge.net/projects/dents/
+BuildRequires: glib-devel
+Prereq: rc-scripts
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
-
Dents. It's a name server that doesn't suck.
%prep
-%setup -n %{PACKAGE_NAME}-%{PACKAGE_VERSION}
+%setup -q
+
%build
-./configure --prefix=$RPM_BUILD_ROOT/usr/local
-make
+%configure
+%{__make}
+
%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add dents
+if [ -f /var/lock/subsys/dents ]; then
+ /etc/rc.d/init.d/dents restart 1>&2
+else
+ echo "Run \"/etc/rc.d/init.d/dents start\" to start dents DNS server."
+fi
+
+
+%preun
+/sbin/chkconfig --del dents
+if [ "$1" = "0" ]; then
+ if [ -f /var/lock/subsys/dents ]; then
+ /etc/rc.d/init.d/dents stop 1>&2
+ fi
+ /sbin/chkconfig --del dents
+fi
-make install
%clean
rm -rf $RPM_BUILD_ROOT
+
%files
-/usr/local/sbin/dents
-/usr/local/lib/dents/mod_frl.so.0.0.0
-/usr/local/lib/dents/mod_recursive.so.0
-/usr/local/lib/dents/mod_frl.la
-/usr/local/lib/dents/mod_recursive.so.0.0.0
-/usr/local/lib/dents/mod_frl.so
-/usr/local/lib/dents/mod_recursive.la
-/usr/local/lib/dents/mod_frl.so.0
-/usr/local/lib/dents/mod_recursive.so
-/usr/local/lib/dents/mod_msg_tgl.la
-/usr/local/lib/dents/mod_msg_tgl.so.0.0.0
-/usr/local/lib/dents/mod_msg_tgl.so
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_sbindir}/dents
+%dir %{_libdir}/dents
+%attr(755,root,root) %{_libdir}/dents/mod_*.so*