# Contributor: Pedro Filipe # Maintainer: Natanael Copa pkgname=mosquitto pkgver=1.5.6 pkgrel=1 pkgdesc="An Open Source MQTT v3.1 Broker" url="https://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="openssl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt" checkdepends="python2" subpackages="$pkgname-dev $pkgname-doc $pkgname-libs++:_pp $pkgname-openrc $pkgname-libs $pkgname-clients" source="http://mosquitto.org/files/source/$pkgname-$pkgver.tar.gz config.patch mosquitto.initd CVE-2019-11779.patch " builddir="$srcdir/$pkgname-$pkgver" # secfixes: # 1.5.6-r1: # - CVE-2019-11779 # 1.5.6-r0: # - CVE-2018-12546 # - CVE-2018-12550 # - CVE-2018-12551 # 1.5.3-r0: # - CVE-2018-12543 # 1.4.15-r0: # - CVE-2017-7652 # - CVE-2017-7651 # 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="99bd935f93ae25f0c7992870780cce4748b35ffd58fd0d39e20ee69f34c28d3eac289cf0c7dec078dbdced3bda12da4569d4b5e84ebdaa5514640f331ca3238b mosquitto-1.5.6.tar.gz fb000f9fa1ef94cbf3811a23b5692c0c8f9e2df945959cef6005462715e99d6f75cf6b31bd496271ffc17634024aed986771a73962fef865c0d386f6c194fb33 config.patch 16f96d8f7f3a8b06e2b2e04d42d7e0d89a931b52277fc017e4802f7a3bc85aff4dd290b1a0c40382ea8f5568d0ceb7319c031d9be916f346d805231a002b0433 mosquitto.initd 821bce2d7ed38f146e5065d50c2799b56deaf1511a4634de7033aa7bfe5c0c529f949827b779594e15ee2c3cca2fcb1b7e0ae37c5778e27774925cb92bedc62a CVE-2019-11779.patch"