aboutsummaryrefslogtreecommitdiff
path: root/security/i2p
diff options
context:
space:
mode:
authorMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2014-03-08 00:00:11 +0000
committerMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2014-03-08 00:00:11 +0000
commitb2ca7ee8a884a6135f5a739f6e3d7a5794747e05 (patch)
tree48e8fd4071804e892a55351ff5ab30290cf3a339 /security/i2p
parentb208c35c0d3f7d30a5ccace2d1e46cab7c9b5cf3 (diff)
downloadports-b2ca7ee8a884a6135f5a739f6e3d7a5794747e05.tar.gz
ports-b2ca7ee8a884a6135f5a739f6e3d7a5794747e05.zip
- Change net-p2p/i2p primary category to security. Therefore, move
net-p2p/i2p to security/i2p. Following security/tor example. Keep net-p2p as secondary category since i2p provides p2p services. - Update security/i2p to 0.9.11 Approved by: bdrewery (mentor)
Notes
Notes: svn path=/head/; revision=347431
Diffstat (limited to 'security/i2p')
-rw-r--r--security/i2p/Makefile105
-rw-r--r--security/i2p/distinfo2
-rw-r--r--security/i2p/files/i2p.in88
-rw-r--r--security/i2p/files/patch-installer__resources__clients.config11
-rw-r--r--security/i2p/files/patch-installer__resources__postinstall.sh11
-rw-r--r--security/i2p/files/wrapper.sh.in71
-rw-r--r--security/i2p/pkg-descr16
7 files changed, 304 insertions, 0 deletions
diff --git a/security/i2p/Makefile b/security/i2p/Makefile
new file mode 100644
index 000000000000..3d0ae2deb435
--- /dev/null
+++ b/security/i2p/Makefile
@@ -0,0 +1,105 @@
+# Created by: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME= i2p
+PORTVERSION= 0.9.11
+CATEGORIES= security java net-p2p
+MASTER_SITES= http://download.i2p2.no/releases/${PORTVERSION}/ \
+ http://download2.geti2p.com/${PORTVERSION}/ \
+ http://download.geti2p.com/${PORTVERSION}/ \
+ http://download.i2p2.de/releases/${PORTVERSION}/ \
+ https://dl.dropboxusercontent.com/u/18621288/I2P/${PORTVERSION}/ \
+ https://launchpad.net/i2p/trunk/${PORTVERSION}/+download/ \
+ https://googledrive.com/host/0B4jHEq5G7_EPWV9UeERwdGplZXc/${PORTVERSION}/
+DISTFILES= i2psource_${PORTVERSION}${EXTRACT_SUFX}
+
+MAINTAINER= ports@FreeBSD.org
+COMMENT= An anonymizing network
+
+LICENSE= EULA
+LICENSE_NAME= End User License Agreement
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+LICENSE_DISTFILES= i2psource_${PORTVERSION}${EXTRACT_SUFX}
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/libgmp.a:${PORTSDIR}/math/gmp
+RUN_DEPENDS= unzip:${PORTSDIR}/archivers/unzip
+
+ONLY_FOR_ARCHS= i386 amd64
+ONLY_FOR_ARCHS_REASON= i2p libwrapper.so library binary only available for i386 and amd64
+
+OPTIONS_DEFINE= DOCS
+
+USES= gettext iconv
+USE_BZIP2= yes
+USE_RC_SUBR= i2p
+
+USE_ANT= yes
+USE_JAVA= yes
+JAVA_BUILD= jdk
+JAVA_VERSION= 1.6+
+
+ALL_TARGET= \
+ updater \
+ tarball
+
+PORTDATA= *
+
+PLIST_FILES= \
+ sbin/i2prouter
+
+SUB_FILES= wrapper.sh
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
+ALL_TARGET+= javadoc
+
+PORTDOCS= *
+
+JAVADOC_WRKSRC= ${WRKSRC}/build/javadoc
+.endif
+
+.include <bsd.port.pre.mk>
+
+# Only works with converters/iconv port due to binary dependency:
+# source code isn't available at this moment
+.if ${OSVERSION} >= 1000043
+IGNORE= libwrapper.so binary depends on converters/iconv port.\
+ Therefore, it's not compatible with FreeBSD 10.x and above. Check\
+ entry 20130904 on ${PORTSDIR}/UPDATING
+.endif
+
+post-patch:
+# postinstall.sh SHOULD only do post installation house keeping
+ @${REINPLACE_CMD} -E \
+ -e 's|./i2prouter[[:space:]]+start||' \
+ ${WRKSRC}/installer/resources/postinstall.sh
+ @${REINPLACE_CMD} -E \
+ -e 's|%INSTALL_PATH|$${HOME}/i2p|' \
+ -e 's|%USER_HOME|$${HOME}|' \
+ ${WRKSRC}/installer/resources/i2prouter \
+ ${WRKSRC}/installer/resources/runplain.sh
+
+do-install:
+ @${MKDIR} ${STAGEDIR}${DATADIR}
+# install
+ @${INSTALL_DATA} ${WRKSRC}/i2p.tar.bz2 \
+ ${STAGEDIR}${DATADIR}/
+# update
+ @${INSTALL_DATA} ${WRKSRC}/i2pupdate.zip \
+ ${STAGEDIR}${DATADIR}/
+# wrapper
+ @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh \
+ ${STAGEDIR}${PREFIX}/sbin/i2prouter
+# doc
+.if ${PORT_OPTIONS:MDOCS}
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ @${INSTALL_DATA} ${WRKSRC}/installer/resources/readme/readme*.html ${STAGEDIR}${DOCSDIR}
+# line taken from textproc/xerces-j maintained by hq@FreeBSD.org
+ @cd ${JAVADOC_WRKSRC} && \
+ ${FIND} * -type d -exec ${MKDIR} "${STAGEDIR}${DOCSDIR}/{}" \; && \
+ ${FIND} * -not -type d -exec ${INSTALL_DATA} "{}" "${STAGEDIR}${DOCSDIR}/{}" \;
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/security/i2p/distinfo b/security/i2p/distinfo
new file mode 100644
index 000000000000..c17fd38a89cb
--- /dev/null
+++ b/security/i2p/distinfo
@@ -0,0 +1,2 @@
+SHA256 (i2psource_0.9.11.tar.bz2) = 50b18c6e012cae1f05295b54ec88ab71c56b8ebf8b9267242bab37f918b80166
+SIZE (i2psource_0.9.11.tar.bz2) = 22618918
diff --git a/security/i2p/files/i2p.in b/security/i2p/files/i2p.in
new file mode 100644
index 000000000000..ffc192912fe7
--- /dev/null
+++ b/security/i2p/files/i2p.in
@@ -0,0 +1,88 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org>
+
+# PROVIDE: i2p
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable i2p:
+#
+# i2p_enable="YES"
+# i2p_user
+
+. /etc/rc.subr
+
+name="i2p"
+rcvar=i2p_enable
+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/security/i2p/files/patch-installer__resources__clients.config b/security/i2p/files/patch-installer__resources__clients.config
new file mode 100644
index 000000000000..8f9b7b6ecbb3
--- /dev/null
+++ b/security/i2p/files/patch-installer__resources__clients.config
@@ -0,0 +1,11 @@
+--- installer/resources/clients.config.orig 2014-02-13 23:18:57.000000000 -0200
++++ installer/resources/clients.config 2014-02-13 23:19:16.000000000 -0200
+@@ -57,7 +57,7 @@
+ clientApp.4.name=Open Router Console in web browser at startup
+ clientApp.4.args=http://127.0.0.1:7657/
+ clientApp.4.delay=3
+-clientApp.4.startOnLoad=true
++clientApp.4.startOnLoad=false
+
+ # BOB bridge
+ clientApp.5.args=
diff --git a/security/i2p/files/patch-installer__resources__postinstall.sh b/security/i2p/files/patch-installer__resources__postinstall.sh
new file mode 100644
index 000000000000..7f3ed96b1528
--- /dev/null
+++ b/security/i2p/files/patch-installer__resources__postinstall.sh
@@ -0,0 +1,11 @@
+--- installer/resources/postinstall.sh.orig 2014-02-14 00:08:38.000000000 -0200
++++ installer/resources/postinstall.sh 2014-02-14 00:08:49.000000000 -0200
+@@ -72,7 +72,7 @@
+ wrapperpath="./lib/wrapper/freebsd64"
+ cp ${wrapperpath}/libwrapper.so ./lib/
+ # the 32bit libwrapper.so will be needed if a 32 bit jvm is used
+- cp ./lib/freebsd/libwrapper.so ./lib/libwrapper-freebsd-x86-32.so
++ cp ./lib/wrapper/freebsd/libwrapper.so ./lib/libwrapper-freebsd-x86-32.so
+ fi
+ ;;
+ osx )
diff --git a/security/i2p/files/wrapper.sh.in b/security/i2p/files/wrapper.sh.in
new file mode 100644
index 000000000000..e765ab2c0a56
--- /dev/null
+++ b/security/i2p/files/wrapper.sh.in
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# Under a BSDL license. Copyright by Mario S F Ferreira <lioux@FreeBSD.org>
+# $FreeBSD$
+
+DATADIR="%%DATADIR%%"
+#
+I2P_HOME="${HOME}/i2p"
+I2P_RC_SCRIPT=i2prouter
+I2P_POSTINSTALL_SCRIPT=postinstall.sh
+#
+I2P_INSTALL_TARBALL=i2p.tar.bz2
+I2P_UPDATE_ZIP=i2pupdate.zip
+
+if [ -z "${HOME}" -o ! -d "${HOME}" ]; then
+ echo 'ERROR: Please, set HOME environment variable to a valid value!'
+ echo 'ERROR: You may LOSE data if the variable is pointed at an'
+ echo 'ERROR: incorrect location!'
+ exit 1
+fi
+
+case "$1" in
+ restart|start|status|stop)
+ echo "i2p ${1}"
+ if [ -f "${I2P_HOME}/${I2P_RC_SCRIPT}" ]; then
+ case "$1" in
+ restart|start)
+ echo 'To access i2p:'
+ echo 'Point your browser at http://localhost:7657/ to access configuration'
+ echo 'Point your browser proxy at http://localhost:4444/ to access i2p network'
+ ;;
+ esac
+ exec sh "${I2P_HOME}/${I2P_RC_SCRIPT}" ${1}
+ else
+ echo 'ERROR: i2p is not installed'
+ echo 'ERROR: Please install i2p first'
+ exit 2
+ fi
+ ;;
+ install)
+ echo "i2p ${1}"
+ if [ ! -d "${I2P_HOME}" ]; then
+ rm -Rf "${I2P_HOME}"
+ mkdir -p "${I2P_HOME}"
+ fi
+ cd "${HOME}" && \
+ tar -xvjf "${DATADIR}/${I2P_INSTALL_TARBALL}" && \
+ cd "${I2P_HOME}" && \
+ exec sh "${I2P_HOME}/${I2P_POSTINSTALL_SCRIPT}"
+ ;;
+ uninstall)
+ echo "i2p ${1}"
+ exec rm -Rf "${I2P_HOME}"
+ ;;
+ update)
+ echo "i2p ${1}"
+ if [ ! -d "${I2P_HOME}" ]; then
+ echo 'ERROR: i2p is not installed'
+ echo 'ERROR: Please install i2p before trying to update it'
+ exit 3
+ fi
+ cd "${I2P_HOME}" && \
+ exec unzip -o "${DATADIR}/${I2P_UPDATE_ZIP}"
+ ;;
+ *)
+ echo ""
+ echo "Usage: `basename $0` { start | stop | status | restart | install | uninstall | update }"
+ echo ""
+ exit 64
+ ;;
+esac
diff --git a/security/i2p/pkg-descr b/security/i2p/pkg-descr
new file mode 100644
index 000000000000..86b562a8edd2
--- /dev/null
+++ b/security/i2p/pkg-descr
@@ -0,0 +1,16 @@
+[ excerpt from developer's web site ]
+
+I2P is an anonymous overlay network - a network within a network.
+It is intended to protect communication from dragnet surveillance
+and monitoring by third parties such as ISPs.
+
+I2P is used by many people who care about their privacy: activists,
+oppressed people, journalists and whistleblowers, as well as the
+average person.
+
+No network can be "perfectly anonymous". The continued goal of I2P
+is to make attacks more and more difficult to mount. Its anonymity
+will get stronger as the size of the network increases and with
+ongoing academic review.
+
+WWW: http://geti2p.net/