aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-12-13 15:07:05 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-12-13 15:08:56 +0100
commit70546ef05edd925ce6fd82558cce6e62e92c8c8c (patch)
tree89320c099c00c1ff6af79a2f878568d47d090b34
parentb323f68002cda3af2912b17e9582de2818b708a2 (diff)
downloadaports-70546ef05edd925ce6fd82558cce6e62e92c8c8c.tar.gz
aports-70546ef05edd925ce6fd82558cce6e62e92c8c8c.tar.bz2
aports-70546ef05edd925ce6fd82558cce6e62e92c8c8c.tar.xz
main/opensmtpd: add support for PAM in subpackage -pam
Resolves !15216
-rw-r--r--main/opensmtpd/APKBUILD34
-rw-r--r--main/opensmtpd/smtpd.confd8
-rw-r--r--main/opensmtpd/smtpd.initd7
3 files changed, 45 insertions, 4 deletions
diff --git a/main/opensmtpd/APKBUILD b/main/opensmtpd/APKBUILD
index f52879246d..2e8ae18623 100644
--- a/main/opensmtpd/APKBUILD
+++ b/main/opensmtpd/APKBUILD
@@ -15,18 +15,32 @@ arch="all"
license="ISC"
depends="!postfix ca-certificates"
makedepends="automake autoconf libtool mandoc db-dev libasr-dev libevent-dev
- fts-dev zlib-dev openssl-dev bison flex-dev"
+ fts-dev zlib-dev openssl-dev bison flex-dev linux-pam-dev"
install="$pkgname.pre-install"
-subpackages="$pkgname-dbg $pkgname-openrc $pkgname-doc"
+subpackages="$pkgname-dbg $pkgname-pam $pkgname-openrc $pkgname-doc"
source="https://www.opensmtpd.org/archives/opensmtpd-$pkgver.tar.gz
smtpd.initd
+ smtpd.confd
aliases
autoconf-decl-checks.patch
smtpd.conf.patch
"
options="suid !check"
+prepare() {
+ default_prepare
+ cp -ar "$builddir" "$builddir-pam"
+}
+
build() {
+ cd "$builddir"
+ _build
+
+ cd "$builddir-pam"
+ _build --with-auth-pam
+}
+
+_build() {
./configure \
--prefix=/usr \
--sysconfdir=/etc/smtpd \
@@ -42,7 +56,8 @@ build() {
--with-libs="-lfts" \
--with-pie \
--with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \
- --with-mantype=doc
+ --with-mantype=doc \
+ "$@"
make
}
@@ -50,16 +65,27 @@ package() {
make DESTDIR="$pkgdir" -C "$builddir" install
install -Dm755 "$srcdir"/smtpd.initd "$pkgdir"/etc/init.d/smtpd
+ install -Dm644 "$srcdir"/smtpd.confd "$pkgdir"/etc/conf.d/smtpd
install -Dm644 "$srcdir"/aliases "$pkgdir"/etc/smtpd/aliases
# Create compatibility symlinks for mailq, newaliases, makemap and sendmail.
local binary; for binary in mailq newaliases makemap sendmail; do
ln -s /usr/sbin/smtpctl "$pkgdir"/usr/sbin/$binary
done
+
+ install -Dm755 "$builddir-pam"/mk/smtpd/smtpd "$pkgdir"/usr/sbin/smtpd-pam
+}
+
+pam() {
+ pkgdesc="OpenSMTPD with PAM support"
+ depends="$pkgname=$pkgver-r$pkgrel"
+
+ amove usr/sbin/smtpd-pam
}
sha512sums="403952e77b360f42d8dc8ae7cd7faeced831b9e37bffd7c67d338b7208f7471d50f3594c3475a9282d18cb17435efd305ec8c05f89eaeab5d363ddb1c4d54a2e opensmtpd-6.7.1p1.tar.gz
-4972c4fafd5a91766952f5ee738030a1b2663bd8f0ba873945962bb25df584d6af37f7e25d5beedcf2d8cf1d909690fd1bb597555ac127800ef10186ea24eb53 smtpd.initd
+ec3e3a877f77d55a8f676169ff30feb1467b5ac5b0a3bfa960c54ab3848610ccf819e037d2d2a3b2231ec35989cf1dd03f105a7b5188fc828ee653260532fe1b smtpd.initd
+e68fca4a7e0ceda271ad61c5a6592a859789bea9ccb6417258f7a0b45d92163ed6097c208d3fdfb78bf978a6a01b6f3678e047e3ce972b2c521419d54a992e0a smtpd.confd
51d47b34eb3d728daa45f29d6434cc75db28dfa69b6fb3ecd873121df85b296a2d2c81016d765a07778aa26a496e4b29c09a30b82678cf42596a536734b5deca aliases
37104cc605569f142ceffa902f200e8a7e9e1114ebe5394ed1eac0ed6ce25454e1610270921c45246de8396eee04b7c8ab5a112a231036a6ef14e7e229b264e3 autoconf-decl-checks.patch
14ff3d4f56aee3a31551ea535c4a5bf9b760f0f11bc269225d7b176d5031294716133cbf4555a92e76cc6e33de89454435562672ddaf1ab365e61085eb1e4d53 smtpd.conf.patch"
diff --git a/main/opensmtpd/smtpd.confd b/main/opensmtpd/smtpd.confd
new file mode 100644
index 0000000000..6866267a5f
--- /dev/null
+++ b/main/opensmtpd/smtpd.confd
@@ -0,0 +1,8 @@
+# Configuration for /etc/init.d/smtpd
+
+# Use PAM?
+# Note: You have to install package opensmtpd-pam to enable PAM.
+#use_pam=no
+
+# Additional arguments for smtpd.
+#command_args=
diff --git a/main/opensmtpd/smtpd.initd b/main/opensmtpd/smtpd.initd
index b98e4e5b71..ae55a7a73d 100644
--- a/main/opensmtpd/smtpd.initd
+++ b/main/opensmtpd/smtpd.initd
@@ -5,6 +5,8 @@ extra_commands="checkconfig"
description_checkconfig="Check configuration file for errors"
command=/usr/sbin/smtpd
+[ "$use_pam" = yes ] && command=/usr/sbin/smtpd-pam
+
command_args="-F ${command_args:-$SMTPD_OPTS}" # SMTPD_OPTS is deprecated
command_background=yes
@@ -23,6 +25,11 @@ start_pre() {
}
checkconfig() {
+ if [ "$use_pam" = yes ] && [ ! -x "$command" ]; then
+ eerror "\$use_pam=yes, but opensmtpd-pam is not installed"
+ return 1
+ fi
+
ebegin "Checking $name configuration"
# Don't output anything unless something is *not* ok.