summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiachen Yang2015-08-10 19:14:28 +0900
committerJiachen Yang2015-08-10 19:14:28 +0900
commitbbe131e52e250629adc47ecced362d7eff83ce64 (patch)
tree61ea1fd728f019bdd16a8e67b9a503e65da59cf8
downloadaur-bbe131e52e250629adc47ecced362d7eff83ce64.tar.gz
takeover ipad_charge
-rw-r--r--.SRCINFO20
-rw-r--r--95-ipad_charge.rules.patch8
-rw-r--r--PKGBUILD33
-rw-r--r--ipad_charge.c.patch22
4 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..e65dabd0ae7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = ipad_charge
+ pkgdesc = iPad USB charging control utility
+ pkgver = 1.1
+ pkgrel = 4
+ url = http://www.rainbow-software.org/linux/
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = gcc
+ depends = udev
+ depends = libusb
+ source = http://www.rainbow-software.org/linux_files/ipad_charge_1.1.tar.gz
+ source = 95-ipad_charge.rules.patch
+ source = ipad_charge.c.patch
+ md5sums = 09b8c600efd747a36c9cc320516326cf
+ md5sums = bfc9325716cc8fcedc04f13fcf7c8693
+ md5sums = 45d28ae05281b4fa0739d858fc01d324
+
+pkgname = ipad_charge
+
diff --git a/95-ipad_charge.rules.patch b/95-ipad_charge.rules.patch
new file mode 100644
index 00000000000..26ee9988ecd
--- /dev/null
+++ b/95-ipad_charge.rules.patch
@@ -0,0 +1,8 @@
+diff -Naur orig/95-ipad_charge.rules src/95-ipad_charge.rules
+--- orig/95-ipad_charge.rules 2011-05-10 22:57:11.000000000 +0300
++++ src/95-ipad_charge.rules 2011-07-05 00:33:47.797987569 +0300
+@@ -1,2 +1,4 @@
+ ENV{DEVTYPE}=="usb_device", ACTION=="add", BUS=="usb", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="129a", RUN+="/usr/bin/ipad_charge"
+ ENV{DEVTYPE}=="usb_device", ACTION=="add", BUS=="usb", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="129f", RUN+="/usr/bin/ipad_charge"
++ENV{DEVTYPE}=="usb_device", ACTION=="add", BUS=="usb", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="12a2", RUN+="/usr/bin/ipad_charge"
++ENV{DEVTYPE}=="usb_device", ACTION=="add", BUS=="usb", SYSFS{idVendor}=="05ac", SYSFS{idProduct}=="12a4", RUN+="/usr/bin/ipad_charge"
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..55bc6b7818f
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,33 @@
+# Maintainer: zlowly <zlowly AT gmail DOT com>
+pkgname=ipad_charge
+pkgver=1.1
+pkgrel=4
+pkgdesc="iPad USB charging control utility"
+arch=("i686" "x86_64")
+url="http://www.rainbow-software.org/linux/"
+license=('GPL2')
+source=("http://www.rainbow-software.org/linux_files/${pkgname}_${pkgver}.tar.gz"
+"95-ipad_charge.rules.patch"
+"ipad_charge.c.patch"
+)
+depends=('udev' 'libusb')
+makedepends=('gcc')
+md5sums=('09b8c600efd747a36c9cc320516326cf'
+ 'bfc9325716cc8fcedc04f13fcf7c8693'
+ '45d28ae05281b4fa0739d858fc01d324')
+build() {
+ cd $srcdir/${pkgname}-${pkgver}
+ patch -p1 -i ${srcdir}/95-ipad_charge.rules.patch
+ sed -i -e "s/SYSFS/ATTRS/g" -e "s/BUS/SUBSYSTEMS/g" 95-ipad_charge.rules
+ patch -p1 -i ${srcdir}/ipad_charge.c.patch
+ gcc -Wall -Wextra ipad_charge.c -lusb-1.0 -o ipad_charge
+}
+package() {
+ mkdir -p $pkgdir/usr/bin
+ mkdir -p $pkgdir/etc/udev/rules.d
+ cd $srcdir/${pkgname}-${pkgver}
+ install -m755 -s ipad_charge $pkgdir/usr/bin/
+ install -m644 95-ipad_charge.rules $pkgdir/etc/udev/rules.d/
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/ipad_charge.c.patch b/ipad_charge.c.patch
new file mode 100644
index 00000000000..a57db2ffdd2
--- /dev/null
+++ b/ipad_charge.c.patch
@@ -0,0 +1,22 @@
+diff -Naur orig/ipad_charge.c src/ipad_charge.c
+--- orig/ipad_charge.c 2011-05-10 22:59:12.000000000 +0300
++++ src/ipad_charge.c 2011-07-05 00:32:16.494656512 +0300
+@@ -12,6 +12,7 @@
+ #define VENDOR_APPLE 0x05ac
+ #define PRODUCT_IPAD 0x129a
+ #define PRODUCT_IPAD2 0x129f
++#define PRODUCT_IPAD2_3G 0x12a2
+
+ int set_charging_mode(libusb_device *dev, bool enable) {
+ int ret;
+@@ -130,7 +131,9 @@
+ continue;
+ }
+ if (desc.idVendor == VENDOR_APPLE &&
+- (desc.idProduct == PRODUCT_IPAD || desc.idProduct == PRODUCT_IPAD2)) {
++ (desc.idProduct == PRODUCT_IPAD ||
++ desc.idProduct == PRODUCT_IPAD2 ||
++ desc.idProduct == PRODUCT_IPAD2_3G)) {
+ if (set_charging_mode(dev, enable) < 0)
+ fprintf(stderr, "ipad_charge: error setting charge mode\n");
+ else