[packages/opensmtpd] new, version 5.3.3p1 201310231634 pre-release

glen glen at pld-linux.org
Sat Nov 2 23:05:44 CET 2013


commit 74cd662a665e62b8e749f563823ed313953819d5
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Nov 3 00:02:55 2013 +0200

    new, version 5.3.3p1 201310231634 pre-release
    
    based on package from fedora codereview
    https://bugzilla.redhat.com/show_bug.cgi?id=1021719

 opensmtpd.init    |  98 +++++++++++++++++++++++++++++++++++
 opensmtpd.pam     |   5 ++
 opensmtpd.service |  11 ++++
 opensmtpd.spec    | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 263 insertions(+)
---
diff --git a/opensmtpd.spec b/opensmtpd.spec
new file mode 100644
index 0000000..42b5ecf
--- /dev/null
+++ b/opensmtpd.spec
@@ -0,0 +1,149 @@
+# TODO
+# - allocate uid/gid
+# - should mailq and newalises be in bindir?
+
+# Conditional build:
+%bcond_without	pam		# build without PAM support
+
+%define	rel	0.1
+%define	prerelease	201310231634
+Summary:	Free implementation of the server-side SMTP protocol as defined by RFC 5321
+Name:		opensmtpd
+Version:	5.3.3p1
+Release:	0.%{prerelease}.%{rel}
+License:	ISC
+Group:		Daemons
+#Source0:	http://www.opensmtpd.org/archives/%{name}-%{version}.tar.gz
+Source0:	http://www.opensmtpd.org/archives/%{name}-%{prerelease}p1.tar.gz
+# Source0-md5:	d4c28a45527356fbec19853220e3688d
+Source1:	%{name}.service
+Source2:	%{name}.init
+Source3:	%{name}.pam
+URL:		http://www.opensmtpd.org/
+BuildRequires:	automake
+BuildRequires:	bison
+BuildRequires:	db-devel
+BuildRequires:	libevent-devel
+BuildRequires:	libtool
+BuildRequires:	openssl-devel
+%{?with_pam:BuildRequires:	pam-devel}
+BuildRequires:	rpmbuild(macros) >= 1.228
+Requires(post,preun):	/sbin/chkconfig
+Requires:	rc-scripts
+Provides:	smtpdaemon
+Obsoletes:	smtpdaemon
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
+defined by RFC 5321, with some additional standard extensions. It
+allows ordinary machines to exchange e-mails with other systems
+speaking the SMTP protocol.
+
+Started out of dissatisfaction with other implementations, OpenSMTPD
+nowadays is a fairly complete SMTP implementation. OpenSMTPD is
+primarily developed by Gilles Chehade, Eric Faurot and Charles
+Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is
+part of the OpenBSD Project. The software is freely usable and
+re-usable by everyone under an ISC license.
+
+%prep
+%setup -q %{?prerelease: -n %{name}-%{prerelease}p1}
+
+%build
+# db4 paths
+CFLAGS="$CFLAGS -I%{_includedir}/libdb4"
+LDFLAGS="$LDFLAGS -L%{_libdir}/libdb4"
+
+%configure \
+	--sysconfdir=%{_sysconfdir}/mail \
+	--libexecdir=%{_libdir}/%{name} \
+	--with-mantype=man \
+	%{?with_pam:--with-pam} \
+	--with-privsep-user=smtpd \
+	--with-queue-user=smtpq \
+	--with-privsep-path=/usr/share/empty \
+	--with-sock-dir=%{_localstatedir}/run
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,pam.d}}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/opensmtpd.service
+install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensmtpd
+%if %{with pam}
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
+%endif
+
+# /usr/sbin/sendmail compatibility is not required /usr/lib/sendmail is
+install -d $RPM_BUILD_ROOT%{_prefix}/lib
+mv $RPM_BUILD_ROOT{%{_bindir},%{_prefix}/lib}/sendmail
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%pre
+%if 0
+%groupadd -r smtpd
+%groupadd -r smtpq
+%useradd -r -g smtpd -s /sbin/nologin -c "OpenSMTPd privsep user" -d /usr/share/empty smtpd
+%useradd -r -g smtpq -s /sbin/nologin -c "OpenSMTPd queue user" -d /usr/share/empty smtpq
+%endif
+
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart
+%systemd_post %{name}.service
+
+%preun
+if [ $1 = 0 ]; then
+	%service %{name} stop
+	/sbin/chkconfig --del %{name}
+fi
+%systemd_preun %{name}.service
+
+%postun
+%systemd_reload
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md THANKS
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/smtpd.conf
+%if %{with pam}
+%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
+%endif
+%attr(754,root,root) /etc/rc.d/init.d/opensmtpd
+%{systemdunitdir}/%{name}.service
+%attr(755,root,root) %{_sbindir}/mailq
+%attr(755,root,root) %{_sbindir}/makemap
+%attr(755,root,root) %{_sbindir}/newaliases
+%attr(755,root,root) %{_sbindir}/smtpctl
+%attr(755,root,root) %{_sbindir}/smtpd
+%attr(755,root,root) %{_prefix}/lib/sendmail
+%{_mandir}/man5/aliases.5*
+%{_mandir}/man5/forward.5*
+%{_mandir}/man5/smtpd.conf.5*
+%{_mandir}/man5/table.5*
+%{_mandir}/man8/makemap.8*
+%{_mandir}/man8/newaliases.8*
+%{_mandir}/man8/sendmail.8*
+%{_mandir}/man8/smtpctl.8*
+%{_mandir}/man8/smtpd.8*
+%dir %{_libdir}/%{name}
+%dir %{_libdir}/%{name}/smtpd
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-queue-null
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-queue-ram
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-queue-stub
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-scheduler-ram
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-scheduler-stub
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-dnsbl
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-monkey
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-stub
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-trace
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/mail.local
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/table-passwd
+%attr(755,root,root) %{_libdir}/%{name}/smtpd/table-stub
diff --git a/opensmtpd.init b/opensmtpd.init
new file mode 100755
index 0000000..9df6e0a
--- /dev/null
+++ b/opensmtpd.init
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# opensmtpd  This shell script takes care of starting and stopping
+#            OpenSMTPD on RedHat or other chkconfig-based system.
+#
+# chkconfig: 2345 80 30
+# processname: smtpd
+# config: /etc/mail/smtpd.conf
+# pidfile: /var/run/smtpd.pid
+# description: OpenSMTPD is a Mail Transport Agent, which is the program \
+#              that moves mail from one machine to another.
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down "OpenSMTPd"
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/smtpd ] && . /etc/sysconfig/smtpd
+
+pidfile="/var/run/smtpd.pid"
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/smtpd ]; then
+		msg_already_running "OpenSMTPd"
+		return
+	fi
+
+	msg_starting "OpenSMTPd"
+	daemon /usr/sbin/smtpd
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/smtpd
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/smtpd ]; then
+		msg_not_running "OpenSMTPd"
+		return
+	fi
+
+	# Stop daemons.
+	msg_stopping "OpenSMTPd"
+	killproc --pidfile $pidfile smtpd -TERM
+	rm -f /var/lock/subsys/smtpd
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/smtpd ]; then
+		msg_not_running "OpenSMTPd"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	status smtpd
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
diff --git a/opensmtpd.pam b/opensmtpd.pam
new file mode 100644
index 0000000..cc3e3f4
--- /dev/null
+++ b/opensmtpd.pam
@@ -0,0 +1,5 @@
+#%PAM-1.0
+auth		required	pam_listfile.so item=user sense=deny file=/etc/security/blacklist.smtp onerr=succeed
+auth		include		system-auth
+account		required	pam_nologin.so
+account		include		system-auth
diff --git a/opensmtpd.service b/opensmtpd.service
new file mode 100644
index 0000000..d90b65a
--- /dev/null
+++ b/opensmtpd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenSMTPD mail daemon
+After=syslog.target network.target
+Conflicts=sendmail.service postfix.service exim.service
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/smtpd
+
+[Install]
+WantedBy=multi-user.target
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/opensmtpd.git/commitdiff/74cd662a665e62b8e749f563823ed313953819d5



More information about the pld-cvs-commit mailing list