diff options
-rw-r--r-- | net-p2p/i2p/Makefile | 10 | ||||
-rw-r--r-- | net-p2p/i2p/distinfo | 4 | ||||
-rw-r--r-- | net-p2p/i2p/files/i2p.sh | 89 | ||||
-rw-r--r-- | net/i2p/Makefile | 10 | ||||
-rw-r--r-- | net/i2p/distinfo | 4 | ||||
-rw-r--r-- | net/i2p/files/i2p.sh | 89 |
6 files changed, 200 insertions, 6 deletions
diff --git a/net-p2p/i2p/Makefile b/net-p2p/i2p/Makefile index 9e7c151b7108..763ba13a4d06 100644 --- a/net-p2p/i2p/Makefile +++ b/net-p2p/i2p/Makefile @@ -6,7 +6,7 @@ # PORTNAME= i2p -PORTVERSION= 0.6.1.1 +PORTVERSION= 0.6.1.2 CATEGORIES= net java security MASTER_SITES= http://dev.i2p.net/i2p/ @@ -16,6 +16,7 @@ COMMENT= An anonymous network RUN_DEPENDS= unzip:${PORTSDIR}/archivers/unzip USE_BZIP2= yes +USE_RC_SUBR= yes USE_REINPLACE= yes USE_JAVA= yes @@ -61,6 +62,7 @@ PORTDOCS= ${DOC_FILES} \ PLIST_DIRS= \ %%DATADIR%% PLIST_FILES= \ + etc/rc.d/${PORTNAME}.sh \ sbin/i2prouter \ %%DATADIR%%/i2p.tar.bz2 \ %%DATADIR%%/i2pupdate.zip @@ -73,6 +75,9 @@ post-patch: @${REINPLACE_CMD} -E \ -e 's|./i2prouter[[:space:]]+start||' \ ${WRKSRC}/installer/resources/postinstall.sh +# rc.d + @${SED} -e "s|%%PREFIX%%|${PREFIX}|" \ + ${FILESDIR}/${PORTNAME}.sh > ${WRKDIR}/${PORTNAME}.sh do-install: @${MKDIR} ${DATADIR} @@ -82,6 +87,9 @@ do-install: # update @${INSTALL_DATA} ${WRKSRC}/i2pupdate.zip \ ${DATADIR}/ +# rc.d + @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh \ + ${PREFIX}/etc/rc.d # wrapper @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \ ${PREFIX}/sbin/i2prouter diff --git a/net-p2p/i2p/distinfo b/net-p2p/i2p/distinfo index 205af6327f27..94cde71cc534 100644 --- a/net-p2p/i2p/distinfo +++ b/net-p2p/i2p/distinfo @@ -1,2 +1,2 @@ -MD5 (i2p-0.6.1.1.tar.bz2) = cb0a9d178159ae541454dc6b7a9542c0 -SIZE (i2p-0.6.1.1.tar.bz2) = 8761679 +MD5 (i2p-0.6.1.2.tar.bz2) = d151c7ee8ad5397a3bc052da456182e6 +SIZE (i2p-0.6.1.2.tar.bz2) = 8807287 diff --git a/net-p2p/i2p/files/i2p.sh b/net-p2p/i2p/files/i2p.sh new file mode 100644 index 000000000000..dd7fa52f64c3 --- /dev/null +++ b/net-p2p/i2p/files/i2p.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org> + +# PROVIDE: i2p +# REQUIRE: NETWORKING +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable i2p: +# +#i2p_enable="YES" +#i2p_user="" +# + +. /etc/rc.subr + +name="i2p" +rcvar=`set_rcvar` +command="%%PREFIX%%/sbin/i2prouter" +extra_commands="install uninstall update" + +i2p_check_vars() +{ + if [ -z "${i2p_user}" ]; then + i2p_user=$(whoami) + fi + + if [ "x${i2p_user}" = "xroot" ]; then + err 1 "You have to set i2p_user to a non-root user for security reasons" + fi +} + +start_cmd="start_cmd" +stop_cmd="stop_cmd" +status_cmd="status_cmd" +restart_cmd="restart_cmd" +install_cmd="install_cmd" +uninstall_cmd="uninstall_cmd" +update_cmd="update_cmd" + +generic_cmd() +{ + i2p_check_vars + su -l ${i2p_user} -c "${command} ${1}" +} + +start_cmd() +{ + generic_cmd start +} + +stop_cmd() +{ + generic_cmd stop +} + +status_cmd() +{ + generic_cmd status +} + +restart_cmd() +{ + generic_cmd restart +} + +install_cmd() +{ + generic_cmd install +} + +uninstall_cmd() +{ + generic_cmd uninstall +} + +update_cmd() +{ + generic_cmd update +} + +load_rc_config "${name}" +: ${i2p_enable="NO"} +: ${i2p_user=""} + +run_rc_command "$1" diff --git a/net/i2p/Makefile b/net/i2p/Makefile index 9e7c151b7108..763ba13a4d06 100644 --- a/net/i2p/Makefile +++ b/net/i2p/Makefile @@ -6,7 +6,7 @@ # PORTNAME= i2p -PORTVERSION= 0.6.1.1 +PORTVERSION= 0.6.1.2 CATEGORIES= net java security MASTER_SITES= http://dev.i2p.net/i2p/ @@ -16,6 +16,7 @@ COMMENT= An anonymous network RUN_DEPENDS= unzip:${PORTSDIR}/archivers/unzip USE_BZIP2= yes +USE_RC_SUBR= yes USE_REINPLACE= yes USE_JAVA= yes @@ -61,6 +62,7 @@ PORTDOCS= ${DOC_FILES} \ PLIST_DIRS= \ %%DATADIR%% PLIST_FILES= \ + etc/rc.d/${PORTNAME}.sh \ sbin/i2prouter \ %%DATADIR%%/i2p.tar.bz2 \ %%DATADIR%%/i2pupdate.zip @@ -73,6 +75,9 @@ post-patch: @${REINPLACE_CMD} -E \ -e 's|./i2prouter[[:space:]]+start||' \ ${WRKSRC}/installer/resources/postinstall.sh +# rc.d + @${SED} -e "s|%%PREFIX%%|${PREFIX}|" \ + ${FILESDIR}/${PORTNAME}.sh > ${WRKDIR}/${PORTNAME}.sh do-install: @${MKDIR} ${DATADIR} @@ -82,6 +87,9 @@ do-install: # update @${INSTALL_DATA} ${WRKSRC}/i2pupdate.zip \ ${DATADIR}/ +# rc.d + @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh \ + ${PREFIX}/etc/rc.d # wrapper @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \ ${PREFIX}/sbin/i2prouter diff --git a/net/i2p/distinfo b/net/i2p/distinfo index 205af6327f27..94cde71cc534 100644 --- a/net/i2p/distinfo +++ b/net/i2p/distinfo @@ -1,2 +1,2 @@ -MD5 (i2p-0.6.1.1.tar.bz2) = cb0a9d178159ae541454dc6b7a9542c0 -SIZE (i2p-0.6.1.1.tar.bz2) = 8761679 +MD5 (i2p-0.6.1.2.tar.bz2) = d151c7ee8ad5397a3bc052da456182e6 +SIZE (i2p-0.6.1.2.tar.bz2) = 8807287 diff --git a/net/i2p/files/i2p.sh b/net/i2p/files/i2p.sh new file mode 100644 index 000000000000..dd7fa52f64c3 --- /dev/null +++ b/net/i2p/files/i2p.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org> + +# PROVIDE: i2p +# REQUIRE: NETWORKING +# KEYWORD: FreeBSD shutdown + +# +# Add the following lines to /etc/rc.conf to enable i2p: +# +#i2p_enable="YES" +#i2p_user="" +# + +. /etc/rc.subr + +name="i2p" +rcvar=`set_rcvar` +command="%%PREFIX%%/sbin/i2prouter" +extra_commands="install uninstall update" + +i2p_check_vars() +{ + if [ -z "${i2p_user}" ]; then + i2p_user=$(whoami) + fi + + if [ "x${i2p_user}" = "xroot" ]; then + err 1 "You have to set i2p_user to a non-root user for security reasons" + fi +} + +start_cmd="start_cmd" +stop_cmd="stop_cmd" +status_cmd="status_cmd" +restart_cmd="restart_cmd" +install_cmd="install_cmd" +uninstall_cmd="uninstall_cmd" +update_cmd="update_cmd" + +generic_cmd() +{ + i2p_check_vars + su -l ${i2p_user} -c "${command} ${1}" +} + +start_cmd() +{ + generic_cmd start +} + +stop_cmd() +{ + generic_cmd stop +} + +status_cmd() +{ + generic_cmd status +} + +restart_cmd() +{ + generic_cmd restart +} + +install_cmd() +{ + generic_cmd install +} + +uninstall_cmd() +{ + generic_cmd uninstall +} + +update_cmd() +{ + generic_cmd update +} + +load_rc_config "${name}" +: ${i2p_enable="NO"} +: ${i2p_user=""} + +run_rc_command "$1" |