diff options
author | Brendan Fabeny <bf@FreeBSD.org> | 2011-05-08 04:34:15 +0000 |
---|---|---|
committer | Brendan Fabeny <bf@FreeBSD.org> | 2011-05-08 04:34:15 +0000 |
commit | 80405781b73394bb89ffef55a62d0fc8fe03db0c (patch) | |
tree | 74689cd2fb3e3234b46cc06b780d9345a3288574 /security/tor | |
parent | 2b2c26a220b9f27f6a32f7d860c697cd5fa280db (diff) | |
download | ports-80405781b73394bb89ffef55a62d0fc8fe03db0c.tar.gz ports-80405781b73394bb89ffef55a62d0fc8fe03db0c.zip |
Notes
Diffstat (limited to 'security/tor')
-rw-r--r-- | security/tor/Makefile | 12 | ||||
-rw-r--r-- | security/tor/pkg-deinstall | 62 | ||||
-rw-r--r-- | security/tor/pkg-install | 42 |
3 files changed, 6 insertions, 110 deletions
diff --git a/security/tor/Makefile b/security/tor/Makefile index 86ac848bdb04..d8608c1402f0 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -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 diff --git a/security/tor/pkg-deinstall b/security/tor/pkg-deinstall deleted file mode 100644 index dc7222645375..000000000000 --- a/security/tor/pkg-deinstall +++ /dev/null @@ -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} diff --git a/security/tor/pkg-install b/security/tor/pkg-install deleted file mode 100644 index 8f81c408d6ed..000000000000 --- a/security/tor/pkg-install +++ /dev/null @@ -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 |