]>
Commit | Line | Data |
---|---|---|
8ae0ccbc | 1 | %include /usr/lib/rpm/macros.perl |
8c594927 | 2 | Summary: Policyd - an anti-spam plugin for Postfix |
2f319ac2 | 3 | Summary(pl.UTF-8): Policyd - wtyczka antyspamowa dla Postfiksa |
2ba71aca | 4 | Name: policyd |
54c803d5 ŁC |
5 | Version: 2.1.x |
6 | %define rel 201211111115 | |
7 | Release: 5 | |
2ba71aca | 8 | License: GPL v2 |
9 | Group: Networking | |
54c803d5 ŁC |
10 | Source0: http://devlabs.linuxassist.net/attachments/download/255/cluebringer-v%{version}-%{rel}.tar.bz2 |
11 | # Source0-md5: 72c02a80e8ce60c72410ae41bb22265d | |
76c32aab | 12 | Source1: apache.conf |
f12d26ae ER |
13 | Source2: %{name}.sysconfig |
14 | Source3: %{name}.conf | |
15 | Source4: %{name}.init | |
b4a9996f | 16 | Source5: %{name}.tmpfiles |
28308650 | 17 | Patch0: config.patch |
f12d26ae | 18 | URL: http://www.policyd.org/ |
d77e64c3 | 19 | BuildRequires: bash |
8ae0ccbc | 20 | BuildRequires: rpm-perlprov >= 4.1-13 |
bf530915 JB |
21 | Requires(pre): /bin/id |
22 | Requires(pre): /usr/bin/getgid | |
23 | Requires(pre): /usr/sbin/groupadd | |
24 | Requires(pre): /usr/sbin/useradd | |
25 | Requires(post,preun): /sbin/chkconfig | |
26 | Requires(postun): /usr/sbin/groupdel | |
27 | Requires(postun): /usr/sbin/userdel | |
e80858f3 | 28 | Requires: perl-Net-CIDR |
8ae0ccbc | 29 | Requires: perl-cbp = %{version}-%{release} |
54c803d5 | 30 | Requires: perl-awitpt = %{version}-%{release} |
bf530915 | 31 | Requires: rc-scripts |
bf530915 JB |
32 | Provides: group(policyd) |
33 | Provides: user(policyd) | |
d77e64c3 | 34 | BuildArch: noarch |
2ba71aca | 35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
36 | ||
d77e64c3 | 37 | %define _webapps /etc/webapps |
64faf837 ER |
38 | %define _webapp %{name}-webui |
39 | %define _webappdir %{_datadir}/%{_webapp} | |
d77e64c3 | 40 | |
2ba71aca | 41 | %description |
f12d26ae ER |
42 | Policyd v2 (codenamed "cluebringer") is a multi-platform policy server |
43 | for popular MTAs. This policy daemon is designed mostly for large | |
44 | scale mail hosting environments. The main goal is to implement as many | |
45 | spam combating and email compliance features as possible while at the | |
46 | same time maintaining the portability, stability and performance | |
47 | required for mission critical email hosting of today. Most of the | |
48 | ideas and methods implemented in Policyd v2 stem from Policyd v1 | |
49 | aswell as the authors' long time involvement in large scale mail | |
50 | hosting industry. | |
2ba71aca | 51 | |
1426836e JR |
52 | %description -l pl.UTF-8 |
53 | Policyd to wtyczka antyspamowa dla Postfiksa obsługująca szare listy, | |
54 | tłumienie (liczby lub objętości wiadomości w ciągu jednostki czasu) | |
55 | oparte na nadawcy (według koperty, uwierzytelnienia SASL albo | |
56 | hosta/IP), ograniczanie częstotliwości dostarczania do nadawcy, | |
57 | monitorowanie/dodawanie do czarnej listy pułapek spamowych, | |
8c594927 JB |
58 | automatyczne dodawanie do czarnej listy HELO i zapobieganie losowemu |
59 | HELO. | |
60 | ||
8ae0ccbc ER |
61 | %package -n perl-cbp |
62 | Summary: Policyd "ClueBringer" Perl Libraries | |
63 | Group: Development/Languages/Perl | |
64 | ||
65 | %description -n perl-cbp | |
66 | Policyd "ClueBringer" Perl Libraries. | |
67 | ||
54c803d5 ŁC |
68 | %package -n perl-awitpt |
69 | Summary: Another Policyd "ClueBringer" Perl Libraries | |
70 | Group: Development/Languages/Perl | |
71 | ||
72 | %description -n perl-awitpt | |
73 | Another Policyd "ClueBringer" Perl Libraries. | |
74 | ||
75 | ||
d77e64c3 | 76 | %package webui |
76c32aab | 77 | Summary: Policyd Web Administration |
d77e64c3 | 78 | Group: Applications/WWW |
4912f92a | 79 | Requires: php-pdo |
76c32aab ER |
80 | Requires: webapps |
81 | Requires: webserver(access) | |
82 | Requires: webserver(alias) | |
83 | Requires: webserver(php) | |
d77e64c3 ER |
84 | |
85 | %description webui | |
76c32aab | 86 | Policyd Web Administration. |
d77e64c3 | 87 | |
2ba71aca | 88 | %prep |
54c803d5 | 89 | %setup -q -n cluebringer-v%{version}-%{rel} |
28308650 | 90 | %patch0 -p1 |
2ba71aca | 91 | |
92 | %build | |
d77e64c3 ER |
93 | cd database |
94 | for db_type in mysql4 mysql pgsql sqlite; do | |
95 | ./convert-tsql $db_type core.tsql > policyd.$db_type.sql | |
96 | for file in $(find . -name '*.tsql' -and -not -name core.tsql); do | |
97 | ./convert-tsql $db_type $file | |
98 | done >> policyd.$db_type.sql | |
99 | cd whitelists | |
100 | ./parse-checkhelo-whitelist >> policyd.$db_type.sql | |
101 | ./parse-greylisting-whitelist >> policyd.$db_type.sql | |
102 | cd .. | |
103 | done | |
2ba71aca | 104 | |
105 | %install | |
106 | rm -rf $RPM_BUILD_ROOT | |
b4a9996f | 107 | install -d $RPM_BUILD_ROOT{%{perl_vendorlib},%{_webapps}/%{_webapp},%{_webappdir}} \ |
54c803d5 | 108 | $RPM_BUILD_ROOT{%{_sysconfdir}/policyd,%{_sbindir},/etc/{rc.d/init.d,sysconfig},/var/run/%{name},/var/log/%{name}} \ |
b4a9996f JR |
109 | $RPM_BUILD_ROOT/usr/lib/tmpfiles.d |
110 | ||
54c803d5 | 111 | # perl libs |
8ae0ccbc | 112 | cp -a cbp $RPM_BUILD_ROOT%{perl_vendorlib} |
54c803d5 | 113 | cp -a awitpt/awitpt $RPM_BUILD_ROOT%{perl_vendorlib} |
b4a9996f | 114 | |
d77e64c3 | 115 | # cbpolicyd |
d77e64c3 ER |
116 | install -p cbpolicyd cbpadmin database/convert-tsql $RPM_BUILD_ROOT%{_sbindir} |
117 | cp -a cluebringer.conf $RPM_BUILD_ROOT%{_sysconfdir}/policyd/cluebringer.conf | |
f12d26ae | 118 | install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
d77e64c3 ER |
119 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} |
120 | ||
121 | # Webui | |
76c32aab ER |
122 | cp -R webui/* $RPM_BUILD_ROOT%{_webappdir} |
123 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf | |
d77e64c3 ER |
124 | cp -a $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{apache,httpd}.conf |
125 | # Move config into %{_sysconfdir} | |
76c32aab ER |
126 | mv $RPM_BUILD_ROOT%{_webappdir}/includes/config.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp} |
127 | ln -s %{_webapps}/%{_webapp}/config.php $RPM_BUILD_ROOT%{_webappdir}/includes | |
2ba71aca | 128 | |
b4a9996f JR |
129 | install %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf |
130 | ||
2ba71aca | 131 | %clean |
132 | rm -rf $RPM_BUILD_ROOT | |
133 | ||
134 | %pre | |
135 | %groupadd -g 121 -r policyd | |
136 | %useradd -M -o -r -u 121 -d / -s /bin/false -g policyd -c "Postfix Policy Daemon" policyd | |
137 | ||
138 | %post | |
139 | /sbin/chkconfig --add policyd | |
d77e64c3 | 140 | %service policyd restart |
2ba71aca | 141 | |
142 | %preun | |
143 | if [ "$1" = "0" ]; then | |
d77e64c3 | 144 | %service policyd stop |
2ba71aca | 145 | /sbin/chkconfig --del policyd |
146 | fi | |
147 | ||
148 | %postun | |
149 | if [ "$1" = "0" ]; then | |
150 | %userremove policyd | |
151 | %groupremove policyd | |
152 | fi | |
153 | ||
54c803d5 | 154 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
d77e64c3 ER |
155 | %webapp_register apache %{_webapp} |
156 | ||
54c803d5 | 157 | %triggerun -- apache1 < 1.3.37-3, apache1-base |
d77e64c3 ER |
158 | %webapp_unregister apache %{_webapp} |
159 | ||
54c803d5 | 160 | %triggerin -- apache < 2.2.0, apache-base |
d77e64c3 ER |
161 | %webapp_register httpd %{_webapp} |
162 | ||
54c803d5 | 163 | %triggerun -- apache < 2.2.0, apache-base |
d77e64c3 ER |
164 | %webapp_unregister httpd %{_webapp} |
165 | ||
54c803d5 | 166 | %triggerin -- lighttpd |
d77e64c3 ER |
167 | %webapp_register lighttpd %{_webapp} |
168 | ||
54c803d5 | 169 | %triggerun -- lighttpd |
d77e64c3 ER |
170 | %webapp_unregister lighttpd %{_webapp} |
171 | ||
2ba71aca | 172 | %files |
173 | %defattr(644,root,root,755) | |
54c803d5 | 174 | %doc AUTHORS INSTALL TODO WISHLIST |
d77e64c3 ER |
175 | %doc database/*.sql |
176 | %doc contrib/amavisd-new | |
177 | %attr(755,root,root) %{_sbindir}/cbpadmin | |
178 | %attr(755,root,root) %{_sbindir}/cbpolicyd | |
179 | %attr(755,root,root) %{_sbindir}/convert-tsql | |
28308650 ER |
180 | %dir %attr(750,root,policyd) %{_sysconfdir}/%{name} |
181 | %config(noreplace) %verify(not md5 mtime size) %attr(640,root,policyd) %{_sysconfdir}/%{name}/cluebringer.conf | |
bf530915 | 182 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
d77e64c3 | 183 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
abacb60d | 184 | %dir %attr(775,root,policyd) /var/run/%{name} |
54c803d5 | 185 | %dir %attr(775,root,policyd) /var/log/%{name} |
b4a9996f | 186 | /usr/lib/tmpfiles.d/%{name}.conf |
d77e64c3 | 187 | |
8ae0ccbc ER |
188 | %files -n perl-cbp |
189 | %defattr(644,root,root,755) | |
190 | %{perl_vendorlib}/cbp | |
d77e64c3 | 191 | |
54c803d5 ŁC |
192 | %files -n perl-awitpt |
193 | %defattr(644,root,root,755) | |
194 | %{perl_vendorlib}/awitpt | |
195 | ||
196 | ||
d77e64c3 ER |
197 | %files webui |
198 | %defattr(644,root,root,755) | |
199 | %dir %attr(750,root,http) %{_webapps}/%{_webapp} | |
200 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf | |
201 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf | |
202 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/config.php | |
76c32aab | 203 | %{_webappdir} |