aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GIDs1
-rw-r--r--UIDs1
-rw-r--r--UPDATING8
-rw-r--r--www/httptunnel/Makefile12
-rw-r--r--www/httptunnel/files/htc.in77
-rw-r--r--www/httptunnel/files/hts.in51
-rw-r--r--www/httptunnel/files/httptunnel.sh62
-rw-r--r--www/httptunnel/pkg-deinstall27
-rw-r--r--www/httptunnel/pkg-install36
-rw-r--r--www/httptunnel/pkg-plist3
10 files changed, 208 insertions, 70 deletions
diff --git a/GIDs b/GIDs
index c83a691c43b8..c45b6ec1c0c5 100644
--- a/GIDs
+++ b/GIDs
@@ -104,6 +104,7 @@ wildfire:*:340:
stunnel:*:341:
openfire:*:342:
_iodined:*:353:
+httptunnel:*:361:
ldap:*:389:
tiarra:*:398:
drweb:*:426:
diff --git a/UIDs b/UIDs
index 88e4cf4eb2e1..909bc1a10077 100644
--- a/UIDs
+++ b/UIDs
@@ -115,6 +115,7 @@ wildfire:*:340:340::0:0:Wildfire Daemon:/nonexistent:/usr/sbin/nologin
stunnel:*:341:341::0:0:Stunnel Daemon:/nonexistent:/usr/sbin/nologin
openfire:*:342:342::0:0:Openfire IM Daemon:/nonexistent:/usr/sbin/nologin
_iodined:*:353:353::0:0:Iodine Daemon:/nonexistent:/usr/sbin/nologin
+httptunnel:*:361:361::0:0:httptunnel Daemon:/nonexistent:/usr/sbin/nologin
ldap:*:389:389::0:0:OpenLDAP Server:/nonexistent:/usr/sbin/nologin
tiarra:*:398:398::0:0:Tiarra IRC Proxy:/nonexistent:/usr/sbin/nologin
drweb:*:426:426::0:0:Dr.Web Mail Scanner:/nonexistent:/usr/sbin/nologin
diff --git a/UPDATING b/UPDATING
index 345c07d17527..408d18be9a53 100644
--- a/UPDATING
+++ b/UPDATING
@@ -6,6 +6,14 @@ You should get into the habit of checking this file for changes each
time you update your ports collection, before attempting any port
upgrades.
+20090130:
+ AFFECTS: users of www/httptunnel
+ AUTHOR: rafan@FreeBSD.org
+
+ The startup script has been converted to new rc.d style and split
+ into two scripts: htc (client) and hts (server). Please check the scripts
+ for how to set variables in /etc/rc.conf.
+
20090127:
AFFECTS: gstreamer-plugins
AUTHOR: kwm@FreeBSD.org
diff --git a/www/httptunnel/Makefile b/www/httptunnel/Makefile
index f1e198ff1167..0e55ab66a180 100644
--- a/www/httptunnel/Makefile
+++ b/www/httptunnel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= httptunnel
PORTVERSION= 3.3
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www
MASTER_SITES= http://www.Awfulhak.org/httptunnel/ \
ftp://ftp.nocrew.org/pub/nocrew/unix/ \
@@ -16,16 +16,18 @@ MASTER_SITES= http://www.Awfulhak.org/httptunnel/ \
MAINTAINER= ports@FreeBSD.org
COMMENT= Tunnel a tcp/ip connection through a http/tcp/ip connection
-HAS_CONFIGURE= yes
+GNU_CONFIGURE= yes
CONFIGURE_ARGS= --quiet
.if defined(ENABLE_DEBUG)
CONFIGURE_ARGS+=--enable-debug
.endif
MAN1= hts.1 htc.1
+USE_RC_SUBR= hts htc
+
+PLIST_FILES= bin/hts bin/htc
+
post-install:
- ${SED} -e 's,%%PREFIX%%,${PREFIX},g' ${FILESDIR}/httptunnel.sh \
- >${PREFIX}/etc/rc.d/httptunnel.sh
- ${CHMOD} 755 ${PREFIX}/etc/rc.d/httptunnel.sh
+ @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>
diff --git a/www/httptunnel/files/htc.in b/www/httptunnel/files/htc.in
new file mode 100644
index 000000000000..7083d4f4cb49
--- /dev/null
+++ b/www/httptunnel/files/htc.in
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# PROVIDE: htc
+# REQUIRE: LOGIN
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# htc_enable (bool): Set to NO by default.
+# Set it to YES to enable httptunnel client.
+# htc_port (string): host:port where hts is running
+# htc_forward (string): Talk to this socket.
+# htc_device (string): *or* talk to this device.
+#
+# htc_proxy (string): host:port of proxy to talk to hts via
+# htc_proxyauth (string): user:password to pass to proxy, or a file
+# htc_proxybuffer (string): Buffer size for buffered proxies.
+# Default set to "1K".
+# htc_browser (string): Pretend to be this browser.
+# Default set to "Mozilla/4.7 [en] (X11; I; Linux 2.2.12 i386)".
+# htc_flags (string): additional arguments to htc. Default set to -S.
+#
+
+. %%RC_SUBR%%
+
+name="htc"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/bin/${name}
+
+start_precmd="htc_prestart"
+
+htc_prestart()
+{
+ if checkyesno htc_enable; then
+ if [ -z "$htc_device" -a -z "$htc_forward" ]; then
+ err 1 "Specify either htc_device or htc_forward"
+ fi
+ fi
+
+ return 0
+}
+
+
+load_rc_config $name
+
+: ${htc_enable="NO"}
+: ${htc_user="httptunnel"}
+
+: ${htc_port=""}
+: ${htc_forward=""}
+: ${htc_device=""}
+
+: ${htc_proxy=""}
+: ${htc_proxyauth=""}
+: ${htc_proxybuffer="1K"}
+: ${htc_browser="Mozilla/4.7 [en] (X11; I; Linux 2.2.12 i386)"}
+: ${htc_flags="-S"}
+
+[ -n "$htc_forward" ] && command_args="-F $htc_forward"
+[ -n "$htc_device" ] && command_args="-d $htc_device"
+[ -n "$htc_browser" ] && command_args="-U '\"'\"'$htc_browser'\"'\"' $command_args"
+if [ -n "$htc_proxy" ]; then
+ [ -n "$htc_proxybuffer" ] && command_args="-B $htc_proxybuffer $command_args"
+ if [ -n "$htc_proxyauth" ]; then
+ if [ -f "$htc_proxyauth" ]; then
+ command_args="--proxy-authorization-file $htc_proxyauth $command_args"
+ else
+ command_args="-A $htc_proxyauth $command_args"
+ fi
+ fi
+ command_args="-P $htc_proxy $command_args"
+fi
+
+command_args="$command_args $htc_port"
+
+run_rc_command "$1"
diff --git a/www/httptunnel/files/hts.in b/www/httptunnel/files/hts.in
new file mode 100644
index 000000000000..7714b619fdad
--- /dev/null
+++ b/www/httptunnel/files/hts.in
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+# PROVIDE: hts
+# REQUIRE: LOGIN
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# hts_enable (bool): Set to NO by default.
+# Set it to YES to enable httptunnel server.
+# hts_port (string): [host:]port to listen for htc connection.
+# Set to 8888 by default.
+# hts_forward (string): Talk to this socket.
+# hts_device (string): *or* talk to this device.
+# hts_flags (string): Additional flags for hts.
+#
+
+. %%RC_SUBR%%
+
+name="hts"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/bin/${name}
+
+start_precmd="hts_prestart"
+
+hts_prestart()
+{
+ if checkyesno hts_enable; then
+ if [ -z "$hts_device" -a -z "$hts_forward" ]; then
+ err 1 "Specify either hts_device or hts_forward"
+ fi
+ fi
+
+ return 0
+}
+
+load_rc_config $name
+
+: ${hts_enable="NO"}
+: ${hts_user="httptunnel"}
+
+: ${hts_port="8888"}
+: ${hts_device=""}
+: ${hts_forward=""}
+
+[ -n "$hts_device" ] && command_args="-d $hts_device"
+[ -n "$hts_forward" ] && command_args="-F $hts_forward"
+command_args="$command_args $hts_port"
+
+run_rc_command "$1"
diff --git a/www/httptunnel/files/httptunnel.sh b/www/httptunnel/files/httptunnel.sh
deleted file mode 100644
index 6cc2093ea69e..000000000000
--- a/www/httptunnel/files/httptunnel.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-
-USER=httptunnel
-
-HTS=%%PREFIX%%/bin/hts # The installed hts program
-HTSPORT= # [host:]port to listen for htc connection
-HTSFORWARD= # Talk to this socket
-HTSDEVICE= # *or* talk to this device
-
-HTC=%%PREFIX%%/bin/htc # The installed htc program
-HTCPORT= # host:port where hts is running
-HTCFORWARD= # Talk to this socket
-HTCDEVICE= # *or* talk to this device
-
-HTCPROXY= # host:port of proxy to talk to hts via
-HTCPROXYAUTH= # user:password to pass to proxy
-HTCPROXYBUFFER=1K # Buffer size for buffered proxies
-HTCBROWSER='Mozilla/4.7 [en] (X11; I; Linux 2.2.12 i386)' # Pretend to be this
-HTCARGS=-S # Any other arguments required
-
-case $1 in
-start)
- if [ -n "$HTSPORT" -a -x $HTS ]; then
- [ -n "$HTSFORWARD" ] && args="-F $HTSFORWARD"
- [ -n "$HTSDEVICE" ] && args="-d $HTSDEVICE"
- su -m $USER -c "$HTS $args $HTSPORT" && echo -n ' hts'
- fi
-
- if [ -n "$HTCPORT" -a -x $HTC ]; then
- [ -n "$HTCFORWARD" ] && args="-F $HTCFORWARD"
- [ -n "$HTCDEVICE" ] && args="-d $HTCDEVICE"
- [ -n "$HTCBROWSER" ] && args="-U \"$HTCBROWSER\" $args"
- if [ -n "$HTCPROXY" ]; then
- [ -n "$HTCPROXYBUFFER" ] &&
- args="-B $HTCPROXYBUFFER $args"
- if [ -n "$HTCPROXYAUTH" ]
- then
- if [ -f "$HTCPROXYAUTH" ]
- then
- args="--proxy-authorization-file $HTCPROXYAUTH $args"
- else
- args="-A $HTCPROXYAUTH $args"
- fi
- fi
- args="-P $HTCPROXY $args"
- fi
- su -m $USER -c "$HTC $args $HTCARGS $HTCPORT" && echo -n ' htc'
- fi
- ;;
-stop)
- killall htc && echo -n ' htc'
- killall hts && echo -n ' hts'
- ;;
-*)
- echo "Usage: `basename $0` {start|stop}" >&2
- exit 64
- ;;
-esac
-
-exit 0
diff --git a/www/httptunnel/pkg-deinstall b/www/httptunnel/pkg-deinstall
new file mode 100644
index 000000000000..b711522d0c7f
--- /dev/null
+++ b/www/httptunnel/pkg-deinstall
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+case $2 in
+POST-DEINSTALL)
+ USER=httptunnel
+ GROUP=${USER}
+ PW=/usr/sbin/pw
+
+ if ${PW} groupshow "${GROUP}" 2>/dev/null 1>&2; then
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ echo "To delete the ${USER} group permanently, use '${PW} groupdel ${GROUP}'."
+ else
+ ${PW} groupdel ${USER}
+ fi
+ fi
+
+ if ${PW} usershow "${USER}" 2>/dev/null 1>&2; then
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
+ echo "To delete the ${USER} user permanently, use '${PW} userdel ${USER}'."
+ else
+ ${PW} userdel ${USER}
+ fi
+ fi
+
+ exit 0
+ ;;
+esac
diff --git a/www/httptunnel/pkg-install b/www/httptunnel/pkg-install
new file mode 100644
index 000000000000..72e86717a570
--- /dev/null
+++ b/www/httptunnel/pkg-install
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+case $2 in
+POST-INSTALL)
+ USER=httptunnel
+ GROUP=${USER}
+ UID=361
+ GID=${UID}
+ PW=/usr/sbin/pw
+
+ if ${PW} group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+ else
+ if ${PW} groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+ fi
+
+ if ${PW} user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ else
+ if ${PW} useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d "/var/empty" -s /sbin/nologin -c "OSPF Daemon"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+ fi
+ exit 0
+ ;;
+esac
diff --git a/www/httptunnel/pkg-plist b/www/httptunnel/pkg-plist
deleted file mode 100644
index 0ed52c93d29f..000000000000
--- a/www/httptunnel/pkg-plist
+++ /dev/null
@@ -1,3 +0,0 @@
-bin/hts
-bin/htc
-etc/rc.d/httptunnel.sh