aboutsummaryrefslogblamecommitdiffstats
path: root/main/mosquitto/APKBUILD
blob: b4d7e1ac1569e0bf644ded6a60e4976b1f9bfc13 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                   

            





                                         

                                                               
                              
                                                          

                                       

                                                                  












                                                                        
                                                
                                                                   
                                       



                       




                                         




                                                              





                                                                               

 

                                              
                 



                                                                      




                                                                   

 
                                                                 
                                                  
                                                                                                    
                                                                                  
                                                                                                                                                                    
                                                                                                                                                  
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mosquitto
pkgver=1.4.1
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 c-ares-dev util-linux-dev
	libwebsockets-dev"
install="$pkgname.pre-install"
subpackages="$pkgname-dev $pkgname-doc $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=${CROSS_COMPILE}${STRIP}||' \
		*/Makefile */*/Makefile
}

build() {
	cd "$_builddir"
	make \
		WITH_MEMORY_TRACKING=no \
		WITH_WEBSOCKETS=yes \
		WITH_SRV=yes \
		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
}

_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="46008028563eb750c6aa93281ab2e181  mosquitto-1.4.1.tar.gz
8b5822b6c06148183cd33319f68d54bd  mosquitto.initd"
sha256sums="75a8b051c7859a2426ffc15bf45b44f79c8288395a325d791ba54e5df9af58a8  mosquitto-1.4.1.tar.gz
8a3bdbf100995803e9e595f3893bdd6e285e762b88e5d11f2a2f228a51ca654f  mosquitto.initd"
sha512sums="cbb38110eda5ce3248d17a006f4c87db865922e6beaff1dbd4d57e708c367bc64d7ebc35018d076b1069c6b9267897ef7616e2609e999727dc14275347bf40e7  mosquitto-1.4.1.tar.gz
d883da1414000a1dc335df1d9f9087c3a9ca594bdb7927f7a7e97866b467077830acb02833c70c6462b86feea24951e069708b5305f07b50bd724dd2f78a196a  mosquitto.initd"