# Forked from Alpine for qmi voicecall support & smdpkt patches
pkgname=ofono
pkgver=9999
_pkgver=1.30
pkgrel=1
pkgdesc="Infrastructure for building mobile telephony (GSM/UMTS) applications [$_pkgver]"
url="https://01.org/ofono"
arch="all"
license="GPL-2.0-only"
depends="bluez mobile-broadband-provider-info"
makedepends="glib-dev dbus-dev eudev-dev
	linux-headers bsd-compat-headers libexecinfo-dev
	autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc"
source="https://www.kernel.org/pub/linux/network/$pkgname/$pkgname-$_pkgver.tar.xz
	fix-explicit-bzero.patch
	fix-TEMP_FAILURE_RETRY.patch
	skip-broken-test.patch
	support-smdpkt.patch
	0001-common-create-GList-helper-ofono_call_compare.patch
	0002-common-atmodem-move-at_util_call_compare_by_status-t.patch
	0003-common-atmodem-move-at_util_call_compare_by_id-to-dr.patch
	0004-add-call-list-helper-to-manage-voice-call-lists.patch
	0005-qmimodem-implement-voice-calls.patch
	$pkgname.initd
	udev.rules"
builddir="$srcdir/$pkgname-$_pkgver"

build() {
	autoreconf -fi

	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--sbindir=/usr/sbin
	make
}

check() {
	make -j1 check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 "$srcdir/$pkgname-${_pkgver}/plugins/ofono.rules" "$pkgdir/usr/lib/udev/rules.d/60-ofono.rules"
	install -Dm644 "$srcdir/udev.rules" "$pkgdir/usr/lib/udev/rules.d/60-ofono-pmos.rules"
	install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
}

sha512sums="e65c5af7f09eef31c1e8c2b8202315b1bfeeb18e6e3cca07e3758ee693e51f8d8007211cba9e0da17656b063f362858a51234908c89a2bfd1ef0e057d538bda5  ofono-1.30.tar.xz
7367464a8983969c9a78c1e4f8759a17eb47f6c61c94b088d749c83bb7ef5d19e037cadedd7ef5d34a0fdfe837fa8059e963f4fb2b14148e4a80f00e7cb29286  fix-explicit-bzero.patch
687a2fd592add40122b789073ab9970d6e966752fdecc4077afe1c1bba705fe541dd0e457094f1d9cde747c571b7810b5b1a30835a3f1869bcd810751d5bf76f  fix-TEMP_FAILURE_RETRY.patch
777ab2e13eebd1ccbe12a304310a83b262a5d934207c6a8d410e75aff380838eed1a52f3c2fe0d80c1e7db7faa9b55bf17e78a1e1acd8cfb95a3c6aef49c5b67  skip-broken-test.patch
32e02e64cde806823b27c18380b88656a0fa95aefc35052256e368f13979d093fae5d7bbd6d1bb9ba8294912caea6e017715550872cabd85203a831658be4210  support-smdpkt.patch
9af0061034f16ef4f9968ab05e2bdaa1e135f8b513eb5517654d8f924bd890a9e54f49e6ec4e7824a4001050bf6803f9fbf2ca815b36b1e1ea2889063a361296  0001-common-create-GList-helper-ofono_call_compare.patch
aa3410eef1d6fe65dc9f6f68360031d02d3b32b7c363e13960813d2f0f16aee4e604e27f3d46bca569f6e17c82a74037812c25612a07ce1257b2d00e144f6d2f  0002-common-atmodem-move-at_util_call_compare_by_status-t.patch
f906281888f06ec154ab9ca266d3641d32c6e295568aadbed7fb0cea42584c6aea4ea71d37530893bf184773772e6cd8b32559a6f4bc960dc5fadff23d747a56  0003-common-atmodem-move-at_util_call_compare_by_id-to-dr.patch
6d7b350fed2b4be3b597fad19168448547e3730abfe8d398fc909cd43c1dfce2eabd6efec0bcb0aadb9cca7b8500e6a86b3d1455d9c6ade1a1deacd769e01c7a  0004-add-call-list-helper-to-manage-voice-call-lists.patch
f5ab8f47e21545de71c866e3a7c589ba0f7d5c29f688df3fec06f01093bea72388f5e640a688b25288e58a107e85e5dd5c2c2616f57003ab148f28c2111fc88f  0005-qmimodem-implement-voice-calls.patch
a625f71a2b6fdcd7ac43cca64d2a532f5e5a0192b022fcf9157fad51801dc3b71c5d317a62f3f233136a6ed2bbf92e6f1c2fad2c6aa762b9719ceca02de025d1  ofono.initd
8f2893dfc291fc210ef217c4bc74d79436a0997001dd2773809625d52dd19d092cc75d3f9aa5ed2f3d4a6248d4a4e17013a7655323f7dad951f744c55b572417  udev.rules"
