From 85a37d558caffb947008b18a6c156e94e93861b1 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 16 Apr 2014 20:12:49 +0000
Subject: usbmuxd: update to 1.0.9. refs #961

---
 abs/extra/usbmuxd/39-usbmuxd.rules |  9 +++++++
 abs/extra/usbmuxd/85-usbmuxd.rules |  9 -------
 abs/extra/usbmuxd/PKGBUILD         | 48 +++++++++++++++++---------------------
 abs/extra/usbmuxd/__changelog      |  3 ---
 4 files changed, 30 insertions(+), 39 deletions(-)
 create mode 100644 abs/extra/usbmuxd/39-usbmuxd.rules
 delete mode 100644 abs/extra/usbmuxd/85-usbmuxd.rules
 delete mode 100644 abs/extra/usbmuxd/__changelog

diff --git a/abs/extra/usbmuxd/39-usbmuxd.rules b/abs/extra/usbmuxd/39-usbmuxd.rules
new file mode 100644
index 0000000..ec9f725
--- /dev/null
+++ b/abs/extra/usbmuxd/39-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/abs/extra/usbmuxd/85-usbmuxd.rules b/abs/extra/usbmuxd/85-usbmuxd.rules
deleted file mode 100644
index ec9f725..0000000
--- a/abs/extra/usbmuxd/85-usbmuxd.rules
+++ /dev/null
@@ -1,9 +0,0 @@
-# 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/abs/extra/usbmuxd/PKGBUILD b/abs/extra/usbmuxd/PKGBUILD
index 3282c08..6695533 100644
--- a/abs/extra/usbmuxd/PKGBUILD
+++ b/abs/extra/usbmuxd/PKGBUILD
@@ -3,46 +3,40 @@
 # Contributor: Gabriel Martinez < reitaka at gmail dot com >
 
 pkgname=usbmuxd
-pkgver=1.0.8
-pkgrel=2
+pkgver=1.0.9
+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')
+license=('GPL2' 'GPL3')
+depends=('libimobiledevice')
+makedepends=('git')
 install=usbmuxd.install
-source=("http://cgit.sukimashita.com/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.bz2"
+source=("git+http://git.sukimashita.com/usbmuxd.git#commit=c92b4f59aba053a3df1ae67c49403122650ad996"
 	'usbmuxd.service'
-	'85-usbmuxd.rules')
+	'39-usbmuxd.rules')
+md5sums=('SKIP'
+         'dae0660f972510a6483992b5b81e1b5a'
+         'dc4b2893651149eccbf7b2c8467cd288')
+
+prepare() {
+  cd usbmuxd
+  sed -i -e 's|udevrulesdir = /lib/udev/rules.d|udevrulesdir = /usr/lib/udev/rules.d|' Makefile.am
+}
 
 build() {
-  cd "${srcdir}/${pkgname}-${pkgver}"
-  echo "${pkgver}" > version.tag
-  mkdir build
-  cd build
-  cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/usr -DLIB_SUFFIX=""
+  cd usbmuxd
+  NOCONFIGURE=1 ./autogen.sh
+  ./configure --prefix=/usr --sbindir=/usr/bin
   make
 }
 
 package() {
-  cd "${srcdir}/${pkgname}-${pkgver}/build"
+  cd usbmuxd
   make DESTDIR="${pkgdir}" install
 
-  # fix udev dir being hardcoded
-  mv "${pkgdir}/lib/udev" "${pkgdir}/usr/lib/"
-  rmdir "${pkgdir}/lib"
-  # usrmove
-  mv "${pkgdir}/usr/sbin/"* "${pkgdir}/usr/bin/"
-  rmdir "${pkgdir}/usr/sbin"
   # install systemd service file
-  install -D -m644 ${srcdir}/usbmuxd.service ${pkgdir}/usr/lib/systemd/system/usbmuxd.service
+  install -D -m644 ../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/ 
-  #fix version
-  sed -i "s/Version.*$/Version: ${pkgver}/g"  $pkgdir/usr/lib/pkgconfig/libusbmuxd.pc
-
+  install -m644 ../39-usbmuxd.rules "${pkgdir}/usr/lib/udev/rules.d/" 
 }
-md5sums=('87fd27773a84e97ac6e2dc28b08d682e'
-         'dae0660f972510a6483992b5b81e1b5a'
-         'dc4b2893651149eccbf7b2c8467cd288')
diff --git a/abs/extra/usbmuxd/__changelog b/abs/extra/usbmuxd/__changelog
deleted file mode 100644
index e5a6fbf..0000000
--- a/abs/extra/usbmuxd/__changelog
+++ /dev/null
@@ -1,3 +0,0 @@
-#fix version -jm
-sed -i "s/Version.*$/Version: ${pkgver}/g"  $pkgdir/usr/lib/pkgconfig/libusbmuxd.pc
-
-- 
cgit v0.12

