summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Lucas2019-10-23 16:35:37 -0400
committerJean Lucas2019-10-23 16:47:07 -0400
commit1eda4fece675e187e42a12c5a10c212aaa128ccc (patch)
treed24a37d911d6902a0debea277da38ff86f40a484
parent6fecf8877b58cba56b39e3fb1f3715dd734be064 (diff)
downloadaur-1eda4fece675e187e42a12c5a10c212aaa128ccc.tar.gz
Overhaul
-rw-r--r--.SRCINFO44
-rw-r--r--PKGBUILD101
-rw-r--r--opensmtpd-git.install20
-rw-r--r--opensmtpd.sysusers3
-rw-r--r--opensmtpd.tmpfiles2
-rw-r--r--smtpd.conf.patch4
-rw-r--r--smtpd.service10
7 files changed, 84 insertions, 100 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7bd947ab217..bb56f5988f0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,31 +1,29 @@
pkgbase = opensmtpd-git
- pkgdesc = A FREE implementation of the server-side SMTP protocol. Latest snapshot.
- pkgver = latest
+ pkgdesc = Security-focused, simple, and performant SMTP server written in C (Git)
+ pkgver = 6.6.0+r2318+g8e53e1bd
pkgrel = 1
- url = http://www.opensmtpd.org/
- install = opensmtpd-git.install
- arch = i686
+ url = https://www.opensmtpd.org
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
+ license = custom
+ makedepends = git
+ depends = libasr
+ depends = zlib
+ provides = smtp-server
+ provides = smtp-forwarder
+ conflicts = smtp-server
+ conflicts = smtp-forwarder
+ backup = etc/smtpd/smtpd.conf
+ backup = etc/smtpd/aliases
+ source = git+https://github.com/OpenSMTPD/OpenSMTPD#branch=portable
+ source = opensmtpd.sysusers
+ source = opensmtpd.tmpfiles
source = smtpd.service
source = smtpd.socket
- source = smtpd.conf.patch
- sha256sums = SKIP
- sha256sums = 655ca04a3b95e7424d625e60304387c5d73eb35997a7878089cae94e1dae5b27
- sha256sums = 32d46de5562d01de445d04c93bcc9f94bf103539b676e449c32e3603a3866cf8
- sha256sums = da42f59718713c70c24d001604cd123fbde1da4314abbe445347207d0d14f5e4
+ sha512sums = SKIP
+ sha512sums = 95df5a97ef20cbdfb5bb702d0d83397b0f8e205bd85cdce57227a9691d289f14a2fa4bbd85b527e3934d2b1216011e2214cf79589afce6fbb73c8b00d74097b3
+ sha512sums = 318e0e9cf860995fd0c81baa8226c75cc7bf3a221ca5ceb46118ce06903ff30bb337b00fa78afb6e18cf1502362233a3dce04b0e98b2af0937ca97ed68b43f1a
+ sha512sums = b3317315d4f378d7b8e10eac0313abac179be3351e1e0c476386384f788065f53f881224810bcf91662906ec0242ca7ffb6a91e6cbc56dddf1483100bca8b819
+ sha512sums = 806025d000ba34e86338bf127951e853849e077fe6941f7d0f43c362303ed191554f1d983d422f1acec22e89091517237a60da6e7ae6db1cb977fffe666e48c4
pkgname = opensmtpd-git
diff --git a/PKGBUILD b/PKGBUILD
index 9767a6ef14d..4a9144ae9b4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,70 +1,75 @@
-# Maintainer: Hugo Osvaldo Barrera <hugo@barrera.io>
+# Maintainer: Jean Lucas <jean@4ray.co>
+# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>
pkgname=opensmtpd-git
-_pkgname=opensmtpd
-_gitname=OpenSMTPD
-pkgver=latest
+_pkgname=OpenSMTPD
+pkgver=6.6.0+r2318+g8e53e1bd
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"
+pkgdesc='Security-focused, simple, and performant SMTP server written in C (Git)'
+arch=(x86_64)
+url=https://www.opensmtpd.org
+license=(custom)
+depends=(libasr zlib)
+makedepends=(git)
+provides=(smtp-server smtp-forwarder)
+conflicts=(smtp-server smtp-forwarder)
+backup=(etc/smtpd/smtpd.conf etc/smtpd/aliases)
+source=(
+ git+https://github.com/OpenSMTPD/OpenSMTPD#branch=portable
+ opensmtpd.sysusers
+ opensmtpd.tmpfiles
+ smtpd.service
+ smtpd.socket
+)
+sha512sums=('SKIP'
+ '95df5a97ef20cbdfb5bb702d0d83397b0f8e205bd85cdce57227a9691d289f14a2fa4bbd85b527e3934d2b1216011e2214cf79589afce6fbb73c8b00d74097b3'
+ '318e0e9cf860995fd0c81baa8226c75cc7bf3a221ca5ceb46118ce06903ff30bb337b00fa78afb6e18cf1502362233a3dce04b0e98b2af0937ca97ed68b43f1a'
+ 'b3317315d4f378d7b8e10eac0313abac179be3351e1e0c476386384f788065f53f881224810bcf91662906ec0242ca7ffb6a91e6cbc56dddf1483100bca8b819'
+ '806025d000ba34e86338bf127951e853849e077fe6941f7d0f43c362303ed191554f1d983d422f1acec22e89091517237a60da6e7ae6db1cb977fffe666e48c4')
pkgver() {
- cd "$srcdir/${_gitname}"
- echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
+ cd $_pkgname
+ git describe --tags | sed 's#-#+#g;s#+#+r#'
}
prepare() {
- cd "$srcdir/${_gitname}"
- ./bootstrap
+ sed 's#etc/mail#etc/smtpd#;s#localhost#lo#' -i $_pkgname/smtpd/smtpd.conf
}
build() {
- cd "$srcdir/${_gitname}"
+ cd $_pkgname
+
+ ./bootstrap
+
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --libexecdir=/usr/lib/smtpd \
+ --sysconfdir=/etc/smtpd \
+ --with-user-smtpd=smtpd \
+ --with-user-queue=smtpq \
+ --with-group-queue=smtpq \
+ --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt
- ./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}"
+ cd $_pkgname
+
+ make DESTDIR="$pkgdir" install
- make DESTDIR="${pkgdir}/" install
+ install -Dm 644 etc/aliases -t "$pkgdir"/etc/smtpd
- install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
+ install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
- 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"
+ for link in sendmail send-mail mailq makemap newaliases; do
+ ln -s smtpctl "$pkgdir"/usr/bin/$link
+ done
- install -Dm 644 /dev/null "$pkgdir/etc/mail/aliases"
+ cd ..
- install -dm 711 "$pkgdir/var/spool/smtpd/"
+ install -Dm 644 opensmtpd.sysusers "$pkgdir"/usr/lib/sysusers.d/opensmtpd.conf
+ install -Dm 644 opensmtpd.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/opensmtpd.conf
+ install -Dm 644 smtpd.{service,socket} -t "$pkgdir"/usr/lib/systemd/system
}
-
diff --git a/opensmtpd-git.install b/opensmtpd-git.install
deleted file mode 100644
index fa48be11860..00000000000
--- a/opensmtpd-git.install
+++ /dev/null
@@ -1,20 +0,0 @@
-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/opensmtpd.sysusers b/opensmtpd.sysusers
new file mode 100644
index 00000000000..7c0058d8095
--- /dev/null
+++ b/opensmtpd.sysusers
@@ -0,0 +1,3 @@
+u smtpd 91 "SMTP Daemon" -
+u smtpq 92 "SMTP Queue" -
+m smtpd root
diff --git a/opensmtpd.tmpfiles b/opensmtpd.tmpfiles
new file mode 100644
index 00000000000..21789c31ff0
--- /dev/null
+++ b/opensmtpd.tmpfiles
@@ -0,0 +1,2 @@
+d /var/spool/smtpd 711 root root - -
+d /var/spool/smtpd/offline 770 root smtpq - -
diff --git a/smtpd.conf.patch b/smtpd.conf.patch
deleted file mode 100644
index 6865ee88064..00000000000
--- a/smtpd.conf.patch
+++ /dev/null
@@ -1,4 +0,0 @@
-5c5
-< listen on localhost
----
-> listen on lo
diff --git a/smtpd.service b/smtpd.service
index 11120c65417..74722db10d5 100644
--- a/smtpd.service
+++ b/smtpd.service
@@ -1,11 +1,11 @@
[Unit]
-Description=A FREE implementation of the server-side SMTP protocol
-After=network.target
-Wants=network.target
+Description=OpenSMTPD
+Requires=network-online.target
+After=network-online.target
[Service]
-ExecStart=/usr/sbin/smtpd -d
-ExecStop=/usr/bin/smtpctl stop
+Type=forking
+ExecStart=/usr/bin/smtpd
[Install]
WantedBy=multi-user.target