summaryrefslogtreecommitdiff
path: root/extra/usbmuxd
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/usbmuxd
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/usbmuxd')
-rw-r--r--extra/usbmuxd/PKGBUILD28
-rw-r--r--extra/usbmuxd/usbmuxd-udevuser.patch11
-rw-r--r--extra/usbmuxd/usbmuxd.install19
3 files changed, 58 insertions, 0 deletions
diff --git a/extra/usbmuxd/PKGBUILD b/extra/usbmuxd/PKGBUILD
new file mode 100644
index 000000000..d579eef00
--- /dev/null
+++ b/extra/usbmuxd/PKGBUILD
@@ -0,0 +1,28 @@
+# $Id: PKGBUILD 101289 2010-11-28 18:01:54Z ibiru $
+# Maintainer : Ionut Biru <ibiru@archlinux.org>
+# Contributor: Gabriel Martinez < reitaka at gmail dot com >
+
+pkgname=usbmuxd
+pkgver=1.0.6
+pkgrel=2
+pkgdesc="USB Multiplex Daemon"
+url="http://marcansoft.com/blog/iphonelinux/usbmuxd/"
+arch=('i686' 'x86_64')
+license=('GPL2' 'GPL3' 'LGPL2.1')
+depends=('libusb>=1.0.8')
+makedepends=('cmake')
+install=usbmuxd.install
+source=(http://marcansoft.com/uploads/${pkgname}/${pkgname}-${pkgver}.tar.bz2
+ usbmuxd-udevuser.patch)
+md5sums=('c8909cfd9253d8d1a5e26f2ff7e5908b'
+ '299349dcacd60af9dceecec1ceebce06')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -Np1 -i "${srcdir}/usbmuxd-udevuser.patch"
+ mkdir build
+ cd build
+ cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLIB_SUFFIX=""
+ make
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/extra/usbmuxd/usbmuxd-udevuser.patch b/extra/usbmuxd/usbmuxd-udevuser.patch
new file mode 100644
index 000000000..af091e64d
--- /dev/null
+++ b/extra/usbmuxd/usbmuxd-udevuser.patch
@@ -0,0 +1,11 @@
+--- usbmuxd-1.0.6/udev/85-usbmuxd.rules.in.orig 2010-11-09 04:23:44.873368717 -0800
++++ usbmuxd-1.0.6/udev/85-usbmuxd.rules.in 2010-11-09 04:24:13.986655838 -0800
+@@ -1,7 +1,7 @@
+ # usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd)
+
+ # Forces iPhone 1.0, 3G, 3GS, iPodTouch 1/2 and iPad to USB configuration 3 and run usbmuxd
+-ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9a-f]", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -u -U usbmux"
++ACTION=="add", SUBSYSTEM=="usb", OWNER="usbmux", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9a-f]", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -u -U usbmux"
+
+ # Exit usbmuxd when the last device is removed
+ ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-9a-f]/*", ENV{INTERFACE}=="255/*", RUN+="@CMAKE_INSTALL_PREFIX@/sbin/usbmuxd -x"
diff --git a/extra/usbmuxd/usbmuxd.install b/extra/usbmuxd/usbmuxd.install
new file mode 100644
index 000000000..1a4859674
--- /dev/null
+++ b/extra/usbmuxd/usbmuxd.install
@@ -0,0 +1,19 @@
+post_install() {
+ groupadd -g 140 usbmux &>/dev/null
+ useradd -c 'usbmux user' -u 140 -g usbmux -d / -s /sbin/nologin usbmux &>/dev/null
+ passwd -l usbmux &>/dev/null
+}
+
+post_upgrade() {
+ getent group usbmux >/dev/null 2>&1 || groupadd -g 140 usbmux &>/dev/null
+ getent passwd usbmux >/dev/null 2>&1 || useradd -c 'usbmux user' -u 140 -g usbmux -d / -s /sbin/nologin usbmux &>/dev/null
+}
+
+post_remove() {
+ if getent passwd usbmux >/dev/null 2>&1; then
+ userdel usbmux
+ fi
+ if getent group usbmux >/dev/null 2>&1; then
+ groupdel usbmux
+ fi
+}