summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore4
-rw-r--r--95-ipad_charge.rules.patch8
-rw-r--r--PKGBUILD46
-rw-r--r--ipad_charge.c.patch22
5 files changed, 39 insertions, 61 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e65dabd0ae7..95f16e5f47b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,9 @@
-pkgbase = ipad_charge
+# Generated by mksrcinfo v8
+# Sun Oct 29 22:14:19 UTC 2017
+pkgbase = ipad_charge-git
pkgdesc = iPad USB charging control utility
- pkgver = 1.1
- pkgrel = 4
+ pkgver = r53.aef5d59
+ pkgrel = 1
url = http://www.rainbow-software.org/linux/
arch = i686
arch = x86_64
@@ -9,12 +11,10 @@ pkgbase = ipad_charge
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
+ provides = ipad_charge
+ conflicts = ipad_charge
+ source = git+https://github.com/mkorenkov/ipad_charge
+ md5sums = SKIP
-pkgname = ipad_charge
+pkgname = ipad_charge-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..7faeeb9dd3b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/pkg/
+/src/
+*.pkg.tar.xz
+/ipad_charge/
diff --git a/95-ipad_charge.rules.patch b/95-ipad_charge.rules.patch
deleted file mode 100644
index 26ee9988ecd..00000000000
--- a/95-ipad_charge.rules.patch
+++ /dev/null
@@ -1,8 +0,0 @@
-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
index 55bc6b7818f..895531822a7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,33 +1,37 @@
-# Maintainer: zlowly <zlowly AT gmail DOT com>
-pkgname=ipad_charge
-pkgver=1.1
-pkgrel=4
+# Maintainer: Vladimir Panteleev <arch-pkg at thecybershadow.net>
+# Contributor zlowly <zlowly AT gmail DOT com>
+
+_pkgname=ipad_charge
+pkgname=${_pkgname}-git
+pkgver=r53.aef5d59
+pkgrel=1
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"
-)
+provides=('ipad_charge')
+conflicts=('ipad_charge')
+source=("git+https://github.com/mkorenkov/ipad_charge")
+md5sums=('SKIP')
depends=('udev' 'libusb')
makedepends=('gcc')
-md5sums=('09b8c600efd747a36c9cc320516326cf'
- 'bfc9325716cc8fcedc04f13fcf7c8693'
- '45d28ae05281b4fa0739d858fc01d324')
+
+pkgver() {
+ cd "${srcdir}/${_pkgname}"
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
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
+ cd "${srcdir}/${_pkgname}"
+ make
}
+
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/
+ mkdir -p "${pkgdir}/usr/bin"
+ mkdir -p "${pkgdir}/etc/udev/rules.d"
+ cd "${srcdir}/${_pkgname}"
+ 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
deleted file mode 100644
index a57db2ffdd2..00000000000
--- a/ipad_charge.c.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-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