Index: UPDATING =================================================================== RCS file: /home/pcvs/ports/UPDATING,v retrieving revision 1.765 diff -u -r1.765 UPDATING --- UPDATING 24 Jan 2009 07:34:28 -0000 1.765 +++ UPDATING 26 Jan 2009 16:57:02 -0000 @@ -6,6 +6,14 @@ time you update your ports collection, before attempting any port upgrades. +20090126: + 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. + 20090124: AFFECTS: users of x11-servers/xorg-server, sysutils/hal AUTHOR: rnoland@FreeBSD.org Index: UIDs =================================================================== RCS file: /home/pcvs/ports/UIDs,v retrieving revision 1.77 diff -u -r1.77 UIDs --- UIDs 12 Jan 2009 15:17:52 -0000 1.77 +++ UIDs 26 Jan 2009 16:57:02 -0000 @@ -115,6 +115,7 @@ 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 Index: GIDs =================================================================== RCS file: /home/pcvs/ports/GIDs,v retrieving revision 1.67 diff -u -r1.67 GIDs --- GIDs 12 Jan 2009 15:17:52 -0000 1.67 +++ GIDs 26 Jan 2009 16:57:02 -0000 @@ -104,6 +104,7 @@ stunnel:*:341: openfire:*:342: _iodined:*:353: +httptunnel:*:361: ldap:*:389: tiarra:*:398: drweb:*:426: Index: www/httptunnel/Makefile =================================================================== RCS file: /home/pcvs/ports/www/httptunnel/Makefile,v retrieving revision 1.13 diff -u -r1.13 Makefile --- www/httptunnel/Makefile 4 Apr 2005 13:36:15 -0000 1.13 +++ www/httptunnel/Makefile 26 Jan 2009 16:57:02 -0000 @@ -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 @@ 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 Index: www/httptunnel/pkg-deinstall =================================================================== RCS file: www/httptunnel/pkg-deinstall diff -N www/httptunnel/pkg-deinstall --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/httptunnel/pkg-deinstall 26 Jan 2009 16:57:02 -0000 @@ -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 Index: www/httptunnel/pkg-install =================================================================== RCS file: www/httptunnel/pkg-install diff -N www/httptunnel/pkg-install --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/httptunnel/pkg-install 26 Jan 2009 16:57:02 -0000 @@ -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 Index: www/httptunnel/pkg-plist =================================================================== RCS file: www/httptunnel/pkg-plist diff -N www/httptunnel/pkg-plist --- www/httptunnel/pkg-plist 21 Mar 2000 01:18:06 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,3 +0,0 @@ -bin/hts -bin/htc -etc/rc.d/httptunnel.sh Index: www/httptunnel/files/htc.in =================================================================== RCS file: www/httptunnel/files/htc.in diff -N www/httptunnel/files/htc.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/httptunnel/files/htc.in 26 Jan 2009 16:57:02 -0000 @@ -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" Index: www/httptunnel/files/hts.in =================================================================== RCS file: www/httptunnel/files/hts.in diff -N www/httptunnel/files/hts.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ www/httptunnel/files/hts.in 26 Jan 2009 16:57:02 -0000 @@ -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" Index: www/httptunnel/files/httptunnel.sh =================================================================== RCS file: www/httptunnel/files/httptunnel.sh diff -N www/httptunnel/files/httptunnel.sh --- www/httptunnel/files/httptunnel.sh 4 Apr 2005 12:54:40 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,62 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: ports/www/httptunnel/files/httptunnel.sh,v 1.4 2005/04/04 12:54:40 flz Exp $ - -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