# Maintainer: Natanael Copa pkgname=mosquitto pkgver=1.4.14 pkgrel=4 pkgdesc="An Open Source MQTT v3.1 Broker" url="http://mosquitto.org/" arch="all" license="BSD" replaces="mosquitto-utils" install="$pkgname.pre-install" # "abuild -r" then test/mosq_test.py can't start subprocess "$srcdir/src/mosquitto" # "abuild check" will run subprocess and execute the tests without any issues. options="!check" makedepends="libressl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt" checkdepends="python2" subpackages="$pkgname-dev $pkgname-doc $pkgname-libs++:_pp $pkgname-libs $pkgname-clients" source="http://mosquitto.org/files/source/$pkgname-$pkgver.tar.gz test_broker_makefile.patch libressl.patch config.patch mosquitto.initd" builddir="$srcdir/$pkgname-$pkgver" # secfixes: # 1.4.13-r0: # - CVE-2017-9868 # 1.4.12-r0: # - CVE-2017-7650 prepare() { default_prepare # dont strip sed -i -e "s|(INSTALL) -s|(INSTALL)|g" \ -e 's|--strip-program=${CROSS_COMPILE}${STRIP}||' \ */Makefile */*/Makefile } build() { cd "$builddir" # PSK not supported by libressl make \ WITH_MEMORY_TRACKING=no \ WITH_WEBSOCKETS=yes \ WITH_SRV=yes \ WITH_TLS_PSK=no \ WITH_ADNS=no \ prefix=/usr } check() { cd "$builddir" make test } package() { cd "$builddir" make prefix=/usr DESTDIR="$pkgdir" install mv "$pkgdir"/etc/mosquitto/mosquitto.conf.example \ "$pkgdir"/etc/mosquitto/mosquitto.conf sed -i -e 's/#log_dest stderr/log_dest syslog/' \ "$pkgdir"/etc/mosquitto/mosquitto.conf install -Dm755 "$srcdir"/mosquitto.initd "$pkgdir"/etc/init.d/mosquitto } _pp() { pkgdesc="C++ wrapper for libmosquitto" replaces= mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libmosquittopp.so.* "$subpkgdir"/usr/lib/ } clients() { pkgdesc="Mosquitto command line MQTT clients" replaces="mosquitto-utils" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/mosquitto_[ps]ub "$subpkgdir"/usr/bin/ } sha512sums="dc75a971354f87deeb79f32435acfae9bc561a1a24a75ee4940a35176ff91758071930d2105d8dee2a090e07527dbfaa5692bece67e03cc87e8b4b8b46f846c2 mosquitto-1.4.14.tar.gz b4c5c4d513c58b24aa5dec11fc3c644d18cc447eed099de77ea518ce1a70f84854b03f242d756462e46067872a89f0c2c49728ff2424a31dc9cac93c5c1e332b test_broker_makefile.patch 53859b628f965b77f6e47910c0ceba2f2737b815131ed800dc64a80419e434d25b5ba0938ae645882e9aa5d475d4940c7d35cc6d56f54bc4937a66b32d7db4ad libressl.patch d5442373ae6ae8bc83eee59b425fbd76e80f905b9fd2bd2ed2a37a7e156fe95a9cf477c9c4dac0975c5fd90e70884de6fb8a16aefcd37b239199d5deae50b7d2 config.patch 16f96d8f7f3a8b06e2b2e04d42d7e0d89a931b52277fc017e4802f7a3bc85aff4dd290b1a0c40382ea8f5568d0ceb7319c031d9be916f346d805231a002b0433 mosquitto.initd"