comparison dnsbl.spec.in @ 370:5380552644e2

RHEL7 systemd and /var/run on tmpfs
author Carl Byington <carl@five-ten-sg.com>
date Tue, 07 Feb 2017 18:09:52 -0800
parents 354b15b8b263
children df7dc6b2b153
comparison
equal deleted inserted replaced
369:f15c694c31d2 370:5380552644e2
15 Requires(postun): /usr/sbin/userdel 15 Requires(postun): /usr/sbin/userdel
16 Requires(post,preun): /sbin/chkconfig 16 Requires(post,preun): /sbin/chkconfig
17 Requires(post,preun): /sbin/service 17 Requires(post,preun): /sbin/service
18 BuildRequires: sendmail-devel >= 8.12.1 18 BuildRequires: sendmail-devel >= 8.12.1
19 BuildRequires: glibc-devel 19 BuildRequires: glibc-devel
20 %if 0%{?fedora} >= 14 20 %if "%{?dist}" == ".el6"
21 BuildRequires: glibc-static
22 %endif
23 %if 0%{?el6}
24 BuildRequires: glibc-static 21 BuildRequires: glibc-static
25 %endif 22 %endif
26 Requires: sendmail >= 8.12.1 23 Requires: sendmail >= 8.12.1
27 Requires: sendmail-cf 24 Requires: sendmail-cf
28 Requires: spamassassin 25 Requires: spamassassin
26 %if "%{?dist}" == ".el7"
27 Requires(pre): systemd-sysv, shadow-utils
28 Requires(post): systemd-units
29 Requires(preun): systemd-units
30 Requires(postun): systemd-units
31 Requires: coreutils
32 Requires: systemd-units
33 BuildRequires: systemd-units
34 BuildRequires: glibc-static
35 %endif
29 36
30 37
31 %description 38 %description
32 We present here a mechanism whereby the backup mail server can use the 39 We present here a mechanism whereby the backup mail server can use the
33 correct set of DNSBLs for each recipient for each message. As a 40 correct set of DNSBLs for each recipient for each message. As a
55 %build 62 %build
56 %configure 63 %configure
57 make %{?_smp_mflags} 64 make %{?_smp_mflags}
58 65
59 %install 66 %install
60 rm -rf $RPM_BUILD_ROOT 67 rm -rf %{buildroot}
61 make DESTDIR=$RPM_BUILD_ROOT install 68 make DESTDIR=%{buildroot} install
62 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d 69 mkdir -p %{buildroot}%{_sysconfdir}/%{name}/autowhite
63 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name} $RPM_BUILD_ROOT/etc/rc.d/init.d 70 mkdir -p %{buildroot}%{_sysconfdir}/%{name}/.spamassassin
64 mkdir -p $RPM_BUILD_ROOT/var/run/%{name} 71 %if "%{?dist}" == ".el7"
65 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/autowhite 72 install -m 644 -D %{buildroot}%{_sysconfdir}/%{name}/%{name}.service \
66 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/.spamassassin 73 %{buildroot}%{_unitdir}/%{name}.service
74 install -m 755 -d %{buildroot}%{_prefix}/lib/tmpfiles.d
75 install -m 644 %{buildroot}%{_sysconfdir}/%{name}/%{name}-tmpfs.conf \
76 %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
77 %else
78 install -m 755 -D %{buildroot}%{_sysconfdir}/%{name}/%{name} \
79 %{buildroot}%{_initrddir}/%{name}
80 %endif
81 mkdir -p %{buildroot}/var/run/%{name}
82 rm -f %{buildroot}%{_sysconfdir}/%{name}/%{name}
83 rm -f %{buildroot}%{_sysconfdir}/%{name}/%{name}.service
84 rm -f %{buildroot}%{_sysconfdir}/%{name}/%{name}-tmpfs.conf
67 85
68 86
69 %pre 87 %pre
70 /usr/bin/getent passwd %{name} >/dev/null || /usr/sbin/useradd -r -d %{_sysconfdir}/%{name} -M -c "%{name} pseudo-user" -s /sbin/nologin %{name} >/dev/null 88 /usr/bin/getent passwd %{name} >/dev/null || /usr/sbin/useradd -r -d %{_sysconfdir}/%{name} -M -c "%{name} pseudo-user" -s /sbin/nologin %{name} >/dev/null
71 89
72 90
73 %post 91 %post
74 /sbin/chkconfig --add %{name} 92 if [ $1 = 1 ]; then
75 echo Remember to edit %{_sysconfdir}/%{name}/%{name}.conf and add the following line to your sendmail.mc: 93 # initial install
76 echo "INPUT_MAIL_FILTER(\`dnsbl', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m')" 94 %if "%{?dist}" == ".el7"
77 echo 95 /bin/systemctl daemon-reload &>/dev/null || :
78 96 %else
97 /sbin/chkconfig --add %{name}
98 %endif
99 echo Remember to edit %{_sysconfdir}/%{name}/%{name}.conf and add the following line to your sendmail.mc:
100 echo "INPUT_MAIL_FILTER(\`dnsbl', \`S=local:/var/run/dnsbl/dnsbl.sock, F=T, T=C:30s;S:5m;R:5m;E:5m')"
101 echo
102 fi
79 103
80 %preun 104 %preun
81 [ $1 = 0 ] && /sbin/service %{name} stop || : 105 if [ $1 = 0 ]; then
82 [ $1 = 0 ] && /sbin/chkconfig --del %{name} || : 106 # package removal, not upgrade
107 %if "%{?dist}" == ".el7"
108 /bin/systemctl --no-reload disable %{name}.service &>/dev/null || :
109 /bin/systemctl stop %{name}.service &>/dev/null || :
110 %else
111 /sbin/service %{name} stop || :
112 /sbin/chkconfig --del %{name}
113 %endif
114 fi
83 115
84 116
85 %postun 117 %postun
86 [ $1 = 0 ] && userdel %{name} || : 118 if [ $1 -ge 1 ]; then
119 # package upgrade, not uninstall
120 %if "%{?dist}" == ".el7"
121 /bin/systemctl try-restart %{name}.service &>/dev/null || :
122 %else
123 /sbin/service %{name} restart || :
124 %endif
125 fi
87 126
88 127
89 %clean 128 %clean
90 rm -rf $RPM_BUILD_ROOT 129 rm -rf %{buildroot}
91 130
92 131
93 %files 132 %files
94 %defattr(-,root,root,-) 133 %defattr(-,root,root,-)
95 %{_sbindir}/* 134 %{_sbindir}/*
96 %{_mandir}/man1/* 135 %{_mandir}/man1/*
97 %{_mandir}/man5/* 136 %{_mandir}/man5/*
98 %docdir %{_datadir}/doc/%{name}-%{version} 137 %docdir %{_datadir}/doc/%{name}-%{version}
99 %{_datadir}/doc/%{name}-%{version} 138 %{_datadir}/doc/%{name}-%{version}
100 %config(noreplace) %attr(0750,%{name},root) %{_sysconfdir}/%{name} 139 %config(noreplace) %attr(0750,%{name},root) %{_sysconfdir}/%{name}
101 /etc/rc.d/init.d/%{name} 140 %if "%{?dist}" == ".el7"
141 %{_prefix}/lib/tmpfiles.d/%{name}.conf
142 %{_unitdir}/%{name}.service
143 %else
144 %{_initrddir}/%{name}
145 %endif
102 %dir %attr(0750,%{name},root) /var/run/%{name} 146 %dir %attr(0750,%{name},root) /var/run/%{name}
103 147
104 148
105 %changelog 149 %changelog
150 * Tue Feb 07 2017 Carl Byington <carl@five-ten-sg.com> - 6.49-1
151 - RHEL7 systemd and /var/run is on tmpfs
152
106 * Tue Dec 20 2016 Carl Byington <carl@five-ten-sg.com> - 6.48-1 153 * Tue Dec 20 2016 Carl Byington <carl@five-ten-sg.com> - 6.48-1
107 - allow dkim whitelisting. 154 - allow dkim whitelisting.
108 155
109 * Wed Sep 21 2016 Carl Byington <carl@five-ten-sg.com> - 6.47-1 156 * Wed Sep 21 2016 Carl Byington <carl@five-ten-sg.com> - 6.47-1
110 - Better smtp verify logging 157 - Better smtp verify logging