diff --git a/srcpkgs/opensmtpd/files/opensmtpd/log/run b/srcpkgs/opensmtpd/files/opensmtpd/log/run
new file mode 100755
index 00000000000..afb131ea1b7
--- /dev/null
+++ b/srcpkgs/opensmtpd/files/opensmtpd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p mail.notice
diff --git a/srcpkgs/opensmtpd/files/opensmtpd/run b/srcpkgs/opensmtpd/files/opensmtpd/run
new file mode 100755
index 00000000000..ec33a948bbe
--- /dev/null
+++ b/srcpkgs/opensmtpd/files/opensmtpd/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec smtpd -d 2>&1
diff --git a/srcpkgs/opensmtpd/template b/srcpkgs/opensmtpd/template
index 20a93ee47aa..85269cc6a42 100644
--- a/srcpkgs/opensmtpd/template
+++ b/srcpkgs/opensmtpd/template
@@ -1,7 +1,7 @@
 # Template file for 'opensmtpd'
 pkgname=opensmtpd
 version=5.4.2p1
-revision=5
+revision=6
 build_style=gnu-configure
 configure_args="--sysconfdir=/etc/smtpd --sbindir=/usr/bin
  --with-maildir=/var/spool/mail --with-privsep-path=/var/db
@@ -13,10 +13,11 @@ makedepends="zlib-devel libressl-devel libevent-devel db-devel"
 depends="ca-certificates"
 conf_files="/etc/smtpd/smtpd.conf /etc/smtpd/aliases"
 system_accounts="smtpd smtpq"
-systemd_services="smtpd.socket on"
+smtpd_homedir="/var/spool/mail"
 smtpq_homedir="/var/spool/mail"
+build_options="systemd"
 provides="smtp-forwarder-0_1 smtp-server-0_1"
-replaces="smtp-forwarder>=0 smtp-server>=0"
+replaces="runit-void<20141013_2 smtp-forwarder>=0 smtp-server>=0"
 short_desc="Free implementation of the server-side SMTP protocol"
 maintainer="Juan RP <xtraeme@gmail.com>"
 license="BSD, ISC, MIT"
@@ -34,13 +35,16 @@ pre_configure() {
 	sed -e 's,^\(libevent_major_version\)=.*$,\1=2,' -i configure
 	sed -ri 's,/etc/mail,/etc/smtpd,g' smtpd/smtpd.conf
 }
-
 post_install() {
-	vinstall LICENSE 644 usr/share/licenses/${pkgname}
-	vinstall ${FILESDIR}/smtpd.service 644 usr/lib/systemd/system
-	vinstall ${FILESDIR}/smtpd.socket 644 usr/lib/systemd/system
+	vsv opensmtpd
+	vlicense LICENSE
 	vinstall /dev/null 644 etc/smtpd aliases
 
 	vmkdir usr/sbin
 	ln -s /usr/bin/sendmail ${DESTDIR}/usr/sbin/sendmail
+
+	if [ "$build_option_systemd" ]; then
+		vinstall ${FILESDIR}/smtpd.service 644 usr/lib/systemd/system
+		vinstall ${FILESDIR}/smtpd.socket 644 usr/lib/systemd/system
+	fi
 }