]> git.pld-linux.org Git - packages/policyd.git/blob - policyd.spec
24421a6742a31d5c66c5e5e409b4756b65b2ace2
[packages/policyd.git] / policyd.spec
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
4 Name:           policyd
5 Version:        2.0.10
6 Release:        3
7 License:        GPL v2
8 Group:          Networking
9 Source0:        http://downloads.sourceforge.net/policyd/cluebringer-%{version}.tar.bz2
10 # Source0-md5:  cdff8f8e7c0e95143f7108159aed80c6
11 Source1:        apache.conf
12 Source2:        %{name}.sysconfig
13 Source3:        %{name}.conf
14 Source4:        %{name}.init
15 Source5:        %{name}.tmpfiles
16 Patch0:         config.patch
17 URL:            http://www.policyd.org/
18 BuildRequires:  bash
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}
29 Requires:       rc-scripts
30 Provides:       group(policyd)
31 Provides:       user(policyd)
32 BuildArch:      noarch
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         _webapps        /etc/webapps
36 %define         _webapp         %{name}-webui
37 %define         _webappdir      %{_datadir}/%{_webapp}
38
39 %description
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
48 hosting industry.
49
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
57 HELO.
58
59 %package -n perl-cbp
60 Summary:        Policyd "ClueBringer" Perl Libraries
61 Group:          Development/Languages/Perl
62
63 %description -n perl-cbp
64 Policyd "ClueBringer" Perl Libraries.
65
66 %package webui
67 Summary:        Policyd Web Administration
68 Group:          Applications/WWW
69 Requires:       php-pdo
70 Requires:       webapps
71 Requires:       webserver(access)
72 Requires:       webserver(alias)
73 Requires:       webserver(php)
74
75 %description webui
76 Policyd Web Administration.
77
78 %prep
79 %setup -q -n cluebringer-%{version}
80 %patch0 -p1
81
82 %build
83 cd database
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
89         cd whitelists
90                 ./parse-checkhelo-whitelist >> policyd.$db_type.sql
91                 ./parse-greylisting-whitelist >> policyd.$db_type.sql
92         cd ..
93 done
94
95 %install
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
100
101 # perl lib
102 cp -a cbp $RPM_BUILD_ROOT%{perl_vendorlib}
103
104 # cbpolicyd
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}
109
110 # Webui
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
117
118 install %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %pre
124 %groupadd -g 121 -r policyd
125 %useradd -M -o -r -u 121 -d / -s /bin/false -g policyd -c "Postfix Policy Daemon" policyd
126
127 %post
128 /sbin/chkconfig --add policyd
129 %service policyd restart
130
131 %preun
132 if [ "$1" = "0" ]; then
133         %service policyd stop
134         /sbin/chkconfig --del policyd
135 fi
136
137 %postun
138 if [ "$1" = "0" ]; then
139         %userremove policyd
140         %groupremove policyd
141 fi
142
143 %triggerin webui -- apache1 < 1.3.37-3, apache1-base
144 %webapp_register apache %{_webapp}
145
146 %triggerun webui -- apache1 < 1.3.37-3, apache1-base
147 %webapp_unregister apache %{_webapp}
148
149 %triggerin webui -- apache < 2.2.0, apache-base
150 %webapp_register httpd %{_webapp}
151
152 %triggerun webui -- apache < 2.2.0, apache-base
153 %webapp_unregister httpd %{_webapp}
154
155 %triggerin webui -- lighttpd
156 %webapp_register lighttpd %{_webapp}
157
158 %triggerun webui -- lighttpd
159 %webapp_unregister lighttpd %{_webapp}
160
161 %files
162 %defattr(644,root,root,755)
163 %doc AUTHORS CHANGELOG INSTALL TODO WISHLIST
164 %doc database/*.sql
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
175
176 %files -n perl-cbp
177 %defattr(644,root,root,755)
178 %{perl_vendorlib}/cbp
179
180 %files webui
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
186 %{_webappdir}
This page took 0.059561 seconds and 2 git commands to generate.