]> git.pld-linux.org Git - packages/policyd.git/blame - policyd.spec
- up to 2.1.x line (devel) - accountig feature most importanted (not
[packages/policyd.git] / policyd.spec
CommitLineData
8ae0ccbc 1%include /usr/lib/rpm/macros.perl
8c594927 2Summary: Policyd - an anti-spam plugin for Postfix
2f319ac2 3Summary(pl.UTF-8): Policyd - wtyczka antyspamowa dla Postfiksa
2ba71aca 4Name: policyd
54c803d5
ŁC
5Version: 2.1.x
6%define rel 201211111115
7Release: 5
2ba71aca 8License: GPL v2
9Group: Networking
54c803d5
ŁC
10Source0: http://devlabs.linuxassist.net/attachments/download/255/cluebringer-v%{version}-%{rel}.tar.bz2
11# Source0-md5: 72c02a80e8ce60c72410ae41bb22265d
76c32aab 12Source1: apache.conf
f12d26ae
ER
13Source2: %{name}.sysconfig
14Source3: %{name}.conf
15Source4: %{name}.init
b4a9996f 16Source5: %{name}.tmpfiles
28308650 17Patch0: config.patch
f12d26ae 18URL: http://www.policyd.org/
d77e64c3 19BuildRequires: bash
8ae0ccbc 20BuildRequires: rpm-perlprov >= 4.1-13
bf530915
JB
21Requires(pre): /bin/id
22Requires(pre): /usr/bin/getgid
23Requires(pre): /usr/sbin/groupadd
24Requires(pre): /usr/sbin/useradd
25Requires(post,preun): /sbin/chkconfig
26Requires(postun): /usr/sbin/groupdel
27Requires(postun): /usr/sbin/userdel
e80858f3 28Requires: perl-Net-CIDR
8ae0ccbc 29Requires: perl-cbp = %{version}-%{release}
54c803d5 30Requires: perl-awitpt = %{version}-%{release}
bf530915 31Requires: rc-scripts
bf530915
JB
32Provides: group(policyd)
33Provides: user(policyd)
d77e64c3 34BuildArch: noarch
2ba71aca 35BuildRoot: %{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
42Policyd v2 (codenamed "cluebringer") is a multi-platform policy server
43for popular MTAs. This policy daemon is designed mostly for large
44scale mail hosting environments. The main goal is to implement as many
45spam combating and email compliance features as possible while at the
46same time maintaining the portability, stability and performance
47required for mission critical email hosting of today. Most of the
48ideas and methods implemented in Policyd v2 stem from Policyd v1
49aswell as the authors' long time involvement in large scale mail
50hosting industry.
2ba71aca 51
1426836e
JR
52%description -l pl.UTF-8
53Policyd to wtyczka antyspamowa dla Postfiksa obsługująca szare listy,
54tłumienie (liczby lub objętości wiadomości w ciągu jednostki czasu)
55oparte na nadawcy (według koperty, uwierzytelnienia SASL albo
56hosta/IP), ograniczanie częstotliwości dostarczania do nadawcy,
57monitorowanie/dodawanie do czarnej listy pułapek spamowych,
8c594927
JB
58automatyczne dodawanie do czarnej listy HELO i zapobieganie losowemu
59HELO.
60
8ae0ccbc
ER
61%package -n perl-cbp
62Summary: Policyd "ClueBringer" Perl Libraries
63Group: Development/Languages/Perl
64
65%description -n perl-cbp
66Policyd "ClueBringer" Perl Libraries.
67
54c803d5
ŁC
68%package -n perl-awitpt
69Summary: Another Policyd "ClueBringer" Perl Libraries
70Group: Development/Languages/Perl
71
72%description -n perl-awitpt
73Another Policyd "ClueBringer" Perl Libraries.
74
75
d77e64c3 76%package webui
76c32aab 77Summary: Policyd Web Administration
d77e64c3 78Group: Applications/WWW
4912f92a 79Requires: php-pdo
76c32aab
ER
80Requires: webapps
81Requires: webserver(access)
82Requires: webserver(alias)
83Requires: webserver(php)
d77e64c3
ER
84
85%description webui
76c32aab 86Policyd 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
93cd database
94for 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 ..
103done
2ba71aca 104
105%install
106rm -rf $RPM_BUILD_ROOT
b4a9996f 107install -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 112cp -a cbp $RPM_BUILD_ROOT%{perl_vendorlib}
54c803d5 113cp -a awitpt/awitpt $RPM_BUILD_ROOT%{perl_vendorlib}
b4a9996f 114
d77e64c3 115# cbpolicyd
d77e64c3
ER
116install -p cbpolicyd cbpadmin database/convert-tsql $RPM_BUILD_ROOT%{_sbindir}
117cp -a cluebringer.conf $RPM_BUILD_ROOT%{_sysconfdir}/policyd/cluebringer.conf
f12d26ae 118install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
d77e64c3
ER
119cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
120
121# Webui
76c32aab
ER
122cp -R webui/* $RPM_BUILD_ROOT%{_webappdir}
123cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
d77e64c3
ER
124cp -a $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{apache,httpd}.conf
125# Move config into %{_sysconfdir}
76c32aab
ER
126mv $RPM_BUILD_ROOT%{_webappdir}/includes/config.php $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
127ln -s %{_webapps}/%{_webapp}/config.php $RPM_BUILD_ROOT%{_webappdir}/includes
2ba71aca 128
b4a9996f
JR
129install %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
130
2ba71aca 131%clean
132rm -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
143if [ "$1" = "0" ]; then
d77e64c3 144 %service policyd stop
2ba71aca 145 /sbin/chkconfig --del policyd
146fi
147
148%postun
149if [ "$1" = "0" ]; then
150 %userremove policyd
151 %groupremove policyd
152fi
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}
This page took 0.103952 seconds and 4 git commands to generate.