# Contributor: Dylan Van Assche <me@dylanvanassche.be>
# Maintainer: Dylan Van Assche <me@dylanvanassche.be>
pkgname=eg25-manager
pkgver=0.4.6
pkgrel=4
pkgdesc="Daemon for managing the Quectel EG25 modem"
url="https://gitlab.com/mobian1/devices/eg25-manager"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	curl-dev
	glib-dev
	libgpiod-dev
	libgudev-dev
	libusb-dev
	meson
	modemmanager-dev
	"
source="
	https://gitlab.com/mobian1/devices/eg25-manager/-/archive/$pkgver/eg25-manager-$pkgver.tar.gz
	56.patch
	57.patch
	eg25-manager.confd
	eg25-manager.initd
	"
options="!check"  # no tests
subpackages="$pkgname-openrc"

build() {
	abuild-meson . output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm755 "$srcdir"/eg25-manager.initd "$pkgdir"/etc/init.d/eg25-manager
	install -Dm644 "$srcdir"/eg25-manager.confd "$pkgdir"/etc/conf.d/eg25-manager

	rm -rf "$pkgdir"/usr/lib/systemd
}

sha512sums="
e3b1c6c56bab8c66295c186d7efc3082b3e1fcee5145b2f2f1cdc8c706958ad19aff341f00c03f161f23b1055e38393808590d6e05f5bf93f85cc01cc50fef0b  eg25-manager-0.4.6.tar.gz
b52b70d60f4314b2d13914b2d8c4b4bc48a3ee184a27bd3ff7be8a6eac7b52d422eca274aaf164d54fab125131b16bd2d10c53fa78419382a65733328e0f0e85  56.patch
2f21dbf16e7bbd23d5bf35e6cb64b1f685fce56f7124de9d9a4cbbcfa891687871576043605efe6be21f38bae363f57f12a0b1d2d389958f75814c11caef3707  57.patch
55936830afad2968a214fb39cfe1a9db50421dc2ff4f67d04f08f6bd2b094c3ab46799cfc7743bbc5032682d98d1216203adf5264353a05134bea58524ac070b  eg25-manager.confd
5d1a4783ad7f8889e82fa6bb3ccd646777dfb577e1053b941dc8243b97adc97b3fe76cb4f70523f7c23f6c40cfce1e1ff1d13cab74873fc22ea0ebfb9012de45  eg25-manager.initd
"
