Mail archive
alpine-aports

[alpine-aports] [PATCH 6/6] testing/modemmanager: new aport

From: Stuart Cardall <developer_at_it-offshore.co.uk>
Date: Thu, 23 Apr 2015 17:13:37 +0000

ModemManager is a DBus-activated daemon which controls mobile broadband (2G/3G/4G)
devices and connections. Whether built-in devices, USB dongles, bluetooth-paired
telephones, or professional RS232/USB devices with external power supplies,
ModemManager is able to prepare and configure the modems and setup connections
with them.
http://www.freedesktop.org/wiki/Software/ModemManager/
---
 testing/modemmanager/APKBUILD                  | 86 ++++++++++++++++++++++++++
 testing/modemmanager/modemmanager.post-install | 16 +++++
 testing/modemmanager/modemmanager.rules        |  8 +++
 testing/modemmanager/no-XCASE.patch            | 35 +++++++++++
 4 files changed, 145 insertions(+)
 create mode 100644 testing/modemmanager/APKBUILD
 create mode 100644 testing/modemmanager/modemmanager.post-install
 create mode 100644 testing/modemmanager/modemmanager.rules
 create mode 100644 testing/modemmanager/no-XCASE.patch
diff --git a/testing/modemmanager/APKBUILD b/testing/modemmanager/APKBUILD
new file mode 100644
index 0000000..30c3440
--- /dev/null
+++ b/testing/modemmanager/APKBUILD
_at_@ -0,0 +1,86 @@
+# Contributor: Stuart Cardall <developer_at_it-offshore.co.uk>
+# Maintainer: Stuart Cardall <developer_at_it-offshore.co.uk>
+pkgname=modemmanager
+pkgver=1.4.6
+pkgrel=0
+pkgdesc="ModemManager library"
+url="http://www.freedesktop.org/wiki/Software/ModemManager"
+arch="all"
+license="GPL2, LGPL2.1"
+depends_dev=""
+makedepends="$depends_dev gobject-introspection-dev gtk-doc intltool vala udev-dev polkit-dev
+		libmbim-dev libqmi-dev linux-headers"
+install="$pkgname.post-install"
+subpackages="$pkgname-dev $pkgname-lang $pkgname-doc libmm-glib:libmm libmm-glib-dev:libmmdev"
+source="http://www.freedesktop.org/software/ModemManager/ModemManager-$pkgver.tar.xz
+	no-XCASE.patch
+	$pkgname.rules
+	"
+
+_builddir="$srcdir"/ModemManager-$pkgver
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	./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() {
+	mkdir -p "$subpkgdir/usr/lib/pkgconfig"
+	mv "${subpkgdir%*-dev}/usr/include" "$subpkgdir/usr/"
+	mv "${subpkgdir%*-dev}/usr/share" "$subpkgdir/usr/"
+	mv "$pkgdir-dev"/usr/lib/pkgconfig/mm-glib.pc "$subpkgdir"/usr/lib/pkgconfig/
+	rmdir "$pkgdir-dev"/usr/include/libmm-glib # in libmm-glib-dev
+}
+
+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
+}
+
+md5sums="158a5b5206d933121a993fd603a36b2a  ModemManager-1.4.6.tar.xz
+63288189ea454e9712dc26d76d75277d  no-XCASE.patch
+735e155a785554349906c09dd36d3866  modemmanager.rules"
+sha256sums="0cedabf46310f8c56630b116944f54ee64369c76c2f35f5f460ca19a8bb5a5cd  ModemManager-1.4.6.tar.xz
+5e5b87b580faf14e4c56ccc7f9f189522742a64ab365b26751dcc86e68dedb87  no-XCASE.patch
+577807e59b1e95757a4d94922c66f7f36487922c5092a6c148e7db6a4dc6afe8  modemmanager.rules"
+sha512sums="fb74961df2e3e1604de58838da6e8dd7cf80fee97dbfd71eb7f2df60cc319bf38df8c5706a5933856c500b014d3156066e608bb0820c967ddbd964bd9fc2fdec  ModemManager-1.4.6.tar.xz
+5c537e4a86212339d0c41ae3e1055513051a0d6e51bdf2547a38054fbe802feeac2ff46c863ab69423a6693ac33ebacec7a771d4b270aeb5fe6e6bb601361f23  no-XCASE.patch
+3c76ee577334e25c836857f8e7fef6a249cdd9fcd8f889cb64d9c1667bc6a95c087267a153bddd1a13256c59f8cd578ccb448e6b9cb54b73bb74acb8a0ca1e3f  modemmanager.rules"
diff --git a/testing/modemmanager/modemmanager.post-install b/testing/modemmanager/modemmanager.post-install
new file mode 100644
index 0000000..05eb1f2
--- /dev/null
+++ b/testing/modemmanager/modemmanager.post-install
_at_@ -0,0 +1,16 @@
+#!/bin/sh
+
+NORMAL="\033[1;0m"
+STRONG="\033[1;1m"
+GREEN="\033[1;32m"
+
+print_strong() {
+        local prompt="${STRONG}$1 ${GREEN}$2${NORMAL}"
+        printf "${prompt} %s\n"
+}
+
+print_strong "\nIf your USB modem shows up as a Flash drive" "when you plug it in:"
+print_strong "install 'usb-modeswitch'" "to automatically switch to USB modem mode whenever you plug it in."
+print_strong "\nTo control your modem without the root password:" " add your user account to the 'plugdev' group.\n"
+exit 0
+
diff --git a/testing/modemmanager/modemmanager.rules b/testing/modemmanager/modemmanager.rules
new file mode 100644
index 0000000..09e586e
--- /dev/null
+++ b/testing/modemmanager/modemmanager.rules
_at_@ -0,0 +1,8 @@
+// Let users in plugdev group modify ModemManager
+polkit.addRule(function(action, subject) {
+    if (/^org\.freedesktop\.ModemManager1\.(Device\.Control|Contacts|Messaging|Location)$/.test(action.id) &&
+        subject.isInGroup("plugdev") && subject.active) {
+        return "yes";
+    }
+});
+
diff --git a/testing/modemmanager/no-XCASE.patch b/testing/modemmanager/no-XCASE.patch
new file mode 100644
index 0000000..1de41f7
--- /dev/null
+++ b/testing/modemmanager/no-XCASE.patch
_at_@ -0,0 +1,35 @@
+## http://man7.org/linux/man-pages/man3/termios.3.html
+## XCASE  (not in POSIX; not supported under Linux)
+--- ModemManager-1.4.6/libqcdm/src/com.c
++++ ModemManager-1.4.6.new/libqcdm/src/com.c
+_at_@ -39,7 +39,7 @@
+     stbuf.c_iflag &= ~(HUPCL | IUTF8 | IUCLC | ISTRIP | IXON | IXOFF | IXANY | ICRNL);
+     stbuf.c_oflag &= ~(OPOST | OCRNL | ONLCR | OLCUC | ONLRET);
+     stbuf.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOK | ECHONL);
+-    stbuf.c_lflag &= ~(NOFLSH | XCASE | TOSTOP | ECHOPRT | ECHOCTL | ECHOKE);
++    stbuf.c_lflag &= ~(NOFLSH | TOSTOP | ECHOPRT | ECHOCTL | ECHOKE);
+     stbuf.c_cc[VMIN] = 1;
+     stbuf.c_cc[VTIME] = 0;
+     stbuf.c_cc[VEOF] = 1;
+--- ModemManager-1.4.6/libwmc/src/com.c
++++ ModemManager-1.4.6.new/libwmc/src/com.c
+_at_@ -39,7 +39,7 @@
+     stbuf.c_iflag &= ~(HUPCL | IUTF8 | IUCLC | ISTRIP | IXON | IXOFF | IXANY | ICRNL);
+     stbuf.c_oflag &= ~(OPOST | OCRNL | ONLCR | OLCUC | ONLRET);
+     stbuf.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOK | ECHONL);
+-    stbuf.c_lflag &= ~(NOFLSH | XCASE | TOSTOP | ECHOPRT | ECHOCTL | ECHOKE);
++    stbuf.c_lflag &= ~(NOFLSH | TOSTOP | ECHOPRT | ECHOCTL | ECHOKE);
+     stbuf.c_cc[VMIN] = 1;
+     stbuf.c_cc[VTIME] = 0;
+     stbuf.c_cc[VEOF] = 1;
+--- ModemManager-1.4.6/src/mm-port-serial.c
++++ ModemManager-1.4.6.new/src/mm-port-serial.c
+_at_@ -455,7 +455,7 @@
+ 
+     stbuf.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY );
+     stbuf.c_oflag &= ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET);
+-    stbuf.c_lflag &= ~(ICANON | XCASE | ECHO | ECHOE | ECHONL);
++    stbuf.c_lflag &= ~(ICANON | ECHO | ECHOE | ECHONL);
+     stbuf.c_lflag &= ~(ECHO | ECHOE);
+     stbuf.c_cc[VMIN] = 1;
+     stbuf.c_cc[VTIME] = 0;
-- 
2.3.5
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Apr 23 2015 - 17:13:37 GMT