aboutsummaryrefslogtreecommitdiffstats
path: root/community/modemmanager/APKBUILD
blob: 086ff8d740e92bbb7c0cb204ccb8b49813490b18 (plain)
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
72
73
74
75
76
77
78
79
80
81
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=modemmanager
pkgver=1.6.4
pkgrel=3
pkgdesc="ModemManager library"
url="http://www.freedesktop.org/wiki/Software/ModemManager"
arch="all"
license="GPL2, LGPL2.1"
makedepends="$depends_dev gobject-introspection-dev gtk-doc intltool vala
	libgudev-dev polkit-dev libmbim-dev libqmi-dev linux-headers"
subpackages="$pkgname-lang $pkgname-doc libmm-glib:libmm libmm-glib-dev:libmmdev $pkgname-dev"
source="http://www.freedesktop.org/software/ModemManager/ModemManager-$pkgver.tar.xz
	$pkgname.rules
	"
builddir="$srcdir"/ModemManager-$pkgver

build() {
	cd "$builddir"
	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 \
		|| return 1
	# https://bugzilla.gnome.org/show_bug.cgi?id=655517
	sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
	make || return 1
}

libmm() {
	cd "$builddir"
	mkdir -p "$subpkgdir"
	make DESTDIR="$subpkgdir" -C libmm-glib install || return 1
        make DESTDIR="$subpkgdir" -C vapi install || return 1
}

libmmdev() {
	depends="libmm-glib modemmanager-dev"

	mkdir -p "$subpkgdir/usr/lib/pkgconfig"
	mv "${subpkgdir%*-dev}/usr/include" "$subpkgdir/usr/"
	mv "${subpkgdir%*-dev}/usr/share" "$subpkgdir/usr/"
	mv "${subpkgdir%*-dev}/usr/lib/libmm-glib.so" "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/pkgconfig/mm-glib.pc "$subpkgdir"/usr/lib/pkgconfig/
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1
        make DESTDIR="$pkgdir" -C libmm-glib uninstall || return 1
        make DESTDIR="$pkgdir" -C vapi uninstall || return 1
	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" || return 1
	# 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
}

md5sums="06488186c7dd53f8104183b86f7a1568  ModemManager-1.6.4.tar.xz
735e155a785554349906c09dd36d3866  modemmanager.rules"
sha256sums="cdd5b4cb1e4d7643643a28ccbfc4bb354bfa9cb89a77ea160ebdf7926171c668  ModemManager-1.6.4.tar.xz
577807e59b1e95757a4d94922c66f7f36487922c5092a6c148e7db6a4dc6afe8  modemmanager.rules"
sha512sums="6b31ce186adce445cec8964df751b6146a86271e6c14d860740ae66cfe296ac2ac4df21079357775ac5f7a5837c80a7f8db21a2680bc6b45802f9928565f1c73  ModemManager-1.6.4.tar.xz
3c76ee577334e25c836857f8e7fef6a249cdd9fcd8f889cb64d9c1667bc6a95c087267a153bddd1a13256c59f8cd578ccb448e6b9cb54b73bb74acb8a0ca1e3f  modemmanager.rules"