aboutsummaryrefslogtreecommitdiffstats
path: root/main/mosquitto/APKBUILD
blob: 994b5d149c3a4921462cb9de6a5031c565cac675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mosquitto
pkgver=1.3.2
pkgrel=0
pkgdesc="An Open Source MQTT v3.1 Broker"
url="http://mosquitto.org/"
arch="all"
license="BSD"
depends=""
depends_dev=""
makedepends="$depends_dev openssl-dev python-dev c-ares-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-dev $pkgname-doc py-$pkgname:_py $pkgname-libs++:_pp
	$pkgname-libs $pkgname-clients"
replaces="mosquitto-utils"
source="http://mosquitto.org/files/source/mosquitto-$pkgver.tar.gz
	mosquitto.initd"

_builddir="$srcdir"/mosquitto-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	sed -i "s|prefix=/usr/local|prefix=/usr|" config.mk
	# dont strip
	sed -i -e "s|(INSTALL) -s|(INSTALL)|g" \
		-e 's|--strip-program=$(STRIP)||' \
		*/Makefile */*/Makefile
}

build() {
	cd "$_builddir"
	make WITH_MEMORY_TRACKING=no prefix=/usr || return 1
}

package() {
	cd "$_builddir"
	make prefix=/usr DESTDIR="$pkgdir" install || return 1
	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() {
	pkgdesc="Python binding to mosquitto"
	replaces=
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

_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/
}

md5sums="5d2fe7c8bf2518eb9829547751c04bbf  mosquitto-1.3.2.tar.gz
8b5822b6c06148183cd33319f68d54bd  mosquitto.initd"
sha256sums="3ae47d812da6c5a4646d292624a0fc00a00f8930fb19c9c11f1c922e548ca713  mosquitto-1.3.2.tar.gz
8a3bdbf100995803e9e595f3893bdd6e285e762b88e5d11f2a2f228a51ca654f  mosquitto.initd"
sha512sums="ff8ed4c74f4d8d6da47d3ba03cd869d9a519fa30404ce015720305e1732ca4501307b62400d984c17046c060851876ac38681aae13de42669e88bae0e52fd68a  mosquitto-1.3.2.tar.gz
d883da1414000a1dc335df1d9f9087c3a9ca594bdb7927f7a7e97866b467077830acb02833c70c6462b86feea24951e069708b5305f07b50bd724dd2f78a196a  mosquitto.initd"