1 %include /usr/lib/rpm/macros.perl
2 Summary: Policyd - an anti-spam plugin for Postfix
3 Summary(pl.UTF-8): Policyd - wtyczka antyspamowa dla Postfiksa
9 Source0: http://downloads.sourceforge.net/policyd/cluebringer-%{version}.tar.bz2
10 # Source0-md5: cdff8f8e7c0e95143f7108159aed80c6
12 Source2: %{name}.sysconfig
15 Source5: %{name}.tmpfiles
17 URL: http://www.policyd.org/
19 BuildRequires: rpm-perlprov >= 4.1-13
20 Requires(pre): /bin/id
21 Requires(pre): /usr/bin/getgid
22 Requires(pre): /usr/sbin/groupadd
23 Requires(pre): /usr/sbin/useradd
24 Requires(post,preun): /sbin/chkconfig
25 Requires(postun): /usr/sbin/groupdel
26 Requires(postun): /usr/sbin/userdel
27 Requires: perl-Net-CIDR
28 Requires: perl-cbp = %{version}-%{release}
30 Provides: group(policyd)
31 Provides: user(policyd)
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 %define _webapps /etc/webapps
36 %define _webapp %{name}-webui
37 %define _webappdir %{_datadir}/%{_webapp}
40 Policyd v2 (codenamed "cluebringer") is a multi-platform policy server
41 for popular MTAs. This policy daemon is designed mostly for large
42 scale mail hosting environments. The main goal is to implement as many
43 spam combating and email compliance features as possible while at the
44 same time maintaining the portability, stability and performance
45 required for mission critical email hosting of today. Most of the
46 ideas and methods implemented in Policyd v2 stem from Policyd v1
47 aswell as the authors' long time involvement in large scale mail
50 %description -l pl.UTF-8
51 Policyd to wtyczka antyspamowa dla Postfiksa obsługująca szare listy,
52 tłumienie (liczby lub objętości wiadomości w ciągu jednostki czasu)
53 oparte na nadawcy (według koperty, uwierzytelnienia SASL albo
54 hosta/IP), ograniczanie częstotliwości dostarczania do nadawcy,
55 monitorowanie/dodawanie do czarnej listy pułapek spamowych,
56 automatyczne dodawanie do czarnej listy HELO i zapobieganie losowemu
60 Summary: Policyd "ClueBringer" Perl Libraries
61 Group: Development/Languages/Perl
63 %description -n perl-cbp
64 Policyd "ClueBringer" Perl Libraries.
67 Summary: Policyd Web Administration
68 Group: Applications/WWW
71 Requires: webserver(access)
72 Requires: webserver(alias)
73 Requires: webserver(php)
76 Policyd Web Administration.
79 %setup -q -n cluebringer-%{version}
84 for db_type in mysql4 mysql pgsql sqlite; do
85 ./convert-tsql $db_type core.tsql > policyd.$db_type.sql
86 for file in $(find . -name '*.tsql' -and -not -name core.tsql); do
87 ./convert-tsql $db_type $file
88 done >> policyd.$db_type.sql
90 ./parse-checkhelo-whitelist >> policyd.$db_type.sql
91 ./parse-greylisting-whitelist >> policyd.$db_type.sql
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT{%{perl_vendorlib},%{_webapps}/%{_webapp},%{_webappdir}} \
98 $RPM_BUILD_ROOT{%{_sysconfdir}/policyd,%{_sbindir},/etc/{rc.d/init.d,sysconfig},/var/run/%{name}} \
99 $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
102 cp -a cbp $RPM_BUILD_ROOT%{perl_vendorlib}
105 install -p cbpolicyd cbpadmin database/convert-tsql $RPM_BUILD_ROOT%{_sbindir}
106 cp -a cluebringer.conf $RPM_BUILD_ROOT%{_sysconfdir}/policyd/cluebringer.conf
107 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
108 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
111 cp -R webui/* $RPM_BUILD_ROOT%{_webappdir}
112 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
113 cp -a $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{apache,httpd}.conf
114 # Move config into %{_sysconfdir}
115 mv $RPM_BUILD_ROOT%{_webappdir}/includes/config.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
116 ln -s %{_webapps}/%{_webapp}/config.php $RPM_BUILD_ROOT%{_webappdir}/includes
118 install %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
121 rm -rf $RPM_BUILD_ROOT
124 %groupadd -g 121 -r policyd
125 %useradd -M -o -r -u 121 -d / -s /bin/false -g policyd -c "Postfix Policy Daemon" policyd
128 /sbin/chkconfig --add policyd
129 %service policyd restart
132 if [ "$1" = "0" ]; then
133 %service policyd stop
134 /sbin/chkconfig --del policyd
138 if [ "$1" = "0" ]; then
143 %triggerin webui -- apache1 < 1.3.37-3, apache1-base
144 %webapp_register apache %{_webapp}
146 %triggerun webui -- apache1 < 1.3.37-3, apache1-base
147 %webapp_unregister apache %{_webapp}
149 %triggerin webui -- apache < 2.2.0, apache-base
150 %webapp_register httpd %{_webapp}
152 %triggerun webui -- apache < 2.2.0, apache-base
153 %webapp_unregister httpd %{_webapp}
155 %triggerin webui -- lighttpd
156 %webapp_register lighttpd %{_webapp}
158 %triggerun webui -- lighttpd
159 %webapp_unregister lighttpd %{_webapp}
162 %defattr(644,root,root,755)
163 %doc AUTHORS CHANGELOG INSTALL TODO WISHLIST
165 %doc contrib/amavisd-new
166 %attr(755,root,root) %{_sbindir}/cbpadmin
167 %attr(755,root,root) %{_sbindir}/cbpolicyd
168 %attr(755,root,root) %{_sbindir}/convert-tsql
169 %dir %attr(750,root,policyd) %{_sysconfdir}/%{name}
170 %config(noreplace) %verify(not md5 mtime size) %attr(640,root,policyd) %{_sysconfdir}/%{name}/cluebringer.conf
171 %attr(754,root,root) /etc/rc.d/init.d/%{name}
172 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
173 %dir %attr(775,root,policyd) /var/run/%{name}
174 /usr/lib/tmpfiles.d/%{name}.conf
177 %defattr(644,root,root,755)
178 %{perl_vendorlib}/cbp
181 %defattr(644,root,root,755)
182 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
183 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
184 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
185 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/config.php