- Update to 0.1.1.13

- Correct way to use USE_RC_SUBR
- Update MAINTAINER email

PR:		93314
Submitted by:	maintainer
This commit is contained in:
Marcus Alves Grando 2006-02-17 22:21:25 +00:00
parent 578235cf6a
commit 1a1b28abdb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=156239
11 changed files with 163 additions and 180 deletions

View file

@ -1,18 +1,18 @@
# ports collection makefile for: tor-devel
# Date created: 2005.10.20
# Whom: eol1@yahoo.com
# Whom: peter.thoenen@yahoo.com
#
# $FreeBSD$
#
PORTNAME= tor
PORTVERSION= 0.1.1.12
PORTVERSION= 0.1.1.13
CATEGORIES= security net
MASTER_SITES= http://tor.eff.org/dist/
PKGNAMESUFFIX= -devel
DISTNAME= ${PORTNAME}-${PORTVERSION}-alpha
MAINTAINER= eol1@yahoo.com
MAINTAINER= peter.thoenen@yahoo.com
COMMENT= An anonymizing overlay network for TCP
RUN_DEPENDS= tsocks:${PORTSDIR}/net/tsocks
@ -20,8 +20,10 @@ LIB_DEPENDS= event-1.1a:${PORTSDIR}/devel/libevent
GNU_CONFIGURE= yes
USE_OPENSSL= yes
USE_REINPLACE= yes
USE_RC_SUBR= yes
USE_RC_SUBR= tor
SUB_FILES= pkg-message
PKG_MESSAGE= ${WRKSRC}/pkg-message
CONFLICTS= tor-[0-9]*
@ -33,19 +35,16 @@ post-patch:
${WRKSRC}/contrib/tor-tsocks.conf.sample
@${REINPLACE_CMD} -e "s|tor-tsocks.conf|tor-tsocks.conf.sample|g" \
${WRKSRC}/contrib/Makefile.in
@${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" \
${WRKSRC}/contrib/torctl.in
@${FIND} ${WRKSRC} -type f | ${XARGS} \
-n 10 ${REINPLACE_CMD} -E \
-e 's!-g -O2!!' \
-e 's!-O2!!'
pre-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/contrib/tor.sh ${PREFIX}/etc/rc.d/tor.sh
${INSTALL_SCRIPT} ${WRKSRC}/contrib/torctl ${PREFIX}/bin/torctl
@${MKDIR} /var/run/tor
@${CHOWN} _tor:_tor /var/run/tor
@${TOUCH} /var/log/tor
@ -54,4 +53,5 @@ post-install:
@${MKDIR} /var/db/tor/data
@${CHOWN} -R _tor:_tor /var/db/tor
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View file

@ -1,3 +1,3 @@
MD5 (tor-0.1.1.12-alpha.tar.gz) = 64439b11f18462bc0a9599940899240e
SHA256 (tor-0.1.1.12-alpha.tar.gz) = 125bfd5b3f6979ee02dca0fa8372f80bbf6e4907a569e890105fe3405dc03a95
SIZE (tor-0.1.1.12-alpha.tar.gz) = 751711
MD5 (tor-0.1.1.13-alpha.tar.gz) = 5cdf6c5ed20efd7048ee1257cbcc1b4e
SHA256 (tor-0.1.1.13-alpha.tar.gz) = cb15a83ed8ad87d67c0685b20a41096c32211f20ae321f39ed110d7ace38e29f
SIZE (tor-0.1.1.13-alpha.tar.gz) = 756583

View file

@ -1,85 +0,0 @@
--- contrib/tor.sh.in.orig Mon Dec 26 04:28:12 2005
+++ contrib/tor.sh.in Thu Jan 12 06:25:02 2006
@@ -9,26 +9,26 @@
# This particular script is written for Red Hat/Fedora Linux, and may
# also work on Mandrake, but not SuSE.
#
-# These next couple of lines "declare" tor for the "chkconfig" program,
-# originally from SGI, used on Red Hat/Fedora and probably elsewhere.
-#
-# chkconfig: 2345 90 10
# description: Onion Router - A low-latency anonymous proxy
#
+#
+# Add some of the following variables to /etc/rc.conf to configure stunnel:
+# tor_enable (bool): Default "NO"
+# Set it to "YES" to enable stunnel.
+# tor_user (str): Default "_tor"
+# Set it to the tor user
+# tor_group (str): Default "_tor"
+# Set it to the tor group
+#
-# Library functions
-if [ -f /etc/rc.d/init.d/functions ]; then
- . /etc/rc.d/init.d/functions
-elif [ -f /etc/init.d/functions ]; then
- . /etc/init.d/functions
-fi
+tor_enable=${tor_enable-"NO"}
-TORCTL=@BINDIR@/torctl
+TORCTL=%%PREFIX%%/bin/torctl
# torctl will use these environment variables
-TORUSER=@TORUSER@
+TORUSER=${tor_user-"_tor"}
export TORUSER
-TORGROUP=@TORGROUP@
+TORGROUP=${tor_group-"_tor"}
export TORGROUP
if [ -x /bin/su ] ; then
@@ -46,28 +46,32 @@
case "$1" in
start)
- action $"Starting tor:" $TORCTL start
- RETVAL=$?
+ echo "Starting tor:"
+ $TORCTL start
+ RETVAL=$?
;;
stop)
- action $"Stopping tor:" $TORCTL stop
- RETVAL=$?
+ echo "Stopping tor:"
+ $TORCTL stop
+ RETVAL=$?
;;
restart)
- action $"Restarting tor:" $TORCTL restart
- RETVAL=$?
+ echo "Restarting tor:"
+ $TORCTL restart
+ RETVAL=$?
;;
reload)
- action $"Reloading tor:" $TORCTL reload
- RETVAL=$?
+ echo "Reloading tor:"
+ $TORCTL reload
+ RETVAL=$?
;;
status)
- $TORCTL status
- RETVAL=$?
+ $TORCTL status
+ RETVAL=$?
;;
*)

View file

@ -1,39 +0,0 @@
--- contrib/torctl.in.orig Mon Dec 26 04:28:12 2005
+++ contrib/torctl.in Fri Jan 13 09:12:42 2006
@@ -24,20 +24,20 @@
EXEC=tor
#
# the path to your binary, including options if necessary
-TORBIN="@BINDIR@/$EXEC"
+TORBIN="/usr/local/bin/$EXEC"
#
# the path to the configuration file
-TORCONF="@CONFDIR@/torrc"
+TORCONF="/usr/local/etc/tor/torrc"
#
# the path to your PID file
-PIDFILE="@LOCALSTATEDIR@/run/tor/tor.pid"
+PIDFILE="/var/run/tor/tor.pid"
#
# The path to the log file
-LOGFILE="@LOCALSTATEDIR@/log/tor/tor.log"
+LOGFILE="/var/log/tor"
#
# The path to the datadirectory
-TORDATA="@LOCALSTATEDIR@/lib/tor"
#
+TORDATA="/var/db/tor/data"
TORARGS="--pidfile $PIDFILE --log \"notice file $LOGFILE\" --runasdaemon 1"
TORARGS="$TORARGS --datadirectory $TORDATA"
@@ -47,8 +47,8 @@
# let an unprivileged user run tor for her own use using this script,
# while still providing for it to be used as a system daemon.
if [ "x`id -u`" = "x0" ]; then
- TORUSER=@TORUSER@
- TORGROUP=@TORGROUP@
+ TORUSER="_tor"
+ TORGROUP="_tor"
fi
if [ "x$TORUSER" != "x" ]; then

View file

@ -0,0 +1,6 @@
=====================================================================================
To enable the tor server, set tor_enable="YES" in your /etc/rc.conf
and edit %%PREFIX%%/etc/tor/torrc
=====================================================================================

View file

@ -0,0 +1,45 @@
#!/bin/sh
#
# $FreeBSD$
#
# REQUIRE: NETWORKING SERVERS USR
# BEFORE: LOGIN
#
# Add the following lines to /etc/rc.conf to enable tor
#
# tor_enable (bool): Set to "NO" by default
# Set it to "YES" to enable tor
# tor_conf (str): Points to your tor conf file
# Default: %%PREFIX%%/etc/tor/torrc
# tor_user (str): Tor Daemon user. Default _tor
# tor_groupr (str): Tor Daemon group. Default _tor
#
. %%RC_SUBR%%
name="tor"
rcvar=${name}_enable
load_rc_config ${name}
: ${tor_enable="NO"}
: ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
: ${tor_user="_tor"}
: ${tor_group="_tor"}
: ${tor_pidfile="/var/run/tor/tor.pid"}
: ${tor_logfile="/var/log/tor"}
: ${tor_datadir="/var/run/tor"}
required_files=${tor_conf}
required_dirs=${tor_datadir}
command="%%PREFIX%%/bin/${name}"
command_args="-f ${tor_conf} --pidfile ${tor_pidfile} --runasdaemon 1 --datadirectory ${tor_datadir} --user ${tor_user} --group ${tor_group}"
extra_commands="log"
log_cmd="${name}_log"
tor_log() {
cat ${tor_logfile}
}
run_rc_command "$1"

View file

@ -0,0 +1,62 @@
#! /bin/sh
#
# taken from net/cvsup-mirror
PATH=/bin:/usr/sbin
TOR_USER=${TOR_USER:-_tor}
TOR_GROUP=${TOR_GROUP:-_tor}
ask() {
local question default answer
question=$1
default=$2
if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
read -p "${question} [${default}]? " answer
fi
if [ x${answer} = x ]; then
answer=${default}
fi
echo ${answer}
}
yesno() {
local dflt question answer
question=$1
dflt=$2
while :; do
answer=$(ask "${question}" "${dflt}")
case "${answer}" in
[Yy]*) return 0;;
[Nn]*) return 1;;
esac
echo "Please answer yes or no."
done
}
delete_account() {
local u g home
u=$1
g=$2
if yesno "Do you want me to remove group \"${g}\"" y; then
pw groupdel -n ${g}
echo "Done."
fi
if yesno "Do you want me to remove user \"${u}\"" y; then
eval home=~${u}
pw userdel -n ${u}
echo "Done."
if [ -d "${home}" ]; then
echo "Please remember to remove the home directory \"${home}\""
fi
fi
}
if [ x$2 != xDEINSTALL ]; then
exit
fi
delete_account ${TOR_USER} ${TOR_GROUP}

View file

@ -14,5 +14,3 @@ Remember that this is development code -- DON'T RELY ON THE CURRENT TOR
NETWORK FOR ANONYMITY!
WWW: http://tor.eff.org/
- rik
freebsd-ports@rikrose.net

View file

@ -1,35 +1,40 @@
#!/bin/sh
#! /bin/sh
#
# taken from devel/perforce
if [ x"$2" = xPRE-INSTALL ]; then
USER="_tor"
UID="256"
GROUP="_tor"
GID="256"
PATH=/bin:/usr/sbin
if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
echo "You already have a group \"${GROUP}\", so I will use it."
else
if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
echo "Please create it, and try again."
exit 1
fi
fi
TOR_USER=${TOR_USER:-_tor}
TOR_GROUP=${TOR_GROUP:-_tor}
if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-d /var/db/tor \
-s /bin/sh \
-c "Tor anonymising router"; then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
echo "Please create it, and try again."
exit 1
fi
fi
fi
case $2 in
PRE-INSTALL)
USER=${TOR_USER}
GROUP=${TOR_GROUP}
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} ; 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} -g ${GROUP} -h - \
-d /nonexistent -c "Tor Daemon" -s /bin/sh
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
esac

View file

@ -1,7 +0,0 @@
*********************** WARNING! WARNING! WARNING! ***********************
The tor startup script has been converted to rc_subr format now. You
have to set at least the tor_enable variable if you want tor to be started
automatically at boot time!
**************************************************************************

View file

@ -1,8 +1,6 @@
bin/tor
bin/tor-resolve
bin/torctl
bin/torify
etc/rc.d/tor.sh
etc/tor/tor-tsocks.conf.sample
etc/tor/torrc.sample
@dirrm etc/tor