aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2017-04-04 22:49:18 +0000
committerJakub Jirutka <jakub@jirutka.cz>2017-09-30 18:46:07 +0200
commitf9489737a7b7bdb91dd564b2595ba765299b871e (patch)
tree8b091db564a578fc8b84492af7c9e2b2b57ed79d
parent5492d2e3e75aaaf8224e54e55497c51906e5b988 (diff)
downloadaports-f9489737a7b7bdb91dd564b2595ba765299b871e.tar.bz2
aports-f9489737a7b7bdb91dd564b2595ba765299b871e.tar.xz
testing/opensmtpd-extras: new aport
This aport packages the standard OpenSMTPD extras, providing it with various filters, queues, schedulers, and tables. Committer notes: I did few changes and improvements before merging.
-rw-r--r--testing/opensmtpd-extras/APKBUILD83
-rw-r--r--testing/opensmtpd-extras/remove-decls.patch19
2 files changed, 102 insertions, 0 deletions
diff --git a/testing/opensmtpd-extras/APKBUILD b/testing/opensmtpd-extras/APKBUILD
new file mode 100644
index 0000000000..c7f52a331e
--- /dev/null
+++ b/testing/opensmtpd-extras/APKBUILD
@@ -0,0 +1,83 @@
+# Contributor: Shiz <hi@shiz.me>
+# Maintainer: Shiz <hi@shiz.me>
+pkgname=opensmtpd-extras
+pkgver=201703132115
+pkgrel=0
+pkgdesc="OpenSMTPD addons"
+url="https://opensmtpd.org/"
+arch="all"
+license="ISC"
+depends=""
+makedepeds="libressl-dev libevent-dev python2-dev mariadb-dev postgresql-dev
+ hiredis-dev sqlite-dev"
+subpackages="$pkgname-doc"
+source="https://www.opensmtpd.org/archives/$pkgname-$pkgver.tar.gz
+ remove-decls.patch"
+builddir="$srcdir/$pkgname-$pkgver"
+options="!check" # upstream does not provide tests
+
+_extras="
+ filter-monkey
+ filter-stub
+ filter-trace
+ filter-void
+ queue-null
+ queue-python
+ queue-ram
+ queue-stub
+ scheduler-python
+ scheduler-ram
+ scheduler-stub
+ table-ldap
+ table-mysql
+ table-passwd
+ table-postgres
+ table-python
+ table-redis
+ table-socketmap
+ table-sqlite
+ table-stub
+ "
+for _extra in $_extras; do
+ subpackages="$subpackages opensmtpd-$_extra:_package_extra"
+ depends="$depends opensmtpd-$_extra"
+done
+
+build() {
+ cd "$builddir"
+
+ local with_extras
+ local extra; for extra in $_extras; do
+ with_extras="$with_extras --with-$extra"
+ done
+
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc/smtpd \
+ --mandir=/usr/share/man \
+ --libexecdir=/usr/lib \
+ --with-pie \
+ --with-mantype=man \
+ $with_extras
+
+ # the Redis table expects <hiredis.h> without subdirectory, so indulge it
+ make REDIS_CPPFLAGS='-I /usr/include/hiredis'
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install
+}
+
+_package_extra() {
+ local name="${subpkgname#opensmtpd-}"
+ pkgdesc="OpenSMTPD $name addon"
+ depends=""
+
+ mkdir -p "$subpkgdir"/usr/lib/opensmtpd
+ mv "$pkgdir"/usr/lib/opensmtpd/$name "$subpkgdir"/usr/lib/opensmtpd/
+}
+
+sha512sums="d841c63445ca674b368a5aa6012ae90e46b0c31b650067bdcea5badca3d818b1b732be880b2a18421fb39d07291dd413455944b178597bc13ae6ff5c75ac9aed opensmtpd-extras-201703132115.tar.gz
+36efd3b6cf75728cc8b75b3d9d6bf464d1e949ccfbe6151ed53dbba0f9ee1e50eb61afcca05af302ab359bc9ea1136e7750a15e5f5b824899141298d3060782a remove-decls.patch"
diff --git a/testing/opensmtpd-extras/remove-decls.patch b/testing/opensmtpd-extras/remove-decls.patch
new file mode 100644
index 0000000000..5332573e90
--- /dev/null
+++ b/testing/opensmtpd-extras/remove-decls.patch
@@ -0,0 +1,19 @@
+__BEGIN_DECLS / __END_DECLS are a glibc-only wrapper mechanism to make
+C declarations work in C++ code. As musl does not support these and the
+OpenSMTPD codebase is solely C anyway, simply remove them.
+
+--- a/extras/tables/table-ldap/ber.h
++++ b/extras/tables/table-ldap/ber.h
+@@ -75,7 +75,6 @@
+ size_t bo_n;
+ };
+
+-__BEGIN_DECLS
+ struct ber_element *ber_get_element(unsigned long);
+ void ber_set_header(struct ber_element *, int,
+ unsigned long);
+@@ -123,4 +122,3 @@
+ void ber_set_application(struct ber *,
+ unsigned long (*)(struct ber_element *));
+ void ber_free(struct ber *);
+-__END_DECLS