aboutsummaryrefslogtreecommitdiff
path: root/sysutils/ipad_charge
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2013-08-08 08:27:44 +0000
committerKevin Lo <kevlo@FreeBSD.org>2013-08-08 08:27:44 +0000
commit5a7c983c5da6905d13c68bf43f1c9a563a566ff4 (patch)
treecb0a41ad6f1860e3440881d63de3cbad0d8c6e78 /sysutils/ipad_charge
parent0e44e50f72f2468046267ee5ebe82a66c984cb38 (diff)
downloadports-5a7c983c5da6905d13c68bf43f1c9a563a566ff4.tar.gz
ports-5a7c983c5da6905d13c68bf43f1c9a563a566ff4.zip
Update to 2.0.4
Submitted by: hselasky
Notes
Notes: svn path=/head/; revision=324380
Diffstat (limited to 'sysutils/ipad_charge')
-rw-r--r--sysutils/ipad_charge/Makefile37
-rw-r--r--sysutils/ipad_charge/distinfo2
-rw-r--r--sysutils/ipad_charge/files/ipad_charge.conf.in22
-rw-r--r--sysutils/ipad_charge/files/ipad_charge.in44
-rw-r--r--sysutils/ipad_charge/files/patch-ipad_charge.c11
-rw-r--r--sysutils/ipad_charge/pkg-descr6
-rw-r--r--sysutils/ipad_charge/pkg-message11
7 files changed, 95 insertions, 38 deletions
diff --git a/sysutils/ipad_charge/Makefile b/sysutils/ipad_charge/Makefile
index 0f09f885e519..20e9daeb72cd 100644
--- a/sysutils/ipad_charge/Makefile
+++ b/sysutils/ipad_charge/Makefile
@@ -1,38 +1,31 @@
-# New ports collection makefile for: ipad_charge
-# Date created: 13 January 2012
-# Whom: Kevin Lo <kevlo@FreeBSD.org>
-#
# $FreeBSD$
-#
PORTNAME= ipad_charge
-PORTVERSION= 1.1
+PORTVERSION= 2.0.1
CATEGORIES= sysutils
-MASTER_SITES= http://www.rainbow-software.org/linux_files/
-DISTNAME= ${PORTNAME}_${PORTVERSION}
+DISTFILES= # empty
MAINTAINER= kevlo@FreeBSD.org
-COMMENT= An iPad/iPad2 USB charging utility
+COMMENT= Generic iPad USB charging utility
-LDFLAGS+= -lusb
-WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+LICENSE= BSD
-LICENSE= GPLv2
-LICENSE_FILE= ${WRKSRC}/COPYING
-
-PLIST_FILES= bin/ipad_charge
+USE_RC_SUBR= ipad_charge
+NO_BUILD= yes
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 800069
-BROKEN= does not compile
+.if ${OSVERSION} < 800000
+IGNORE= requires FreeBSD 8.0-RELEASE or later
.endif
-do-build:
- ${CC} ${CFLAGS} ${LDFLAGS} ${WRKSRC}/${PORTNAME}.c \
- -o ${WRKSRC}/${PORTNAME}
-
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
+
+post-install:
+ @${MKDIR} ${PREFIX}/etc/devd
+ @${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \
+ < ${FILESDIR}/ipad_charge.conf.in > ${WRKDIR}/ipad_charge.conf
+ ${INSTALL_DATA} "${WRKDIR}/ipad_charge.conf" ${PREFIX}/etc/devd
+ @${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>
diff --git a/sysutils/ipad_charge/distinfo b/sysutils/ipad_charge/distinfo
deleted file mode 100644
index d4ca64e052f5..000000000000
--- a/sysutils/ipad_charge/distinfo
+++ /dev/null
@@ -1,2 +0,0 @@
-SHA256 (ipad_charge_1.1.tar.gz) = 85b73b4deb0a0ef287bf1f34720937c99795f3e55ac1f038fef62a6fea2422c4
-SIZE (ipad_charge_1.1.tar.gz) = 9170
diff --git a/sysutils/ipad_charge/files/ipad_charge.conf.in b/sysutils/ipad_charge/files/ipad_charge.conf.in
new file mode 100644
index 000000000000..1784e47cbca2
--- /dev/null
+++ b/sysutils/ipad_charge/files/ipad_charge.conf.in
@@ -0,0 +1,22 @@
+# The following list of product IDs was obtained from
+# https://github.com/mkorenkov/ipad_charge
+
+# Apple iPad/iPod/iPhone devices
+notify 100 {
+ match "system" "USB";
+ match "subsystem" "DEVICE";
+ match "type" "ATTACH";
+ match "vendor" "0x05ac";
+ match "product" "0x129[0-9ab]";
+ action "%%PREFIX%%/etc/rc.d/ipad_charge start $cdev";
+};
+
+# Apple iPad/iPod/iPhone devices
+notify 100 {
+ match "system" "USB";
+ match "subsystem" "DEVICE";
+ match "type" "ATTACH";
+ match "vendor" "0x05ac";
+ match "product" "0x12a[0-9ab]";
+ action "%%PREFIX%%/etc/rc.d/ipad_charge start $cdev";
+};
diff --git a/sysutils/ipad_charge/files/ipad_charge.in b/sysutils/ipad_charge/files/ipad_charge.in
new file mode 100644
index 000000000000..2b51f489a173
--- /dev/null
+++ b/sysutils/ipad_charge/files/ipad_charge.in
@@ -0,0 +1,44 @@
+#!/bin/sh
+# $FreeBSD$
+#
+# PROVIDE: ipad_charge
+# REQUIRE: DAEMON
+#
+# Add the following line to /etc/rc.conf[.local] to enable ipad_charge:
+#
+# ipad_charge_enable="YES"
+# ipad_charge_action="ON" (default)
+# ipad_charge_action="OFF"
+#
+
+ipad_charge_enable=${ipad_charge_enable-"NO"}
+ipad_charge_action=${ipad_charge_action-"ON"}
+
+. /etc/rc.subr
+
+name=ipad_charge
+rcvar=ipad_charge_enable
+command="/usr/sbin/usbconfig"
+command_args_on="-d $2 do_request 0x40 0x40 0x6400 0x6400 0"
+command_args_off="-d $2 do_request 0x40 0x40 0x6400 0x0000 0"
+start_precmd="${name}_prestart"
+pidfile=""
+
+ipad_charge_prestart()
+{
+ case ${ipad_charge_action} in
+ [Oo][Nn])
+ command_args="${command_args_on}"
+ ;;
+ *)
+ command_args="${command_args_off}"
+ ;;
+ esac
+}
+
+load_rc_config $name
+
+if [ $# -gt 1 ]; then
+ # Only run the rc command if the appropriate arguments are specified:
+ run_rc_command $1
+fi
diff --git a/sysutils/ipad_charge/files/patch-ipad_charge.c b/sysutils/ipad_charge/files/patch-ipad_charge.c
deleted file mode 100644
index 1a940cb04165..000000000000
--- a/sysutils/ipad_charge/files/patch-ipad_charge.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- ipad_charge.c.orig 2011-05-11 03:59:12.000000000 +0800
-+++ ipad_charge.c 2012-01-13 14:07:58.000000000 +0800
-@@ -4,7 +4,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
--#include <libusb-1.0/libusb.h>
-+#include <libusb.h>
-
- #define VERSION "1.0"
-
diff --git a/sysutils/ipad_charge/pkg-descr b/sysutils/ipad_charge/pkg-descr
index 434db5d48470..4c000cf15640 100644
--- a/sysutils/ipad_charge/pkg-descr
+++ b/sysutils/ipad_charge/pkg-descr
@@ -1,3 +1,3 @@
-ipad_charge is an iPad USB charging control utility.
-
-WWW: http://www.rainbow-software.org/linux/
+The iPad charge port provide some simple devd scripts which can enable
+or disable charging on your iPad/iPod/iPhone when it is connected to the
+USB port on your PC.
diff --git a/sysutils/ipad_charge/pkg-message b/sysutils/ipad_charge/pkg-message
new file mode 100644
index 000000000000..2d6b51f67973
--- /dev/null
+++ b/sysutils/ipad_charge/pkg-message
@@ -0,0 +1,11 @@
+*********************************************************************
+1) add ipad_charge_enable="YES" and optionally
+ ipad_charge_action="ON" (default) or "OFF" .
+
+to your /etc/rc.conf
+
+2) Please restart devd as the configuration changed
+
+ # service devd restart
+
+*********************************************************************