diff options
author | root <root@rshg054.dnsready.net> | 2012-07-31 00:02:30 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-07-31 00:02:30 +0000 |
commit | 5b3474881a154216b47c6e154552ee5f9c68c509 (patch) | |
tree | 098f24750e89f88b3c80ded4579a44928bae1b45 /testing/usbmuxd | |
parent | 4982c269b318734d01ad30c6592fbb73565ceb12 (diff) |
Tue Jul 31 00:02:29 UTC 2012
Diffstat (limited to 'testing/usbmuxd')
-rw-r--r-- | testing/usbmuxd/85-usbmuxd.rules | 9 | ||||
-rw-r--r-- | testing/usbmuxd/PKGBUILD | 42 | ||||
-rw-r--r-- | testing/usbmuxd/usbmuxd.install | 19 | ||||
-rw-r--r-- | testing/usbmuxd/usbmuxd.service | 5 |
4 files changed, 75 insertions, 0 deletions
diff --git a/testing/usbmuxd/85-usbmuxd.rules b/testing/usbmuxd/85-usbmuxd.rules new file mode 100644 index 000000000..ec9f72501 --- /dev/null +++ b/testing/usbmuxd/85-usbmuxd.rules @@ -0,0 +1,9 @@ +# usbmuxd ("Apple Mobile Device" muxer listening on /var/run/usbmuxd) + +# Forces iDevices to the last USB configuration and runs usbmuxd +TEST=="/sys/fs/cgroup/systemd", ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="12[9a][0-9a-f]", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", OWNER="usbmux", TAG+="systemd", ENV{SYSTEMD_WANTS}="usbmuxd.service", GOTO="usbmuxd_systemd_end" +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="12[9a][0-9a-f]", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", OWNER="usbmux", RUN+="/usr/sbin/usbmuxd -u -U usbmux" +LABEL="usbmuxd_systemd_end" + +# Exit usbmuxd when the last device is removed +ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ENV{INTERFACE}=="255/*", RUN+="/usr/sbin/usbmuxd -x" diff --git a/testing/usbmuxd/PKGBUILD b/testing/usbmuxd/PKGBUILD new file mode 100644 index 000000000..6385ba910 --- /dev/null +++ b/testing/usbmuxd/PKGBUILD @@ -0,0 +1,42 @@ +# $Id: PKGBUILD 164299 2012-07-29 23:16:20Z tomegun $ +# Maintainer : Ionut Biru <ibiru@archlinux.org> +# Contributor: Gabriel Martinez < reitaka at gmail dot com > + +pkgname=usbmuxd +pkgver=1.0.8 +pkgrel=1 +pkgdesc="USB Multiplex Daemon" +url="http://marcansoft.com/blog/iphonelinux/usbmuxd/" +arch=('i686' 'x86_64') +license=('GPL2' 'GPL3' 'LGPL2.1') +depends=('libusb' 'libplist') +makedepends=('cmake') +install=usbmuxd.install +source=("http://cgit.sukimashita.com/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.bz2" + 'usbmuxd.service' + '85-usbmuxd.rules') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + echo "${pkgver}" > version.tag + mkdir build + cd build + cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLIB_SUFFIX="" + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}/build" + make DESTDIR="${pkgdir}" install + + # fix udev dir being hardcoded + mv "${pkgdir}/lib/udev" "${pkgdir}/usr/lib/" + rmdir "${pkgdir}/lib" + # install systemd service file + install -D -m644 ${srcdir}/usbmuxd.service ${pkgdir}/usr/lib/systemd/system/usbmuxd.service + # use udev rule that works with systemd + install -m644 ${srcdir}/85-usbmuxd.rules ${pkgdir}/usr/lib/udev/rules.d/ +} +md5sums=('87fd27773a84e97ac6e2dc28b08d682e' + 'dae0660f972510a6483992b5b81e1b5a' + 'dc4b2893651149eccbf7b2c8467cd288') diff --git a/testing/usbmuxd/usbmuxd.install b/testing/usbmuxd/usbmuxd.install new file mode 100644 index 000000000..1a4859674 --- /dev/null +++ b/testing/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 +} diff --git a/testing/usbmuxd/usbmuxd.service b/testing/usbmuxd/usbmuxd.service new file mode 100644 index 000000000..fbebf65b9 --- /dev/null +++ b/testing/usbmuxd/usbmuxd.service @@ -0,0 +1,5 @@ +[Unit] +Description=iOS USB Muxer + +[Service] +ExecStart=/usr/sbin/usbmuxd -u -f -U usbmux |