aboutsummaryrefslogtreecommitdiffstats
path: root/community/modemmanager/APKBUILD
blob: c5103da8754a53e22fb70ca65941d7701b7d02c0 (plain) (blame)
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
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=modemmanager
pkgver=1.10.2
pkgrel=0
pkgdesc="ModemManager library"
url="http://www.freedesktop.org/wiki/Software/ModemManager"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
depends_dev="libmm-glib"
makedepends="$depends_dev gobject-introspection-dev gtk-doc vala
	libgudev-dev polkit-dev libmbim-dev libqmi-dev linux-headers"
checkdepends="glib-dev"
options="!check" # https://bugs.freedesktop.org/show_bug.cgi?id=101197
subpackages="$pkgname-lang $pkgname-doc libmm-glib:libmm $pkgname-dev"
source="https://www.freedesktop.org/software/ModemManager/ModemManager-$pkgver.tar.xz
	$pkgname.rules
	"
builddir="$srcdir"/ModemManager-$pkgver

build() {
	export CFLAGS="$CFLAGS -Wno-error"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-polkit=permissive \
		--enable-gtk-doc \
		--disable-static \
		--enable-more-warnings \
		--with-newest-qmi-commands \
		--with-dbus-sys-dir=/etc/dbus-1 \
		--enable-vala=yes
	make
}

libmm() {
	cd "$builddir"
	mkdir -p "$subpkgdir"
	make DESTDIR="$subpkgdir" -C libmm-glib install
	# move dev files to modemmnager-dev
	mv -f "$subpkgdir/usr/include/libmm-glib" "$pkgdir/usr/include/"
	mv -f "$subpkgdir/usr/share/gir-1.0" "$pkgdir/usr/share/"
	rmdir "$subpkgdir/usr/include" "$subpkgdir/usr/share"
}

package() {
	make DESTDIR="$pkgdir" install
	make DESTDIR="$pkgdir" -C libmm-glib uninstall
	rmdir "$pkgdir"/usr/lib/girepository-1.0 # in libmm-glib
	rm -rf "$pkgdir"/usr/share/dbus-1/system-services #systemd-service
	mkdir -p "$pkgdir/usr/share/polkit-1/rules.d"
	install -m644 -D "$srcdir/$pkgname.rules" \
		"$pkgdir/usr/share/polkit-1/rules.d/01-org.freedesktop.ModemManager.rules"
	# post-install message
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"
	cat > $pkgdir/usr/share/doc/$pkgname/README.alpine <<EOF
If your USB modem shows up as a Flash drive when you plug it in:

install 'usb-modeswitch' to automatically switch to USB modem mode whenever you plug it in.
To control your modem without the root password: add your user account to the 'plugdev' group.
EOF
}

check() {
	make check
}

sha512sums="766e2b84eeb3a2f3fa75eca43d1addf1ed4ad9dc8c3a8009927f93f7ec1ead86a80d566eaaf425219a23824e10d1ec19161a0493c3c7f057c0e695eb1533f42e  ModemManager-1.10.2.tar.xz
3c76ee577334e25c836857f8e7fef6a249cdd9fcd8f889cb64d9c1667bc6a95c087267a153bddd1a13256c59f8cd578ccb448e6b9cb54b73bb74acb8a0ca1e3f  modemmanager.rules"