- update tor-devel to 0.2.3.1-alpha

- remove [de]install scripts from both
tor ports in favor of GROUPS/USERS
- fix mistakes in the _tor uid entry
introduced in the GROUPS/USERS changes
This commit is contained in:
Brendan Fabeny 2011-05-08 04:34:15 +00:00
parent 2b2c26a220
commit 80405781b7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273760
8 changed files with 38 additions and 228 deletions

2
UIDs
View file

@ -110,7 +110,7 @@ tnc:*:241:241::0:0:aprsd:/nonexistent:/bin/sh
prosody:*:242:242::0:0:Prosody Jabber Server:/nonexistent:/usr/sbin/nologin
fcron:*:247:247::0:0:fcron pseudo-user:/nonexistent:/usr/sbin/nologin
_adsuck:*:253:253::0:0:Adsuck ad blocking user:/nonexistent:/usr/sbin/nologin
_tor:*:256:256::0:0:Tor anonymising router:/var/db/tor:/bin/sh
_tor:*:256:256::0:0:Tor anonymizing router:/var/db/tor:/usr/sbin/nologin
meta1s:*:260:260::0:0:MeTA1 SMTPS:/nonexistent:/usr/sbin/nologin
meta1q:*:261:261::0:0:MeTA1 QMGR:/nonexistent:/usr/sbin/nologin
meta1c:*:262:262::0:0:MeTA1 SMTPC:/nonexistent:/usr/sbin/nologin

View file

@ -6,8 +6,7 @@
#
PORTNAME= tor
DISTVERSION= 0.2.2.25-alpha
PORTREVISION= 1
DISTVERSION= 0.2.3.1-alpha
CATEGORIES= security net ipv6
MASTER_SITES= http://www.torproject.org/dist/ \
ftp://ftp.bit.nl/mirror/tor/ \
@ -33,8 +32,6 @@ PKGNAMESUFFIX= -devel
MAINTAINER= bf@FreeBSD.org
COMMENT= An anonymizing overlay network for TCP
LIB_DEPENDS= event-2.0:${PORTSDIR}/devel/libevent2
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --with-openssl-dir="${OPENSSLBASE}" --disable-asciidoc
CPPFLAGS+= -I${LOCALBASE}/include/event2
@ -43,8 +40,10 @@ CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}"
MAKE_JOBS_UNSAFE= yes
OPTIONS= BUFFREELISTS "freelists for buffer RAM" on \
OPTIONS= BUFFEREVENTS "use libevent's buffered IO" on \
BUFFREELISTS "freelists for buffer RAM" on \
INSTR_DOWNLOADS "instrument downloads for analysis" off \
STATIC_TOR "build a static tor" off \
TCMALLOC "use the tcmalloc memory allocation library" off \
THREADS "multi-threading support" on \
TRANSPARENT "transparent proxy support" on
@ -52,6 +51,9 @@ OPTIONS= BUFFREELISTS "freelists for buffer RAM" on \
USE_RC_SUBR= tor
SUB_FILES= pkg-message
GROUPS = _tor
USERS= _tor
CONFLICTS= tor-[0-9]*
CONFLICTS_BUILD= libevent-[01]*
@ -70,6 +72,12 @@ WITH_OPENSSL_PORT= yes
.endif
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
.if defined(WITH_BUFFEREVENTS)
CONFIGURE_ARGS+= --enable-bufferevents
.else
CONFIGURE_ARGS+= --disable-bufferevents
.endif
.if defined(WITH_BUFFREELISTS)
CONFIGURE_ARGS+= --enable-buf-freelists
.else
@ -82,10 +90,23 @@ CONFIGURE_ARGS+= --enable-instrument-downloads
CONFIGURE_ARGS+= --disable-instrument-downloads
.endif
.if defined(WITH_STATIC_TOR)
BUILD_DEPENDS += ${LOCALBASE}/lib/event2/libevent.a:${PORTSDIR}/devel/libevent2
CONFIGURE_ARGS+= --enable-static-tor --with-libevent-dir=${LOCALBASE}/lib/event2 \
--with-zlib-dir=/usr/lib
.else
CONFIGURE_ARGS+= --enable-linker-hardening
LIB_DEPENDS+= event-2.0:${PORTSDIR}/devel/libevent2
.endif
.if defined(WITH_TCMALLOC)
CONFIGURE_ARGS+= --with-tcmalloc
.if defined(WITH_STATIC_TOR)
BUILD_DEPENDS += ${LOCALBASE}/lib/libtcmalloc.so:${PORTSDIR}/devel/google-perftools
.else
LIB_DEPENDS+= tcmalloc:${PORTSDIR}/devel/google-perftools
.endif
.endif
.if defined(WITH_THREADS)
CONFIGURE_ARGS+= --enable-threads
@ -114,17 +135,14 @@ post-configure:
@${REINPLACE_CMD} -e '\|^nodist_man_MANS =|s|$$|${MAN1}|' \
${WRKSRC}/doc/Makefile
pre-su-install:
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
${MKDIR} /var/run/tor
${CHOWN} _tor:_tor /var/run/tor
${CHOWN} -R _tor:_tor /var/run/tor
${TOUCH} /var/log/tor
${CHOWN} _tor:_tor /var/log/tor
${MKDIR} /var/db/tor/data
${CHOWN} _tor:_tor /var/db/tor
${CHOWN} -R _tor:_tor /var/db/tor
${CHMOD} -R 700 /var/db/tor
${CAT} ${PKGMESSAGE}
check regression-test test: build

View file

@ -1,2 +1,2 @@
SHA256 (tor-0.2.2.25-alpha.tar.gz) = e09f46ff5e126f1dae60634d59014ebeac98a98cf903fe2d8128badc2ae412b0
SIZE (tor-0.2.2.25-alpha.tar.gz) = 2627109
SHA256 (tor-0.2.3.1-alpha.tar.gz) = 8906e80068952a4d3d9f65dfea2f4b0fd76b6b301fd1e62adac6c1b3bebe360e
SIZE (tor-0.2.3.1-alpha.tar.gz) = 2686119

View file

@ -1,62 +0,0 @@
#! /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

@ -1,42 +0,0 @@
#! /bin/sh
#
# taken from devel/perforce
PATH=/bin:/usr/sbin
TOR_USER=${TOR_USER:-_tor}
TOR_GROUP=${TOR_GROUP:-_tor}
case $2 in
PRE-INSTALL)
USER=${TOR_USER}
UID="256"
GROUP=${TOR_GROUP}
GID="256"
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/db/tor -c "Tor Daemon" -s /sbin/nologin
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
esac

View file

@ -46,6 +46,9 @@ OPTIONS= BUFFREELISTS "freelists for buffer RAM" on \
USE_RC_SUBR= tor
SUB_FILES= pkg-message
GROUPS = _tor
USERS= _tor
CONFLICTS= tor-devel-[0-9]*
MANCOMPRESSED= no
@ -111,17 +114,14 @@ post-configure:
@${FIND} -X ${WRKSRC} -type f -name Makefile | ${XARGS} ${REINPLACE_CMD} -e \
"s|-lpthread|${PTHREAD_LIBS}|g"
pre-su-install:
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
${MKDIR} /var/run/tor
${CHOWN} _tor:_tor /var/run/tor
${CHOWN} -R _tor:_tor /var/run/tor
${TOUCH} /var/log/tor
${CHOWN} _tor:_tor /var/log/tor
${MKDIR} /var/db/tor/data
${CHOWN} _tor:_tor /var/db/tor
${CHOWN} -R _tor:_tor /var/db/tor
${CHMOD} -R 700 /var/db/tor
${CAT} ${PKGMESSAGE}
check regression-test test: build

View file

@ -1,62 +0,0 @@
#! /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

@ -1,42 +0,0 @@
#! /bin/sh
#
# taken from devel/perforce
PATH=/bin:/usr/sbin
TOR_USER=${TOR_USER:-_tor}
TOR_GROUP=${TOR_GROUP:-_tor}
case $2 in
PRE-INSTALL)
USER=${TOR_USER}
UID="256"
GROUP=${TOR_GROUP}
GID="256"
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/db/tor -c "Tor Daemon" -s /sbin/nologin
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
esac