aboutsummaryrefslogtreecommitdiffstats
path: root/main/rsyslog/APKBUILD
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-01-27 00:24:49 +0100
committerJakub Jirutka <jakub@jirutka.cz>2019-01-28 01:51:37 +0100
commit9861fefced2dde851f37c91102cbd15677d9ffbf (patch)
tree04367a8c2580b19a1d8a4327a35fc047503c3475 /main/rsyslog/APKBUILD
parent40c3650f74f202f2d93a8ef7eea5e5d12528a0a8 (diff)
downloadaports-9861fefced2dde851f37c91102cbd15677d9ffbf.tar.gz
aports-9861fefced2dde851f37c91102cbd15677d9ffbf.tar.bz2
aports-9861fefced2dde851f37c91102cbd15677d9ffbf.tar.xz
main/rsyslog: DRY split functions for plugins
Diffstat (limited to 'main/rsyslog/APKBUILD')
-rw-r--r--main/rsyslog/APKBUILD75
1 files changed, 29 insertions, 46 deletions
diff --git a/main/rsyslog/APKBUILD b/main/rsyslog/APKBUILD
index b590f62091..079adabd0e 100644
--- a/main/rsyslog/APKBUILD
+++ b/main/rsyslog/APKBUILD
@@ -5,7 +5,7 @@
# Maintainer: Cameron Banta <cbanta@gmail.com>
pkgname=rsyslog
pkgver=8.40.0
-pkgrel=1
+pkgrel=2
pkgdesc="Enhanced multi-threaded syslogd with database support and more."
url="https://www.rsyslog.com/"
arch="all"
@@ -28,8 +28,7 @@ makedepends="
util-linux-dev
zlib-dev
"
-subpackages="$pkgname-doc $pkgname-mysql $pkgname-pgsql $pkgname-tls
- $pkgname-snmp $pkgname-hiredis $pkgname-elasticsearch $pkgname-dbg"
+subpackages="$pkgname-doc $pkgname-dbg"
source="https://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
$pkgname.initd
$pkgname.confd
@@ -40,6 +39,18 @@ source="https://www.rsyslog.com/files/download/$pkgname/$pkgname-$pkgver.tar.gz
"
builddir="$srcdir/$pkgname-$pkgver"
+_plugins="
+ elasticsearch:omelasticsearch
+ hiredis:omhiredis
+ mysql:ommysql
+ pgsql:ompgsql
+ snmp:omsnmp
+ tls:lmnsd_gtls
+ "
+for _i in $_plugins; do
+ subpackages="$subpackages $pkgname-${_i%%:*}:_plugin"
+done
+
build() {
cd "$builddir"
@@ -80,52 +91,24 @@ package() {
install -m644 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname.conf
}
-mysql() {
- pkgdesc="rsyslog mysql support"
-
- mkdir -p "$subpkgdir"/usr/lib/rsyslog/
- mv "$pkgdir"/usr/lib/rsyslog/ommysql.so \
- "$subpkgdir"/usr/lib/rsyslog/
-}
-
-hiredis(){
- pkgdesc="rsyslog hiredis support"
-
- mkdir -p "$subpkgdir"/usr/lib/rsyslog/
- mv "$pkgdir"/usr/lib/rsyslog/omhiredis.so \
- "$subpkgdir"/usr/lib/rsyslog/
-}
-
-pgsql() {
- pkgdesc="rsyslog pgsql support"
+_plugin() {
+ local name="${subpkgname#$pkgname-}"
+ pkgdesc="$name support for $pkgname"
+ depends="$pkgname=$pkgver-r$pkgrel"
- mkdir -p "$subpkgdir"/usr/lib/rsyslog/
- mv "$pkgdir"/usr/lib/rsyslog/ompgsql.so \
- "$subpkgdir"/usr/lib/rsyslog/
-}
-
-tls() {
- pkgdesc="rsyslog tls support"
-
- mkdir -p "$subpkgdir"/usr/lib/rsyslog/
- mv "$pkgdir"/usr/lib/rsyslog/lmnsd_gtls.so \
- "$subpkgdir"/usr/lib/rsyslog/
-}
-
-snmp() {
- pkgdesc="rsyslog snmp support"
-
- mkdir -p "$subpkgdir"/usr/lib/rsyslog/
- mv "$pkgdir"/usr/lib/rsyslog/omsnmp.so \
- "$subpkgdir"/usr/lib/rsyslog/
-}
+ local libnames=$(printf '%s\n' $_plugins | grep "^$name:" | cut -d: -f2- | tr : ' ')
+ local libname
-elasticsearch() {
- pkgdesc="rsyslog elasticsearch support"
+ for libname in ${libnames:-$name}; do
+ mkdir -p "$subpkgdir"/usr/lib/rsyslog/
+ mv "$pkgdir"/usr/lib/rsyslog/$libname.so "$subpkgdir"/usr/lib/rsyslog/
+ done
- mkdir -p "$subpkgdir"/usr/lib/rsyslog/
- mv "$pkgdir"/usr/lib/rsyslog/omelasticsearch.so \
- "$subpkgdir"/usr/lib/rsyslog/
+ # Allow people to find plugins by their full name (including prefix;
+ # mm, om, im, ...).
+ for libname in $libnames; do
+ provides="$provides $pkgname-$libname=$pkgver-r$pkgrel"
+ done
}
sha512sums="3d5d4f92e37ad9bf3767d5d7fc87fcb7956656f676a9495c78abd12fe9072ec8763b50543b198308a71d5d919721fb9b84b6725dd83a9d9b8a1639d81382c0dd rsyslog-8.40.0.tar.gz