Debian Codegraph @

packaging/rpm/qpsmtpd.spec.in

raw
1 %{!?_package:%define _package @PACKAGE@}
2 %{!?_version:%define _version @VERSION@}
3 %{!?_release:%define _release @RELEASE@}
4
5 Name: %{_package}
6 Version: %{_version}
7 Release: %{_release}
8
9 Summary: qpsmtpd + qpsmtpd-apache + qpsmtpd-async
10 License: MIT
11 Group: System Environment/Daemons
12 URL: http://smtpd.develooper.com/
13 BuildRoot: %{_builddir}/%{name}-%{version}-%{release}-root
14 BuildRequires: perl >= 0:5.00503
15 BuildRequires: perl(ExtUtils::MakeMaker)
16 BuildArchitectures: noarch
17 Requires: perl(Mail::Header), perl(Net::DNS) perl(Net::IP) perl(IPC::Shareable)
18 Requires(pre): coreutils, shadow-utils, perl
19
20 Source0: %{name}-%{version}-%{release}.tar.gz
21 Source1: qpsmtpd-forkserver.rc
22 Source2: qpsmtpd-forkserver.sysconfig
23 Source3: qpsmtpd-xinetd
24 Source4: in.qpsmtpd
25 Source5: qpsmtpd.conf
26 Source6: README.selinux
27
28 %description
29 qpsmtpd is a flexible smtpd daemon written in Perl. Apart from the core
30 SMTP features, all functionality is implemented in small "extension
31 plugins" using the easy to use object oriented plugin API.
32
33 qpsmtpd was originally written as a drop-in qmail-smtpd replacement, but
34 now it also includes a smtp forward and a postfix "backend".
35
36 %package apache
37 Requires: perl(mod_perl2)
38 Summary: mod_perl-2 connection handler for qpsmtpd
39 Group: System Environment/Daemons
40
41 %package async
42 Summary: qpsmtpd using async I/O in a single process
43 Group: System Environment/Daemons
44
45 %package xinetd
46 Summary: xinetd support for qpsmtpd
47 Group: System Environment/Daemons
48 Requires: xinetd
49
50 %description apache
51
52 This module implements a mod_perl/apache 2.0 connection handler
53 that turns Apache into an SMTP server using Qpsmtpd.
54
55 %description async
56 This package contains the Qpsmtpd::PollServer module, which allows
57 qpsmtd to handle many connections in a single process and the
58 qpsmpd-async which uses it.
59
60 %description xinetd
61 This package contains the xinetd startup files for qpsmptd.
62
63 %prep
64 %setup -q -n %{name}-%{version}-%{release}
65
66 %build
67 CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLSITELIB=%{_prefix}/lib/perl5/site_perl
68 make
69
70 %clean
71 rm -rf $RPM_BUILD_ROOT
72 %install
73
74 rm -rf $RPM_BUILD_ROOT
75 eval `perl '-V:installarchlib'`
76 mkdir -p $RPM_BUILD_ROOT/$installarchlib
77 if grep -q DESTDIR Makefile
78 then
79 make DESTDIR=$RPM_BUILD_ROOT
80 find blib/lib -name '*.pm.*' -exec rm -f {} \;
81 make DESTDIR=$RPM_BUILD_ROOT install
82
83 else
84 make PREFIX=$RPM_BUILD_ROOT/usr
85 find blib/lib -name '*.pm.*' -exec rm -f {} \;
86 make PREFIX=$RPM_BUILD_ROOT/usr install
87 fi
88 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}
89 rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/plugins/*.*
90 cp -r plugins ${RPM_BUILD_ROOT}%{_datadir}/%{name}/plugins
91 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}
92 rm -f ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/*.*
93 cp -r config.sample/* ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/
94 echo %{_datadir}/%{name}/plugins > ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/plugin_dirs
95 echo %{_localstatedir}/spool/qpsmtpd > ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/spool_dir
96 mkdir -p ${RPM_BUILD_ROOT}%{_initrddir}
97 cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_initrddir}/qpsmtpd-forkserver
98 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
99 cp %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/qpsmtpd-forkserver
100 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/spool/qpsmtpd
101 mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/qpsmtpd
102 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/xinetd.d
103 cp %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/xinetd.d/smtp
104 mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
105 cp %{SOURCE4} ${RPM_BUILD_ROOT}%{_sbindir}/in.qpsmtpd
106 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d
107 cp %{SOURCE5} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d
108 mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-apache-%{version}
109 cp %{SOURCE6} $RPM_BUILD_ROOT%{_docdir}/%{name}-apache-%{version}
110
111 [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
112
113 find ${RPM_BUILD_ROOT}%{_prefix} \( -name perllocal.pod -o -name .packlist \) -exec rm {} \;
114 find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \
115 sed "s@^$RPM_BUILD_ROOT@@g" | \
116 grep -v [Aa]sync | \
117 grep -v packaging | \
118 grep -v README.selinux | \
119 grep -v in\\.qpsmtpd | \
120 grep -v /Apache | \
121 grep -v /Danga | \
122 grep -v ConfigServer | \
123 grep -v Qpsmtpd/PollServer.pm > %{name}-%{version}-%{release}-filelist
124 if [ "$(cat %{name}-%{version}-%{release}-filelist)X" = "X" ] ; then
125 echo "ERROR: EMPTY FILE LIST"
126 exit -1
127 fi
128
129 find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \
130 sed "s@^$RPM_BUILD_ROOT@@g" | \
131 grep -v packaging | \
132 grep -v README.selinux | \
133 grep -v /Apache | cat - %{name}-%{version}-%{release}-filelist | sort | uniq -u > %{name}-%{version}-%{release}-async-filelist
134 if [ "$(cat %{name}-%{version}-%{release}-async-filelist)X" = "X" ] ; then
135 echo "ERROR: EMPTY FILE LIST"
136 exit -1
137 fi
138
139 find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \
140 sed "s@^$RPM_BUILD_ROOT@@g" | \
141 grep -v [Aa]sync | \
142 grep -v packaging | \
143 grep -v /Danga | \
144 grep -v ConfigServer | \
145 grep -v Qpsmtpd/PollServer.pm | cat - %{name}-%{version}-%{release}-filelist | sort | uniq -u > %{name}-%{version}-%{release}-apache-filelist
146 if [ "$(cat %{name}-%{version}-%{release}-apache-filelist)X" = "X" ] ; then
147 echo "ERROR: EMPTY FILE LIST"
148 exit -1
149 fi
150
151 %files -f %{name}-%{version}-%{release}-filelist
152 %defattr(-,root,root)
153 %doc CREDITS Changes LICENSE README README.plugins STATUS
154 %{_initrddir}/qpsmtpd-forkserver
155 %config(noreplace) %{_sysconfdir}/qpsmtpd/*
156 %config(noreplace) %{_sysconfdir}/sysconfig/qpsmtpd-forkserver
157 %attr(2750,qpsmtpd,clamav) %dir %{_localstatedir}/spool/qpsmtpd
158 %attr(0750,smtpd,smtpd) %dir %{_localstatedir}/log/qpsmtpd
159
160 %files apache -f %{name}-%{version}-%{release}-apache-filelist
161 %defattr(-,root,root)
162 %config(noreplace) %{_sysconfdir}/httpd/conf.d/*
163 %doc %{_docdir}/%{name}-apache-%{version}/README.selinux
164
165 %files async -f %{name}-%{version}-%{release}-async-filelist
166 %defattr(-,root,root)
167 %{_datadir}/%{name}/plugins/async/*
168
169 %files xinetd
170 %defattr(-,root,root)
171 %config(noreplace) %{_sysconfdir}/xinetd.d/smtp
172 %{_sbindir}/in.qpsmtpd
173
174 %pre
175 if ! id smtpd >/dev/null 2>&1
176 then
177 # need to create smtpd user.
178 if perl -e 'exit ! defined(getgrnam("postdrop"))'
179 then
180 # if postfix is installed, we will probably use
181 # queue/postfix, which will need this:
182 supp="-G postdrop"
183 fi
184 useradd -r -M -s /bin/false $supp smtpd
185 fi
186
187 %changelog
188 * Fri Oct 14 2011 <[email protected]> 0.84-1
189 - Removed rpm/files/qpsmtpd-plugin-file_connection as there's a
190 newer version in plugins/logging/file
191
192 * Sat Feb 13 2010 <[email protected]>
193 - Split out xinetd files into separate RPM
194
195 * Sun Jul 12 2009 <[email protected]> 0.82-0.1
196 - Update to latest release
197 - don't add qpsmtpd to start-up by default
198 - add apache config file to qpsmtpd-apache package
199 - remove all patches
200 - use rpm macros for dirs
201 - use a filelist for main package instead of a long list of files
202
203 * Tue Jul 15 2008 <[email protected]> 0.43-0.7
204 - Removed SelectServer.pm from .spec file
205
206 * Tue Mar 18 2008 <[email protected]> 0.43-0.6
207 - moved config files back to /etc/qpsmtpd following some changes
208 to the qpsmtpd src
209
210 * Tue Mar 18 2008 <[email protected]> 0.43-0.5
211 - moved config files to /etc/qpsmtpd/config
212
213 * Tue Mar 18 2008 <[email protected]> 0.43-0.4
214 - Moved qpsmtpd-async to /usr/bin
215 - Added qpsmtpd-async man page to async package
216 - Added async smtproute plugin to async package
217
218 * Wed Mar 12 2008 <[email protected]> 0.43-0.3
219 - Makefile.PL now updated in svn, so remove hack
220
221 * Wed Mar 12 2008 <[email protected]> 0.43-0.2
222 - Added qpsmtpd-prefork to qpsmtpd RPM, inc. hack to work round
223 deficiency in Makefile.PL
224
225 * Mon Mar 10 2008 <[email protected]> 0.43-0.1
226 - Updated to work with Makefile to build from svn
227
228 * Wed Sep 12 2007 <[email protected]> 0.40-2.0
229 - Updated to build trunk-r790
230
231 * Tue Jun 12 2007 <[email protected]> 0.40-1.0
232 - updated to 0.40 - no code change.
233
234 * Thu Jun 07 2007 <[email protected]> 0.40-0.2
235 - unset environment variables which are normally tainted in perl.
236 - updated to 0.40rc1
237 - added dependency on Net::IP (needed by some plugins)
238
239 * Sat May 05 2007 <[email protected]> 0.33-0.5
240 - moved environment cleanup into start() function, otherwise
241 LANG just gets reinitialized.
242
243 * Sat May 05 2007 <[email protected]> 0.33-0.4
244 - split qpsmtpd-async into a separate package to avoid dependency
245 on ParaDNS.
246
247 * Sat May 05 2007 <[email protected]> 0.33-0.3
248 - also unset LANG, LC_ALL and LC_TIME in startup script to prevent
249 locale specific Received headers (bug reported by Dominik Meyer)
250
251 * Sun Feb 25 2007 <[email protected]> 0.33-0.2
252 - 0.3x branch has been merged back to trunk.
253 Got current snapshot (r715) from trunk.
254
255 * Sun Feb 25 2007 <[email protected]> 0.33-0.1
256 - Start forkserver via "daemon" (Gavin Carr)
257 - Fixed 'service qpsmtpd-forkserver status' (Gavin Carr)
258 - Changed policy for config files to noreplace (Gavin Carr)
259
260 * Sun Nov 05 2006 <[email protected]> 0.33-0.0
261 - Upgraded to current snapshot from 0.3x branch (which should become
262 0.33 soon-ish)
263 - included xinetd-support again.
264
265 * Sat Mar 18 2006 <[email protected]> 0.32-2
266 - fix dnsbl to check whether answer fits query.
267 - randomize Net::DNS ids for qpsmtpd-forkserver child processes.
268
269 * Wed Mar 08 2006 <[email protected]> 0.32-1
270 - New upstream 0.32
271 - rc-file unsets PERL_UNICODE (bug #38397)
272
273 * Sat Jan 28 2006 <[email protected]> 0.31.1-3
274 - Use ${SOURCE*} macros to refer to source files
275 - Avoid invoking rpm and other cleanup in pre section
276 - Invoke chkconfig in post.
277 - (Thanks to Josko Plazonic for the reporting these problems and
278 suggesting fixes)
279
280 * Tue Nov 30 2005 <[email protected]> 0.31.1-2
281 - Revision 170 of plugins/loggin/file_connection:
282 Return DECLINED from open_log.
283 Open log in write_log if it isn't already open.
284
285 * Tue Nov 29 2005 <[email protected]> 0.31.1-1
286 - Commented out queue plugins from sample config
287 - Added dependencies
288 - Create smtpd user if it doesn't exist
289 - Added /var/log/qpsmtpd and /var/spool/qpsmtpd
290
291 * Sat Nov 26 2005 <[email protected]>
292 - Added file_connection plugin
293 - Startup file for qpsmtpd-forkserver now uses --detach and assumes that
294 a suitable logging module is configured (file_connection by default)
295
296 * Wed Nov 23 2005 <[email protected]>
297 - Forkserver drops privileges before loading plugins now.
298
299 * Sun Nov 20 2005 <[email protected]>
300 - New upstream 0.31.1
301
302 * Mon Nov 14 2005 <[email protected]> 0.31-8
303 - New upstream 0.31rc3.
304 - pre-connection patch slightly simplified since upstream fixed one of
305 the bugs.
306
307 * Tue Aug 23 2005 <[email protected]>
308 - forced INSTALLSITELIB=/usr/lib/perl5/site_perl as suggested by
309 Charlie Brady.
310
311 * Sat Aug 20 2005 <[email protected]> 0.31-7
312 - RC2 from upstream.
313 - Removed patches which aren't applied from spec file.
314
315 * Fri Jul 22 2005 <[email protected]> 0.31-6
316 - New upstream snapshot from 0.31 branch: svn revision 509.
317
318 * Sun Jul 17 2005 <[email protected]> 0.31-5
319 - include only /etc/init.d/qpsmtpd-forkserver, not /etc/init.d
320 it conflicts with old initscripts packages.
321
322 * Sun Jul 17 2005 <[email protected]> 0.31-4
323 - removed tabs from forkserver
324
325 * Sun Jul 17 2005 <[email protected]> 0.31-3
326 - added startup script for forkserver
327 - changed BuildArchitectures to noarch.
328
329 * Sat Jul 16 2005 <[email protected]> 0.31-2
330 - pre-connection hook is now actually called, not just defined.
331
332 * Fri Jul 15 2005 <[email protected]> 0.31-1
333 - merged with 0.31. Most of my patches are now in the official release.
334 - merged Gavin's per-user-config patch with my dirs patch, since the
335 latter needs a way to turn off logging.
336 - added /etc/qpsmtpd/plugin_dir to package.
337
338 * Mon Jun 13 2005 <[email protected]> 0.29-6
339 - fixed removal of patch backup files
340 - fixed option --pid-file
341
342 * Sun Jun 12 2005 <[email protected]>
343 - avoid installing patch backup files
344 - split Apache::Qpsmtpd into separate package to avoid dependency hell.
345 - fixed URL
346 - changed group to Daemons.
347 - Fixed installation for newer versions of ExtUtils::MakeMaker
348
349 * Wed Jun 1 2005 <[email protected]> 0.29-5
350 - Really don't reap children in signal handler.
351
352 * Tue May 31 2005 <[email protected]> 0.29-4
353 - Return 421 for DENYSOFT_DISCONNECT
354 - Don't reap children in signal handler.
355
356 * Thu May 19 2005 <[email protected]> 0.29-3
357 - removed code to accept paths without <>.
358
359 * Thu May 19 2005 <[email protected]> 0.29-2
360 - added QPSMTPD_CONFIG env variable and plugin_dir config.
361 - added supplemental groups and support for pid file
362 - added shared_connect hook
363 - changed log level for SMTP dialog from DEBUG to INFO
364
365 * Thu Apr 21 2005 [email protected]
366 - added plugins, /etc and docs.
367
368 * Mon Apr 18 2005 [email protected]
369 - Specfile autogenerated
370