comparison dnsbl.spec.in @ 112:96b2eb7f25f5

move to autoconf/automake/docbook
author carl
date Sun, 18 Dec 2005 16:56:38 -0800
parents d9c64bafbf60
children a893afee4b80
comparison
equal deleted inserted replaced
111:d0dad5610980 112:96b2eb7f25f5
1 Summary: DNSBL Sendmail Milter 1 %define localstatedir /var/lib
2 Name: dnsbl
3 Version: 5.10
4 Release: 2
5 Copyright: GPL
6 Group: System Environment/Daemons
7 Source: http://www.five-ten-sg.com/util/dnsbl.tar.gz
8 BuildRoot: %{_tmppath}/%{name}-%{version}
9 2
10 Requires(pre): /usr/sbin/groupadd 3 Summary: @PACKAGE@ Sendmail Milter
11 Requires(pre): /usr/sbin/useradd 4 Name: @PACKAGE@
12 Requires(pre): /usr/bin/getent 5 Version: @VERSION@
6 Release: %{?custom_release}%{!?custom_release:1}
7 Copyright: GPL
8 Group: System Environment/Daemons
9 Source: http://www.five-ten-sg.com/@PACKAGE@/packages/@PACKAGE@-@VERSION@.tar.gz
10 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
11 URL: http://www.five-ten-sg.com/@PACKAGE@/
12 Vendor: 510 Software Group
13 Packager: 510 Software Group
14
15 Requires(pre): /usr/sbin/groupadd
16 Requires(pre): /usr/sbin/useradd
17 Requires(pre): /usr/bin/getent
13 Requires(postun): /usr/sbin/userdel 18 Requires(postun): /usr/sbin/userdel
14 Requires(postun): /usr/sbin/groupdel 19 Requires(postun): /usr/sbin/groupdel
15 Requires(post,preun): /sbin/chkconfig 20 Requires(post,preun): /sbin/chkconfig
16 BuildRequires: sendmail-devel >= 8.12.1 21 BuildRequires: sendmail-devel >= 8.12.1
17 Requires: sendmail >= 8.12.1 22 Requires: sendmail >= 8.12.1
18 Requires: sendmail-cf 23 Requires: sendmail-cf
19 24
20 25
21 %description 26 %description
22 We present here a mechanism whereby the backup mail server can use the correct set of DNSBLs for each recipient for each message. As a side-effect, it gives us the ability to customize the set of DNSBLs on a per-recipient basis, so that fred@example.com could use SPEWS and the SBL, where all other users @example.com use only the SBL. 27 We present here a mechanism whereby the backup mail server can use the correct set of DNSBLs for each recipient for each message. As a side-effect, it gives us the ability to customize the set of DNSBLs on a per-recipient basis, so that fred@example.com could use SPEWS and the SBL, where all other users @example.com use only the SBL.
23 28
24 This milter will also decode (base64, mime, html entity, url encodings) and scan for HTTP and HTTPS URLs and bare hostnames in the body of the mail. If any of those host names have A or NS records on the SBL (or a single configurable DNSBL), the mail will be rejected unless previously whitelisted. This milter also counts the number of invalid HTML tags, and can reject mail if that count exceeds your specified limit. 29 This milter will also decode (base64, mime, html entity, url encodings) and scan for HTTP and HTTPS URLs and bare hostnames in the body of the mail. If any of those host names have A or NS records on the SBL (or a single configurable DNSBL), the mail will be rejected unless previously whitelisted. This milter also counts the number of invalid HTML tags, and can reject mail if that count exceeds your specified limit.
25 30
26 The DNSBL milter reads a text configuration file (dnsbl.conf) on startup, and whenever the config file (or any of the referenced include files) is changed. The entire configuration file is case insensitive. 31 The DNSBL milter reads a text configuration file (dnsbl.conf) on startup, and whenever the config file (or any of the referenced include files) is changed. The entire configuration file is case insensitive.
27 32
33
28 %prep 34 %prep
35
29 36
30 %setup 37 %setup
31 38
39
32 %build 40 %build
33 pwd 41 ./configure --prefix=%{_prefix} \
34 g++ -c $CXXFLAGS -pthread dnsbl.cpp 42 --bindir=%{_bindir} --mandir=%{_mandir} \
35 g++ -o dnsbl dnsbl.o /usr/lib/libresolv.a -lmilter -pthread 43 --localstatedir=%{localstatedir} --libdir=%{_libdir} \
44 --datadir=%{_datadir} --includedir=%{_includedir} \
45 --sysconfdir=%{_sysconfdir}
46 make
47
36 48
37 %install 49 %install
38 DST=%{buildroot} 50 if [ "$RPM_BUILD_ROOT" = "/" -o -z "$RPM_BUILD_ROOT" ] ; then
39 if [ "%{buildroot}" = "/" -o -z "%{buildroot}" ] ; then 51 echo sorry, you probably do not want me to delete the old buildroot at $RPM_BUILD_ROOT
40 echo sorry, you probably do not want me to delete the old buildroot at %{buildroot}
41 exit 1 52 exit 1
42 fi 53 fi
54 rm -rf $RPM_BUILD_ROOT
55 make prefix=$RPM_BUILD_ROOT%{_prefix} bindir=$RPM_BUILD_ROOT%{_bindir} \
56 mandir=$RPM_BUILD_ROOT%{_mandir} libdir=$RPM_BUILD_ROOT%{_libdir} \
57 localstatedir=$RPM_BUILD_ROOT%{localstatedir} \
58 datadir=$RPM_BUILD_ROOT%{_datadir} \
59 includedir=$RPM_BUILD_ROOT%{_includedir} \
60 sysconfdir=$RPM_BUILD_ROOT%{_sysconfdir} install
61 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
62 mkdir -p $RPM_BUILD_ROOT%{_datadir}/doc/@PACKAGE@-@VERSION@
63 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/dnsbl/dnsbl $RPM_BUILD_ROOT/etc/rc.d/init.d
64 mv AUTHORS COPYING ChangeLog NEWS README $RPM_BUILD_ROOT%{_datadir}/doc/@PACKAGE@-@VERSION@
65 mkdir -p %{buildroot}/var/run/@PACKAGE@
43 66
44 rm -rf %{buildroot}
45 mkdir -p %{buildroot}/etc/dnsbl
46
47 install -m 644 dnsbl.conf %{buildroot}/etc/dnsbl/dnsbl.conf
48 install -m 644 hosts-ignore.conf %{buildroot}/etc/dnsbl/hosts-ignore.conf
49 install -m 644 html-tags.conf %{buildroot}/etc/dnsbl/html-tags.conf
50 install -m 644 tld.conf %{buildroot}/etc/dnsbl/tld.conf
51 install -m 644 sample.conf %{buildroot}/etc/dnsbl/sample.conf
52
53 mkdir -p %{buildroot}/usr/sbin
54 install -m 755 dnsbl %{buildroot}/usr/sbin/dnsbl
55
56 mkdir -p %{buildroot}/etc/rc.d/init.d
57 install -m 755 dnsbl.rc %{buildroot}/etc/rc.d/init.d/dnsbl
58
59 mkdir -p %{buildroot}/var/run/dnsbl
60 67
61 %pre 68 %pre
62 /usr/bin/getent passwd dnsbl || 69 /usr/bin/getent passwd dnsbl ||
63 useradd -r -d /etc/dnsbl -M -c "dnsbl pseudo-user" -s /sbin/nologin dnsbl 70 useradd -r -d /etc/dnsbl -M -c "dnsbl pseudo-user" -s /sbin/nologin dnsbl
64 71
65 #[JOG] Attempt to migrate an existing, non-rpm install.
66 # WARNING! This may cause blindness, loss of appetite, and a general
67 # feeling of ill will towards the author of this script. Please refer
68 # to the Licence file for warranty information...
69 if [ -f "/var/dnsbl/dnsbl.conf" -a ! -f "/etc/dnsbl/dnsbl.conf" ] ; then
70 echo Existing installation found at /var/dnsbl/ Migrating configuation...
71 # create the conf directory so rpm can find it in a minute...
72 mkdir /etc/dnsbl/
73 # and try to copy all of the relavent config files that are below this directory
74 cd /var/dnsbl/
75 grep '^include ' /var/dnsbl/dnsbl.conf | cut -d ' ' -f 2 | grep -v '^/' | xargs cp --target-directory=/etc/dnsbl/ /var/dnsbl/dnsbl.conf
76 fi
77
78 72
79 %post 73 %post
80 /sbin/chkconfig --add dnsbl 74 /sbin/chkconfig --add @PACKAGE@
81 /sbin/chkconfig dnsbl on 75 /sbin/chkconfig dnsbl on
82 /sbin/service dnsbl start 76 /sbin/service dnsbl start
83 77
84 echo Remember to edit /etc/dnsbl.conf and add the following line to your sendmail.mc: 78 echo Remember to edit %{_sysconfdir}/@PACKAGE@/@PACKAGE@.conf and add the following line to your sendmail.mc:
85 echo "INPUT_MAIL_FILTER(\`dnsbl\', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m\')" 79 echo "INPUT_MAIL_FILTER(\`dnsbl\', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m\')"
86 echo 80 echo
87 81
88 82
89 %preun 83 %preun
90 if [ $1 -eq 0 ]; then 84 /sbin/service @PACKAGE@ stop || :
91 /sbin/service dnsbl stop || : 85 /sbin/chkconfig --del @PACKAGE@
92 /sbin/chkconfig --del dnsbl 86 userdel @PACKAGE@ || :
93 userdel dnsbl || : 87
94 fi
95 88
96 %postun 89 %postun
90
97 91
98 %clean 92 %clean
99 93
100 %files 94 %files
101 %defattr(-,root,root) 95 %defattr(-,root,root)
102 %config(noreplace) /etc/dnsbl/ 96 %{_sbindir}/*
103 %doc RELEASE_NOTES LICENSE sample.conf test.cpp 97 %doc %{_mandir}/*
104 /etc/rc.d/init.d/dnsbl 98 %docdir %{_datadir}/doc/@PACKAGE@-@VERSION@
105 /usr/sbin/dnsbl 99 %{_datadir}/doc/@PACKAGE@-@VERSION@
106 %dir %attr(0750,dnsbl,root) /var/run/dnsbl 100 %config(noreplace) %{_sysconfdir}/@PACKAGE@
101 %config(noreplace) %{_sysconfdir}/@PACKAGE@/*.conf
102 /etc/rc.d/init.d/@PACKAGE@
103 %dir %attr(0750,@PACKAGE@,root) /var/run/@PACKAGE@
104
107 105
108 %changelog 106 %changelog
107 * Sun Dec 18 2005 Carl Byington 1.0
108 - use autoconf and http://www.fedora.us/docs/rpm-packaging-guidelines.html
109
109 * Tue Jan 03 2005 Carl Byington 1.4 110 * Tue Jan 03 2005 Carl Byington 1.4
110 - added hosts-ignore conf file 111 - added hosts-ignore conf file
111 - see RELEASE_NOTES 112 - see RELEASE_NOTES
112 113
113 * Thu Jul 15 2004 John Gunkel <antispam@boing.ca> 1.3 114 * Thu Jul 15 2004 John Gunkel <antispam@boing.ca> 1.3