diff options
author | Jeremy Messenger <mezz@FreeBSD.org> | 2009-06-19 17:07:26 +0000 |
---|---|---|
committer | Jeremy Messenger <mezz@FreeBSD.org> | 2009-06-19 17:07:26 +0000 |
commit | e8abbcb56fe3f4500c1d3876360673ad01d9bd61 (patch) | |
tree | d3673230cc7d3924c2b09a7762b8764c7de390bf /net-p2p/transmission-daemon | |
parent | 4c2370533a371cfbd77306465a697d2cd7e53029 (diff) | |
download | ports-e8abbcb56fe3f4500c1d3876360673ad01d9bd61.tar.gz ports-e8abbcb56fe3f4500c1d3876360673ad01d9bd61.zip |
Notes
Diffstat (limited to 'net-p2p/transmission-daemon')
-rw-r--r-- | net-p2p/transmission-daemon/Makefile | 18 | ||||
-rw-r--r-- | net-p2p/transmission-daemon/pkg-install | 46 | ||||
-rw-r--r-- | net-p2p/transmission-daemon/pkg-plist | 3 |
3 files changed, 66 insertions, 1 deletions
diff --git a/net-p2p/transmission-daemon/Makefile b/net-p2p/transmission-daemon/Makefile index bf96203f3139..028cdb46ed5c 100644 --- a/net-p2p/transmission-daemon/Makefile +++ b/net-p2p/transmission-daemon/Makefile @@ -5,7 +5,7 @@ # $FreeBSD$ # -PORTREVISION= 1 +PORTREVISION= 0 PKGNAMESUFFIX= -daemon MAINTAINER= mezz@FreeBSD.org @@ -14,8 +14,24 @@ COMMENT= A fast and lightweight daemon BitTorrent client DESCR= ${.CURDIR}/pkg-descr MASTERDIR= ${.CURDIR}/../transmission-cli PLIST= ${.CURDIR}/pkg-plist +PKGINSTALL= ${.CURDIR}/pkg-install SLAVEPORT= daemon +USE_RC_SUBR= transmission + +EXTRA_CONF_ARGS=--disable-cli \ + --enable-daemon \ + --disable-gtk \ + --disable-libnotify \ + --disable-mac \ + --disable-nls + MAN1= transmission-daemon.1 transmission-remote.1 +post-install: general-install +.if !defined(PACKAGE_BUILDING) + @${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +.endif + .include "${MASTERDIR}/Makefile" diff --git a/net-p2p/transmission-daemon/pkg-install b/net-p2p/transmission-daemon/pkg-install new file mode 100644 index 000000000000..310e1cc32f47 --- /dev/null +++ b/net-p2p/transmission-daemon/pkg-install @@ -0,0 +1,46 @@ +#!/bin/sh + +case $2 in +POST-INSTALL) + USER=transmission + GROUP=${USER} + UID=919 + GID=${UID} + PW=/usr/sbin/pw + CHMOD=/bin/chmod + CHOWN=/usr/sbin/chown + MKDIR=/bin/mkdir + THOME=${PKG_PREFIX}/etc/${USER}/home + + 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 "${THOME}" -s /usr/sbin/nologin -c "Transmission Daemon User" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + + ${MKDIR} -p ${THOME}/Downloads + ${CHOWN} root:${GROUP} ${THOME} + ${CHOWN} ${USER}:${GROUP} ${THOME}/Downloads + ${CHMOD} 1770 ${THOME} + + exit 0 + ;; +esac diff --git a/net-p2p/transmission-daemon/pkg-plist b/net-p2p/transmission-daemon/pkg-plist index 88b8d022681f..e7cb3d4f583f 100644 --- a/net-p2p/transmission-daemon/pkg-plist +++ b/net-p2p/transmission-daemon/pkg-plist @@ -5,3 +5,6 @@ bin/transmission-remote %%PORTDOCS%%%%DOCSDIR%%/NEWS %%PORTDOCS%%%%DOCSDIR%%/README %%PORTDOCS%%@dirrm %%DOCSDIR%% +@dirrmtry etc/transmission/home/Downloads +@dirrmtry etc/transmission/home +@dirrmtry etc/transmission |