summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Osvaldo Barrera2015-06-09 02:17:20 -0300
committerHugo Osvaldo Barrera2015-06-09 02:17:34 -0300
commit6fecf8877b58cba56b39e3fb1f3715dd734be064 (patch)
treea762be28cf0829ecc193483f4266276238b73119
downloadaur-6fecf8877b58cba56b39e3fb1f3715dd734be064.tar.gz
Initial commit.
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD70
-rw-r--r--opensmtpd-git.install20
-rw-r--r--smtpd.conf.patch4
-rw-r--r--smtpd.service11
-rw-r--r--smtpd.socket8
6 files changed, 144 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..7bd947ab217
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = opensmtpd-git
+ pkgdesc = A FREE implementation of the server-side SMTP protocol. Latest snapshot.
+ pkgver = latest
+ pkgrel = 1
+ url = http://www.opensmtpd.org/
+ install = opensmtpd-git.install
+ arch = i686
+ arch = x86_64
+ license = BSD
+ depends = libevent
+ depends = pam
+ depends = libasr-git
+ provides = opensmtpd
+ conflicts = sendmail
+ conflicts = postfix
+ conflicts = opensmtpd
+ options = emptydirs
+ options = !strip
+ backup = etc/mail/smtpd.conf
+ backup = etc/mail/aliases
+ source = git+https://git@github.com/OpenSMTPD/OpenSMTPD.git#branch=portable
+ source = smtpd.service
+ source = smtpd.socket
+ source = smtpd.conf.patch
+ sha256sums = SKIP
+ sha256sums = 655ca04a3b95e7424d625e60304387c5d73eb35997a7878089cae94e1dae5b27
+ sha256sums = 32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8
+ sha256sums = da42f59718713c70c24d001604cd123fbde1da4314abbe445347207d0d14f5e4
+
+pkgname = opensmtpd-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..9767a6ef14d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,70 @@
+# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io>
+
+pkgname=opensmtpd-git
+_pkgname=opensmtpd
+_gitname=OpenSMTPD
+pkgver=latest
+pkgrel=1
+pkgdesc='A FREE implementation of the server-side SMTP protocol. Latest snapshot.'
+arch=('i686' 'x86_64')
+url="http://www.opensmtpd.org/"
+license=('BSD')
+depends=('libevent' 'pam' 'libasr-git')
+conflicts=('sendmail' 'postfix' 'opensmtpd')
+provides=('opensmtpd')
+options=(emptydirs !strip)
+backup=("etc/mail/smtpd.conf" "etc/mail/aliases")
+source=("git+https://git@github.com/OpenSMTPD/OpenSMTPD.git#branch=portable"
+ "smtpd.service"
+ "smtpd.socket"
+ "smtpd.conf.patch")
+sha256sums=('SKIP'
+ '655ca04a3b95e7424d625e60304387c5d73eb35997a7878089cae94e1dae5b27'
+ '32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8'
+ 'da42f59718713c70c24d001604cd123fbde1da4314abbe445347207d0d14f5e4')
+install="${pkgname}.install"
+
+pkgver() {
+ cd "$srcdir/${_gitname}"
+ echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
+}
+
+prepare() {
+ cd "$srcdir/${_gitname}"
+ ./bootstrap
+}
+
+build() {
+ cd "$srcdir/${_gitname}"
+
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc/mail \
+ --sbindir=/usr/bin \
+ --libexecdir=/usr/lib/smtpd \
+ --with-sock-dir=/run \
+ --with-privsep-path=/var/empty \
+ --with-privsep-user=_smtpd \
+ --with-queue-user=_smtpq \
+ --with-filter-user=_smtpf \
+ --with-pam \
+ --with-ca-file=/etc/ssl/certs/ca-certificates.crt
+ make
+ patch smtpd/smtpd.conf < ../smtpd.conf.patch
+}
+
+package() {
+ cd "$srcdir/${_gitname}"
+
+ make DESTDIR="${pkgdir}/" install
+
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
+
+ install -Dm 644 "$srcdir/smtpd.service" "${pkgdir}/usr/lib/systemd/system/smtpd.service"
+ install -Dm 644 "$srcdir/smtpd.socket" "${pkgdir}/usr/lib/systemd/system/smtpd.socket"
+
+ install -Dm 644 /dev/null "$pkgdir/etc/mail/aliases"
+
+ install -dm 711 "$pkgdir/var/spool/smtpd/"
+}
+
diff --git a/opensmtpd-git.install b/opensmtpd-git.install
new file mode 100644
index 00000000000..fa48be11860
--- /dev/null
+++ b/opensmtpd-git.install
@@ -0,0 +1,20 @@
+post_install() {
+ if [ $(getent group _smtpd > /dev/null) ]; then
+ groupadd -r _smtpd
+ fi;
+ if [ $(getent passwd _smtpd > /dev/null) ]; then
+ useradd -c "SMTPD Daemon" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpd
+ fi;
+ if [ $(getent passwd _smtpq > /dev/null) ]; then
+ useradd "SMTPD queue user" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpq
+ fi;
+ if [ $(getent passwd _smtpf > /dev/null) ]; then
+ useradd "SMTPD filter user" -r -g _smtpd -d /var/empty -s /sbin/nologin _smtpq
+ fi;
+
+ chown -R _smtpd:_smtpd /etc/mail
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/smtpd.conf.patch b/smtpd.conf.patch
new file mode 100644
index 00000000000..6865ee88064
--- /dev/null
+++ b/smtpd.conf.patch
@@ -0,0 +1,4 @@
+5c5
+< listen on localhost
+---
+> listen on lo
diff --git a/smtpd.service b/smtpd.service
new file mode 100644
index 00000000000..11120c65417
--- /dev/null
+++ b/smtpd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=A FREE implementation of the server-side SMTP protocol
+After=network.target
+Wants=network.target
+
+[Service]
+ExecStart=/usr/sbin/smtpd -d
+ExecStop=/usr/bin/smtpctl stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/smtpd.socket b/smtpd.socket
new file mode 100644
index 00000000000..5d1d105cb57
--- /dev/null
+++ b/smtpd.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=OpenSMTPD Socket
+
+[Socket]
+ListenStream=/run/smtpd.sock
+
+[Install]
+WantedBy=sockets.target