mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-03-30 19:01:45 +02:00
76 lines
2.2 KiB
Plaintext
76 lines
2.2 KiB
Plaintext
# Contributor: Will Sinatra <wpsinatra@gmail.com>
|
|
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
|
|
pkgname=nmqtt
|
|
pkgver=1.0.7
|
|
pkgrel=0
|
|
pkgdesc="Native Nim MQTT client library and broker"
|
|
url="https://github.com/zevv/nmqtt"
|
|
arch="all !s390x" # missing nim/nimble
|
|
license="MIT"
|
|
makedepends="
|
|
nim
|
|
nimble
|
|
nim-sha2
|
|
nim-bcrypt
|
|
nim-bcrypt-dev
|
|
nim-cligen
|
|
openssl-dev
|
|
bsd-compat-headers"
|
|
install="$pkgname.post-install"
|
|
subpackages="nim-$pkgname:_dev $pkgname-doc $pkgname-openrc"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/zevv/nmqtt/archive/refs/tags/v$pkgver.tar.gz
|
|
nmqtt.initd
|
|
nmqtt.confd"
|
|
options="!check" # requires access to an MQTT broker
|
|
|
|
build() {
|
|
nim c -d:release -d:ssl nmqtt.nim
|
|
|
|
for f in nmqtt_pub nmqtt_sub nmqtt_password; do
|
|
nim c -d:release -d:ssl nmqtt/$f
|
|
done
|
|
}
|
|
|
|
package() {
|
|
# Install binaries
|
|
install -Dm755 nmqtt.out "$pkgdir"/usr/bin/nmqtt
|
|
install -Dm755 nmqtt/nmqtt_password "$pkgdir"/usr/bin/nmqtt_password
|
|
install -Dm755 nmqtt/nmqtt_pub "$pkgdir"/usr/bin/nmqtt_pub
|
|
install -Dm755 nmqtt/nmqtt_sub "$pkgdir"/usr/bin/nmqtt_sub
|
|
|
|
# Install default configuration
|
|
install -Dm644 config/nmqtt.conf "$pkgdir"/etc/nmqtt/nmqtt.conf
|
|
|
|
# Install init script
|
|
install -Dm755 "$srcdir"/nmqtt.initd "$pkgdir"/etc/init.d/nmqtt
|
|
install -Dm644 "$srcdir"/nmqtt.confd "$pkgdir"/etc/conf.d/nmqtt
|
|
|
|
# Create directories for runtime
|
|
install -dm755 "$pkgdir"/var/lib/nmqtt
|
|
install -dm755 "$pkgdir"/var/log/nmqtt
|
|
|
|
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
|
|
}
|
|
|
|
_dev() {
|
|
cd $builddir
|
|
|
|
# Install library files
|
|
local destdir="$subpkgdir/usr/share/nimble/pkgs2/nmqtt-$pkgver"
|
|
mkdir -p "$destdir"
|
|
|
|
# Install all Nim source files
|
|
find . -name "*.nim" -type f -exec install -Dm644 {} "$destdir"/{} \;
|
|
|
|
# Install nimble file
|
|
if [ -f nmqtt.nimble ]; then
|
|
install -Dm644 nmqtt.nimble "$destdir/"
|
|
fi
|
|
}
|
|
|
|
sha512sums="
|
|
e7a3e47292f17a37aae4cab64263b9ffdc3e1e5699d600f4869e35c07ee3154b867c0d514f519f408f48ecc203da27e4656a08763c21b1410b466bd643b4d722 nmqtt-1.0.7.tar.gz
|
|
0519746a3fccfe69399ebfc6f401c4730cf92b3a3708e70e80667f8b25f581898750a7f402d04a32ca87a60e9c956ffd3f197fa8e9d39768f850d3724f801090 nmqtt.initd
|
|
eaa430d6f54e19619a97498b17a8dd76e647fc58a9ec82ca50d31d188ccc71df9d2240fc55f3f7dae4f23bc47cdd8927467f05871269094669e00afbdd1134ba nmqtt.confd
|
|
"
|