Summary: Dynamic relay authorization control
Name: dracd
Version: 1.12
Release: 3%{?_dist_release}
License: Other
Group: System Environment/Daemons
Url: http://mail.cc.umanitoba.ca/drac/
Source0: drac.tar.Z
Source1: dracd-init.d.source
Source2: dracd-rc.d.source
Source3: dracd.allow-sample
Source4: README.vine-drac
Patch0: drac-Makefile-1.12.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires(pre): db4-devel >= 4.6.21
# BuildPrereq: db4-devel >= 4.6.21
Requires(pre): chkconfig portmap
# Prereq: chkconfig portmap
Requires: db4 >= 4.6.21

Packager: iwamoto
Vendor: Project Vine
Distribution: Vine Linux

%description
DRAC is a daemon that dynamically updates a relay authorization map
for sendmail. It provides a way to allow legitimate users to relay
mail through an SMTP server, while still preventing others from using
it as a spam relay. User's IP addresses are added to the map
immediately after they have authenticated to the POP or IMAP
server. By default, map entries expire after 30 minutes, but can be
renewed by additional authentication. Periodically checking mail on a
POP server is sufficient to do this. The POP and SMTP servers can be
on different hosts.

%prep
%setup -q -c -n drac-1.12
%patch0 -p0
cp %{SOURCE4} ./README.vine

%build
make OPTFLAGS="$RPM_OPT_FLAGS -fPIC"

%install
install -d $RPM_BUILD_ROOT%{_sbindir}
install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
install -d $RPM_BUILD_ROOT/etc/mail
install -d $RPM_BUILD_ROOT%{_libdir}
install -d $RPM_BUILD_ROOT%{_mandir}/man3
install -d $RPM_BUILD_ROOT%{_mandir}/man8
install -m755 rpc.dracd $RPM_BUILD_ROOT%{_sbindir}
install -m644 dracauth.3 $RPM_BUILD_ROOT%{_mandir}/man3/
install -m644 rpc.dracd.1m $RPM_BUILD_ROOT%{_mandir}/man8/rpc.dracd.8
install -m755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dracd
install -m755 %{SOURCE2} $RPM_BUILD_ROOT%{_sbindir}/rc.dracd
install -m644 %{SOURCE3} $RPM_BUILD_ROOT/etc/mail/dracd.allow
install -m644 libdrac.a $RPM_BUILD_ROOT%{_libdir}
install -m755 testing $RPM_BUILD_ROOT%{_sbindir}/testdrac

%post
/sbin/chkconfig --add dracd

%preun
if [ $1 = 0 ] ; then
    /sbin/chkconfig --del dracd
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc COPYRIGHT Changes INSTALL PORTING README*
%{_sbindir}/rpc.dracd
%{_sbindir}/rc.dracd
%{_sbindir}/testdrac
%{_libdir}/libdrac.a
%{_mandir}/man3/dracauth.3*
%{_mandir}/man8/rpc.dracd.8*
%config /etc/rc.d/init.d/dracd
%config(noreplace) /etc/mail/dracd.allow

%changelog
* Sun Apr 17 2011 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> - 1.12-3
- rebuilt with rel++ 
- add vendor/distri tags
- use hoge(pre) tags instead of hogepre tags

* Tue Jul  7 2009 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp> - 1.12-2
- README.vine-drac in UTF-8

* Sat Jun 21 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 1.12-1
- rebuilt against db4-4.6.21
- new versioning policy

* Tue Nov 20 2007 NAKAMURA Kenta <kenta@vinelinux.org> 1.12-0vl6
- use RPM_OPT_FLAGS and -fPIC

* Thu May 10 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 1.12-0vl5
- rebuild with db4-4.3

* Thu Jul 13 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.12-0vl4
- changed Group to System Environment/Daemons

* Sun Nov  7 2004 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 1.12-0vl3
- rebuilt with db4-4.2.52

* Mon Sep  6 2004 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.12-0vl2
- fix typo on README.vine

* Sat Aug 23 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.12-0vl1
- source upgrade
- update Patch0

* Fri Aug 22 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.11-0vl6
- update SOURCE4
- use License tag

* Fri Aug 22 2003 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.11-0vl5
- BuildPrereq: db4-devel and Requires: db4

* Fri Aug 23 2002 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp> 1.11-0vl4
- add README.vine (SOURCE4)

* Fri Jun 21 2002 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.11-0vl3
- build for Vine Linux 2.5
- add BuildPrereq: db3-devel and Requires: db3

* Tue May 28 2001 AKIYAMA Kazuhito <akiyama@karen.servepics.com> 1.11-0vl2
- clean up spec

* Thu Mar 15 2001 AKIYAMA Kazuhito <akiyama@yb3.so-net.ne.jp>
- 1.11-0vl1

* Thu Dec 14 2000 Kenneth Porter <shiva@well.com>
- Add testing program to package, renamed to testdrac

* Thu Nov 2 2000 Kenneth Porter <shiva@well.com>
- Move rc.dracd out of /etc
- Mark remaining /etc files (init file) as config
- Return a value from init script
- Add status to init script

* Mon Oct 30 2000 Kenneth Porter <shiva@well.com>
- Add Requires: portmap
- Make dracd.allow a config file
- Compressed man pages on newer RPM systems

* Sat Jul 1 2000 Kenneth Porter <shiva@well.com>
- Fix install for non-root packager
- Remove bogus address from default client allow file.
- Add chkconfig invocation to automatically install startup links.
- Move libdrac.a to /usr/lib. No need for a directory of its own.

* Tue Oct 26 1999 Mike McHenry <mmchen@minn.net>
- First RPM build
