view sm-archive.spec.in @ 1:45c8592d5d13

initial version
author carl
date Fri, 10 Mar 2006 10:35:25 -0800
parents
children 32b57406b656
line wrap: on
line source

%define localstatedir   /var/lib

Summary:            @PACKAGE@ Sendmail Milter
Name:               @PACKAGE@
Version:            @VERSION@
Release:            %{?custom_release}%{!?custom_release:1}
Copyright:          GPL
Group:              System Environment/Daemons
Source:             http://www.five-ten-sg.com/@PACKAGE@/packages/@PACKAGE@-@VERSION@.tar.gz
BuildRoot:          %{_tmppath}/%{name}-%{version}-buildroot
URL:                http://www.five-ten-sg.com/@PACKAGE@/
Vendor:             510 Software Group
Packager:           510 Software Group
AutoReqProv:        no

Requires(pre):          /usr/sbin/useradd
Requires(pre):          /usr/bin/getent
Requires(postun):       /usr/sbin/userdel
Requires(post,preun):   /sbin/chkconfig
Requires(post,preun):   /sbin/service
BuildRequires:          sendmail-devel >= 8.12.1
Requires:               sendmail >= 8.12.1
Requires:               sendmail-cf
Requires:               libc.so.6, libgcc_s.so.1, libm.so.6, libpthread.so.0, libstdc++.so.6


%description
This milter adds recipient addresses to message passing thru it, based on a configuration file.

The sm-archive milter reads a text configuration file (sm-archive.conf) on startup, and whenever the config file (or any of the referenced include files) is changed. The entire configuration file is case insensitive.


%prep


%setup


%build
./configure --prefix=%{_prefix} \
    --bindir=%{_bindir} --mandir=%{_mandir} \
    --localstatedir=%{localstatedir} --libdir=%{_libdir} \
    --datadir=%{_datadir} --includedir=%{_includedir} \
    --sysconfdir=%{_sysconfdir}
make


%install
if [ "$RPM_BUILD_ROOT" = "/" -o -z "$RPM_BUILD_ROOT" ] ; then
        echo sorry, you probably do not want me to delete the old buildroot at $RPM_BUILD_ROOT
        exit 1
fi
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{_prefix} bindir=$RPM_BUILD_ROOT%{_bindir} \
    mandir=$RPM_BUILD_ROOT%{_mandir} libdir=$RPM_BUILD_ROOT%{_libdir} \
    localstatedir=$RPM_BUILD_ROOT%{localstatedir} \
    datadir=$RPM_BUILD_ROOT%{_datadir} \
    includedir=$RPM_BUILD_ROOT%{_includedir} \
    sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} install
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT%{_datadir}/doc/@PACKAGE@-@VERSION@
mv -f $RPM_BUILD_ROOT%{_sysconfdir}/sm-archive       $RPM_BUILD_ROOT/etc/rc.d/init.d
mv AUTHORS COPYING ChangeLog NEWS README             $RPM_BUILD_ROOT%{_datadir}/doc/@PACKAGE@-@VERSION@
mkdir -p %{buildroot}/var/run/@PACKAGE@


%pre
/usr/bin/getent passwd sm-archive >/dev/null ||
  useradd -r -d /etc/sm-archive -M -c "sm-archive pseudo-user" -s /sbin/nologin sm-archive


%post
/sbin/chkconfig --add @PACKAGE@

echo Remember to edit %{_sysconfdir}/@PACKAGE@/@PACKAGE@.conf and add the following line to your sendmail.mc:
echo "INPUT_MAIL_FILTER(\`sm-archive', \`S=local:/var/run/sm-archive/sm-archive.sock, F=T, T=C:30s;S:5m;R:5m;E:5m')"
echo


%preun
/sbin/service @PACKAGE@ stop || :
/sbin/chkconfig --del @PACKAGE@
userdel @PACKAGE@ || :


%postun


%clean

%files
%defattr(-,root,root)
%{_sbindir}/*
%doc %{_mandir}/*
%docdir %{_datadir}/doc/@PACKAGE@-@VERSION@
%{_datadir}/doc/@PACKAGE@-@VERSION@
%config(noreplace) %{_sysconfdir}/@PACKAGE@
%config(noreplace) %{_sysconfdir}/@PACKAGE@/*.conf
/etc/rc.d/init.d/@PACKAGE@
%dir %attr(0750,@PACKAGE@,root) /var/run/@PACKAGE@


%changelog
* Sun Dec 18 2005 Carl Byington 1.0
- use autoconf and http://www.fedora.us/docs/rpm-packaging-guidelines.html

* Tue Jan 03 2005 Carl Byington 1.4
- added hosts-ignore conf file
- see RELEASE_NOTES

* Thu Jul 15 2004 John Gunkel <antispam@boing.ca> 1.3
- patch to rc file no longer needed
- see RELEASE_NOTES

* Mon Jul 05 2004 John Gunkel <jgunkel@palliser.ca> 1.2
- Fixed some typos
- removed patch into separate file
- added config migration as suggested by Carl
- Added reminder to edit sendmail.mc

* Wed Jun 30 2004 John Gunkel <jgunkel@palliser.ca> 1.1
- Initial revision of spec file. Need to add a better description, docs and a sendmail.mc message