Ask Bjørn Hansen wrote:
Hi everyone,
I'm going to make a release soon, so if you have patches that aren't
merged into my branch yet that you think should be, be sure to speak
up!
I just merged the RPM packaging stuff Peter Holzer and Robin Bowes
made (over the last 5 years; don't say anything is being rushed
around here!) :-)
Attached is a diff that modifies the RPM packaging to produce an SRPM,
and also splits the xinetd files out into a separate RPM.
Regards,
Richard Siddall
commit adc1cb9056837f07963616126091e28570f8233b
Author: Richard Siddall <richard.sidd...@elirion.com>
Date: Sat Feb 13 16:27:13 2010 -0500
Modify RPM packaging to allow an SRPM to be built. Split xinetd files out
into separate RPM
diff --git a/packaging/rpm/Makefile b/packaging/rpm/Makefile
index da8b75a..23756e1 100644
--- a/packaging/rpm/Makefile
+++ b/packaging/rpm/Makefile
@@ -43,6 +43,19 @@ buildrpmdist: buildtargz
--define "_release ${RELEASE}" \
-ta ./build/$(TARBALL).gz
+# -- the "srpmdist" target will build an SRPM out of the SCM, but
+# will use the user's default build settings (which in many
+# cases is exposed as an RPM repository)
+#
+srpmdist: buildsrpmdist
+
+buildsrpmdist: buildtargz
+ @rpmbuild \
+ --define "_package ${PACKAGE}" \
+ --define "_version ${VERSION}" \
+ --define "_release ${RELEASE}" \
+ -ts --nodeps ./build/$(TARBALL).gz
+
# -- the "rpm" target will build out of the SCM, but will leave
# the resulting package in the relative ./build/ directory
#
@@ -59,6 +72,23 @@ buildrpm: buildtargz
--define "_release ${RELEASE}" \
-ta ./build/$(TARBALL).gz
+# -- the "srpm" target will build an SRPM out of the SCM, but
+# will leave the resulting package in the relative ./build/
+# directory
+#
+srpm: buildsrpm $(SCM_TYPE)-clean
+
+buildsrpm: buildtargz
+ @echo ${PACKAGE} ${VERSION} ${RELEASE}
+ @rpmbuild \
+ --define "_rpmdir ./build/" \
+ --define "_sourcedir ./build/" \
+ --define "_srcrpmdir ./build/" \
+ --define "_package ${PACKAGE}" \
+ --define "_version ${VERSION}" \
+ --define "_release ${RELEASE}" \
+ -ts --nodeps ./build/$(TARBALL).gz
+
buildtarball: prepbuildtarball
@tar \
--create \
diff --git a/packaging/rpm/qpsmtpd.spec.in b/packaging/rpm/qpsmtpd.spec.in
index f591ed6..30553f1 100644
--- a/packaging/rpm/qpsmtpd.spec.in
+++ b/packaging/rpm/qpsmtpd.spec.in
@@ -1,3 +1,7 @@
+%{!?_package:%define _package @pack...@}
+%{!?_version:%define _version @vers...@}
+%{!?_release:%define _release @rele...@}
+
Name: %{_package}
Version: %{_version}
Release: %{_release}
@@ -8,6 +12,8 @@ Group: System Environment/Daemons
URL: http://smtpd.develooper.com/
BuildRoot: %{_builddir}/%{name}-%{version}-%{release}-root
BuildRequires: perl >= 0:5.00503
+BuildRequires: perl(Mail::Header)
+BuildRequires: perl(Net::DNS)
BuildArchitectures: noarch
Requires: perl(Mail::Header), perl(Net::DNS) perl(Net::IP) perl(IPC::Shareable)
Requires(pre): coreutils, shadow-utils, perl
@@ -29,6 +35,11 @@ plugins" using the easy to use object oriented plugin API.
qpsmtpd was originally written as a drop-in qmail-smtpd replacement, but
now it also includes a smtp forward and a postfix "backend".
+%package xinetd
+Summary: xinetd support for qpsmtpd
+Group: System Environment/Daemons
+Requires: xinetd
+
%package apache
Requires: perl(mod_perl2)
Summary: mod_perl-2 connection handler for qpsmtpd
@@ -38,6 +49,9 @@ Group: System Environment/Daemons
Summary: qpsmtpd using async I/O in a single process
Group: System Environment/Daemons
+%description xinetd
+This package contains the xinetd startup files for qpsmptd.
+
%description apache
This module implements a mod_perl/apache 2.0 connection handler
@@ -106,6 +120,7 @@ find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \
grep -v [Aa]sync | \
grep -v packaging | \
grep -v README.selinux | \
+ grep -v in.smtp | \
grep -v /Apache | \
grep -v /Danga | \
grep -v Qpsmtpd/ConfigServer.pm | \
@@ -120,11 +135,15 @@ fi
%doc CREDITS Changes LICENSE README README.plugins STATUS
%{_initrddir}/qpsmtpd-forkserver
%config(noreplace) %{_sysconfdir}/qpsmtpd/*
-%config(noreplace) %{_sysconfdir}/xinetd.d/smtp
%config(noreplace) %{_sysconfdir}/sysconfig/qpsmtpd-forkserver
%attr(2750,qpsmtpd,clamav) %dir %{_localstatedir}/spool/qpsmtpd
%attr(0750,smtpd,smtpd) %dir %{_localstatedir}/log/qpsmtpd
+%files xinetd
+%defattr(-,root,root)
+%config(noreplace) %{_sysconfdir}/xinetd.d/smtp
+%{_sbindir}/in.smtp
+
%files apache
%defattr(-,root,root)
%{_prefix}/lib/perl5/site_perl/Apache/Qpsmtpd.pm
@@ -157,6 +176,9 @@ then
fi
%changelog
+* Sat Feb 13 2010 <richard.sidd...@elirion.net>
+- Split out xinetd files into separate RPM
+
* Sun Jul 12 2009 <rpmbu...@robinbowes.com> 0.82-0.1
- Update to latest release
- don't add qpsmtpd to start-up by default