diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-11-20 19:34:22 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-11-20 19:37:25 +0000 |
commit | 84f52cc4144becb947c82bcc6b491364eca13321 (patch) | |
tree | 2f1d1f2dc72d5a34113e9a92e15c5171e30a1c2e | |
parent | be7afbff42941e441138d76b367e898872a2bce2 (diff) | |
download | aports-84f52cc4144becb947c82bcc6b491364eca13321.tar.bz2 aports-84f52cc4144becb947c82bcc6b491364eca13321.tar.xz |
testing/mosquitto: add init.d and pre-install
and fix default logging conf
-rw-r--r-- | testing/mosquitto/APKBUILD | 23 | ||||
-rw-r--r-- | testing/mosquitto/mosquitto.initd | 14 | ||||
-rw-r--r-- | testing/mosquitto/mosquitto.pre-install | 5 |
3 files changed, 35 insertions, 7 deletions
diff --git a/testing/mosquitto/APKBUILD b/testing/mosquitto/APKBUILD index 2487a88c15..e128ceb6c6 100644 --- a/testing/mosquitto/APKBUILD +++ b/testing/mosquitto/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=mosquitto pkgver=1.2.2 -pkgrel=0 +pkgrel=1 pkgdesc="An Open Source MQTT v3.1 Broker" url="http://mosquitto.org/" arch="all" @@ -9,10 +9,11 @@ license="BSD" depends="" depends_dev="" makedepends="$depends_dev openssl-dev python-dev" -install="" +install="$pkgname.pre-install" subpackages="$pkgname-dev $pkgname-doc py-$pkgname:_py $pkgname-libs++:_pp $pkgname-libs $pkgname-utils" -source="http://mosquitto.org/files/source/mosquitto-$pkgver.tar.gz" +source="http://mosquitto.org/files/source/mosquitto-$pkgver.tar.gz + mosquitto.initd" _builddir="$srcdir"/mosquitto-$pkgver prepare() { @@ -38,7 +39,12 @@ build() { package() { cd "$_builddir" make prefix=/usr DESTDIR="$pkgdir" install || return 1 - rm -f "$pkgdir"/usr/lib/*.la + rm -f "$pkgdir"/usr/lib/*.la || return 1 + mv "$pkgdir"/etc/mosquitto/mosquitto.conf.example \ + "$pkgdir"/etc/mosquitto/mosquitto.conf || return 1 + sed -i -e 's/#log_dest stderr/log_dest syslog/' \ + "$pkgdir"/etc/mosquitto/mosquitto.conf || return 1 + install -Dm755 "$srcdir"/mosquitto.initd "$pkgdir"/etc/init.d/mosquitto } _py() { @@ -59,6 +65,9 @@ utils() { mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } -md5sums="fcf329dc409660efb2ebbe980867d476 mosquitto-1.2.2.tar.gz" -sha256sums="45888a10fa619d9d52260df41d61edd25f99d518ce4da0c2a52e66d2d4e63d85 mosquitto-1.2.2.tar.gz" -sha512sums="50f008c98fe88c6a796c6ec52998b5339813f923abca8d610e6319c9b1d8651d2b75937a994da572031be544224618af773cd12f2da756cbfc4d3a1b74730f34 mosquitto-1.2.2.tar.gz" +md5sums="fcf329dc409660efb2ebbe980867d476 mosquitto-1.2.2.tar.gz +8b5822b6c06148183cd33319f68d54bd mosquitto.initd" +sha256sums="45888a10fa619d9d52260df41d61edd25f99d518ce4da0c2a52e66d2d4e63d85 mosquitto-1.2.2.tar.gz +8a3bdbf100995803e9e595f3893bdd6e285e762b88e5d11f2a2f228a51ca654f mosquitto.initd" +sha512sums="50f008c98fe88c6a796c6ec52998b5339813f923abca8d610e6319c9b1d8651d2b75937a994da572031be544224618af773cd12f2da756cbfc4d3a1b74730f34 mosquitto-1.2.2.tar.gz +d883da1414000a1dc335df1d9f9087c3a9ca594bdb7927f7a7e97866b467077830acb02833c70c6462b86feea24951e069708b5305f07b50bd724dd2f78a196a mosquitto.initd" diff --git a/testing/mosquitto/mosquitto.initd b/testing/mosquitto/mosquitto.initd new file mode 100644 index 0000000000..fbea2ae655 --- /dev/null +++ b/testing/mosquitto/mosquitto.initd @@ -0,0 +1,14 @@ +#!/sbin/runscript + +command="/usr/sbin/mosquitto" +command_args="-d $mosquitto_args" +#start_stop_daemon_args="--background --stdout /dev/null --stderr /dev/null" + +config=/etc/mosquitto/${SVCNAME#mosquitto.}.conf + +start_pre() { + if [ -e $config ]; then + pidfile=$(awk '$1 == "pid_file" {print $2}' $config) + command_args="-c $config $command_args" + fi +} diff --git a/testing/mosquitto/mosquitto.pre-install b/testing/mosquitto/mosquitto.pre-install new file mode 100644 index 0000000000..026fe2c1c6 --- /dev/null +++ b/testing/mosquitto/mosquitto.pre-install @@ -0,0 +1,5 @@ +#!/bin/sh + +addgroup -S mosquitto 2>/dev/null +adduser -S -H -h /var/empty -s /sbin/nologin -D -G mosquitto mosquitto 2>/dev/null +exit 0 |