aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlioux <lioux@FreeBSD.org>2003-05-02 11:39:19 +0800
committerlioux <lioux@FreeBSD.org>2003-05-02 11:39:19 +0800
commitf4009b8578324621bdd3a679351af1db191c85b6 (patch)
tree776b20941d00c54c80d637b101214047da59c7c8
parentf2957143a59075805ac0945e29236840562c899e (diff)
downloadfreebsd-ports-gnome-f4009b8578324621bdd3a679351af1db191c85b6.tar.gz
freebsd-ports-gnome-f4009b8578324621bdd3a679351af1db191c85b6.tar.zst
freebsd-ports-gnome-f4009b8578324621bdd3a679351af1db191c85b6.zip
New port freenet version 0.5.2.r1: peer-to-peer network aiming at
anonymity and freedom of speech
-rw-r--r--net-p2p/freenet/Makefile69
-rw-r--r--net-p2p/freenet/distinfo1
-rw-r--r--net-p2p/freenet/files/wrapper.sh160
-rw-r--r--net-p2p/freenet/pkg-descr23
-rw-r--r--net-p2p/freenet/pkg-message23
-rw-r--r--net-p2p/freenet/pkg-plist9
-rw-r--r--net-p2p/freenet05/Makefile69
-rw-r--r--net-p2p/freenet05/distinfo1
-rw-r--r--net-p2p/freenet05/files/wrapper.sh160
-rw-r--r--net-p2p/freenet05/pkg-descr23
-rw-r--r--net-p2p/freenet05/pkg-message23
-rw-r--r--net-p2p/freenet05/pkg-plist9
-rw-r--r--net/Makefile1
-rw-r--r--net/freenet/Makefile69
-rw-r--r--net/freenet/distinfo1
-rw-r--r--net/freenet/files/wrapper.sh160
-rw-r--r--net/freenet/pkg-descr23
-rw-r--r--net/freenet/pkg-message23
-rw-r--r--net/freenet/pkg-plist9
19 files changed, 856 insertions, 0 deletions
diff --git a/net-p2p/freenet/Makefile b/net-p2p/freenet/Makefile
new file mode 100644
index 000000000000..27c70307751c
--- /dev/null
+++ b/net-p2p/freenet/Makefile
@@ -0,0 +1,69 @@
+# New ports collection makefile for: freenet
+# Date created: Thu May 1 20:19:56 UTC 2003
+# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= freenet
+PORTVERSION= 0.5.2.r1
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTNAME= ${PORTNAME}-${PORTVERSION:S/.r/-rc/}
+
+MAINTAINER= lioux@FreeBSD.org
+COMMENT= peer-to-peer network aiming at anonymity and freedom of speech
+
+USE_JAVA= 1.3+
+NO_BUILD= yes
+NO_BUILD_DEPENDS_JAVA= yes
+WRKSRC= ${WRKDIR}/${PORTNAME}
+PLIST_SUB= JAR_DIR=${JAR_DIR}
+
+JAVAVM= ${LOCALBASE}/bin/javavm
+JAR_DIR= share/java/jar/${PORTNAME}
+#
+DATA_FILES= seednodes.ref
+DOC_FILES= README
+JAR_FILES= freenet.jar freenet-ext.jar
+# jar startup file
+JAR_START= freenet.jar
+# seed file
+SEED_FILE= seednodes.ref
+
+post-patch:
+ @${SED} -e "s|%%PREFIX%%|${PREFIX}|; \
+ s|%%DATA_DIR%%|${DATADIR:S,^${PREFIX}/,,}|; \
+ s|%%JAVAVM%%|${JAVAVM}|; \
+ s|%%JAR_DIR%%|${JAR_DIR}|; \
+ s|%%JAR_FILES%%|${JAR_FILES}|; \
+ s|%%JAR_START%%|${JAR_START}|; \
+ s|%%SEED_FILE%%|${SEED_FILE}|" \
+ ${FILESDIR}/wrapper.sh > ${WRKDIR}/wrapper.sh
+
+do-install:
+# docs
+.ifndef(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for doc in ${DOC_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
+.endfor
+.endif
+# data
+ @${MKDIR} ${DATADIR}
+.for file in ${DATA_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${file} ${DATADIR}
+.endfor
+# jar
+ @${MKDIR} ${PREFIX}/${JAR_DIR}
+.for jar in ${JAR_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${jar} ${PREFIX}/${JAR_DIR}
+.endfor
+# wrapper
+ @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/${PORTNAME:L}
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/net-p2p/freenet/distinfo b/net-p2p/freenet/distinfo
new file mode 100644
index 000000000000..1e62a8b34b26
--- /dev/null
+++ b/net-p2p/freenet/distinfo
@@ -0,0 +1 @@
+MD5 (freenet-0.5.2-rc1.tar.gz) = 4fa988b915517a44def233760662f420
diff --git a/net-p2p/freenet/files/wrapper.sh b/net-p2p/freenet/files/wrapper.sh
new file mode 100644
index 000000000000..67b9f119f3de
--- /dev/null
+++ b/net-p2p/freenet/files/wrapper.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+
+PREFIX="%%PREFIX%%"
+# java
+JAVAVM="%%JAVAVM%%"
+JAR_DIR="%%JAR_DIR%%"
+JAR_FILES="%%JAR_FILES%%"
+JAR_START="%%JAR_START%%"
+# data
+DATA_DIR="%%DATA_DIR%%"
+SEED_FILE=seednodes.ref
+# home
+HOME_DIR=${HOME}/.freenet
+CONFIG_FILE=freenet.conf
+
+configure_freenet () {
+ echo "Configuring FreeNet node"
+ cd ${HOME_DIR} &&
+ ${JAVAVM} -jar ./${JAR_START} freenet.node.Main --config "${@}"
+}
+
+configure_java_classpath () {
+ if [ -z "${CLASSPATH}" ]; then
+ CLASSPATH=./freenet.jar:./freenet-ext.jar
+ else
+ CLASSPATH=./freenet.jar:./freenet-ext.jar:${CLASSPATH}
+ fi
+}
+
+display_usage () {
+ echo "Usage: ${0} [-h] [-i|-o]"
+ echo 'Options:'
+ echo ' -h Display this help message'
+ echo ' -c Configure FreeNet node'
+ echo ' -i Start a FreeNet node'
+ echo ' -o Stop a FreeNet node'
+ echo ''
+}
+
+prepare_configure_freenet () {
+ # do we have a config file?
+ if [ ! -f ${HOME_DIR}/${CONFIG_FILE} ]; then
+ # add basic information prior to configuration
+ echo > ${HOME_DIR}/${CONFIG_FILE}
+
+ # select listenPort randomly
+ if [ -n "${RANDOM}" ]
+ then
+ DEFLP=$((${RANDOM}%30000+2000))
+ else
+ echo "no random in shell, enter a FNP port number + <ENTER>"
+ read DEFLP
+ fi
+ echo "listenPort=${DEFLP}" >> ${HOME_DIR}/${CONFIG_FILE}
+
+ # point to seednodes file
+ echo 'seedNodes=seednodes.ref' >> ${HOME_DIR}/${CONFIG_FILE}
+
+ # tell FreeNet to request configuration procedure
+ CONFIGURE=yes
+ fi
+}
+
+prepare_home_dir () {
+ # create home dir staging area
+ if [ ! -d ${HOME_DIR} ]
+ then
+ mkdir -p ${HOME_DIR}
+ fi
+ # copy a seed file if none exists
+ if [ ! -f ${HOME_DIR}/${SEED_FILE} ]
+ then
+ rm -f ${HOME_DIR}/${SEED_FILE}
+ cp -f ${PREFIX}/${DATA_DIR}/${SEED_FILE} ${HOME_DIR}/${SEED_FILE}
+ # avoid unnecessary reseeding
+ touch -t "197001011200" ${HOME_DIR}/${SEED_FILE}
+ fi
+ # link the jar files
+ for jar in ${JAR_FILES}
+ do
+ if [ ! -h ${HOME_DIR}/${jar} ]
+ then
+ ln -sf ${PREFIX}/${JAR_DIR}/${jar} ${HOME_DIR}/${jar}
+ fi
+ done
+}
+
+start_freenet () {
+ echo "Starting FreeNet node"
+ cd ${HOME_DIR} &&
+ nice -10 ${JAVAVM} -jar ./${JAR_START} "${@}" &
+ echo $! > ${HOME_DIR}/freenet.pid
+ exit 0
+}
+
+stop_freenet () {
+ if [ -f ${HOME_DIR}/freenet.pid ]; then
+ echo "Stopping FreeNet node"
+ cd ${HOME_DIR} &&
+ exec kill `cat freenet.pid` &
+ else
+ echo "Cannot find FreeNet node"
+ echo "Where is the ${HOME_DIR}/freenet.pid file?"
+ fi
+}
+
+# we require at least one command line parameter
+if [ $# -lt 1 ]; then
+ display_usage
+ exit 1
+fi
+
+# parse command line parameters
+while getopts ":io" COMMAND_LINE_ARGUMENT ; do
+ case "${COMMAND_LINE_ARGUMENT}" in
+ c)
+ CONFIGURE=yes
+ ;;
+ h)
+ display_usage
+ exit 0
+ ;;
+ i)
+ START=yes
+ unset STOP
+ ;;
+ o)
+ STOP=yes
+ unset START
+ ;;
+ *)
+ display_usage
+ exit 1
+ ;;
+ esac
+done
+
+# always verify that home dir staging area is pristine
+prepare_home_dir
+
+# check for proper configuration
+prepare_configure_freenet
+
+# prepare java CLASSPATH
+configure_java_classpath
+
+if [ -n "${CONFIGURE}" ]; then
+ configure_freenet
+fi
+
+if [ -n "${START}" ]; then
+ start_freenet
+fi
+
+if [ -n "${STOP}" ]; then
+ stop_freenet
+fi
+
+# we should never get this far
+exit 1
diff --git a/net-p2p/freenet/pkg-descr b/net-p2p/freenet/pkg-descr
new file mode 100644
index 000000000000..0f7d4a2c81ca
--- /dev/null
+++ b/net-p2p/freenet/pkg-descr
@@ -0,0 +1,23 @@
+Freenet is a large-scale peer-to-peer network which pools the power
+of member computers around the world to create a massive virtual
+information store open to anyone to freely publish or view information
+of all kinds. Freenet is:
+
+Highly survivable: All internal processes are completely anonymized
+and decentralized across the global network, making it virtually
+impossible for an attacker to destroy information or take control
+of the system.
+
+Private: Freenet makes it extremely difficult for anyone to spy on
+the information that you are viewing, publishing, or storing.
+
+Secure: Information stored in Freenet is protected by strong
+cryptography against malicious tampering or counterfeiting.
+
+Efficient: Freenet dynamically replicates and relocates information
+in response to demand to provide efficient service and minimal
+bandwidth usage regardless of load. Significantly, Freenet generally
+requires log(n) time to retrieve a piece of information in a network
+of size n.
+
+WWW: http://freenet.sourceforge.net/
diff --git a/net-p2p/freenet/pkg-message b/net-p2p/freenet/pkg-message
new file mode 100644
index 000000000000..47addd918baa
--- /dev/null
+++ b/net-p2p/freenet/pkg-message
@@ -0,0 +1,23 @@
+ ATTENTIONATTENTION:
+
+Restrictions
+============
+
+This program uses heavy encryption algorithms. If your country has
+restrictions against encryption, you should check with legal
+authorities before using it.
+
+Short usage note
+================
+
+Please, check
+/usr/local/share/doc/freenet/README
+for more information.
+
+Using FreeNet
+=============
+
+Point your web browser to http://127.0.0.1:8888/ to get the Freenet
+user interface, this page serves as a "gateway" to Freenet. Try
+clicking the various links in the "Bookmarks" panel to reach some
+of the popular Freenet index sites.
diff --git a/net-p2p/freenet/pkg-plist b/net-p2p/freenet/pkg-plist
new file mode 100644
index 000000000000..960fc5ff9d07
--- /dev/null
+++ b/net-p2p/freenet/pkg-plist
@@ -0,0 +1,9 @@
+bin/freenet
+%%PORTDOCS%%%%DOCSDIR%%/README
+share/freenet/seednodes.ref
+share/java/jar/freenet/freenet-ext.jar
+share/java/jar/freenet/freenet.jar
+@dirrm share/java/jar/freenet
+@unexec rmdir %D/share/java/jar 2>/dev/null || true
+@dirrm share/freenet
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
diff --git a/net-p2p/freenet05/Makefile b/net-p2p/freenet05/Makefile
new file mode 100644
index 000000000000..27c70307751c
--- /dev/null
+++ b/net-p2p/freenet05/Makefile
@@ -0,0 +1,69 @@
+# New ports collection makefile for: freenet
+# Date created: Thu May 1 20:19:56 UTC 2003
+# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= freenet
+PORTVERSION= 0.5.2.r1
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTNAME= ${PORTNAME}-${PORTVERSION:S/.r/-rc/}
+
+MAINTAINER= lioux@FreeBSD.org
+COMMENT= peer-to-peer network aiming at anonymity and freedom of speech
+
+USE_JAVA= 1.3+
+NO_BUILD= yes
+NO_BUILD_DEPENDS_JAVA= yes
+WRKSRC= ${WRKDIR}/${PORTNAME}
+PLIST_SUB= JAR_DIR=${JAR_DIR}
+
+JAVAVM= ${LOCALBASE}/bin/javavm
+JAR_DIR= share/java/jar/${PORTNAME}
+#
+DATA_FILES= seednodes.ref
+DOC_FILES= README
+JAR_FILES= freenet.jar freenet-ext.jar
+# jar startup file
+JAR_START= freenet.jar
+# seed file
+SEED_FILE= seednodes.ref
+
+post-patch:
+ @${SED} -e "s|%%PREFIX%%|${PREFIX}|; \
+ s|%%DATA_DIR%%|${DATADIR:S,^${PREFIX}/,,}|; \
+ s|%%JAVAVM%%|${JAVAVM}|; \
+ s|%%JAR_DIR%%|${JAR_DIR}|; \
+ s|%%JAR_FILES%%|${JAR_FILES}|; \
+ s|%%JAR_START%%|${JAR_START}|; \
+ s|%%SEED_FILE%%|${SEED_FILE}|" \
+ ${FILESDIR}/wrapper.sh > ${WRKDIR}/wrapper.sh
+
+do-install:
+# docs
+.ifndef(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for doc in ${DOC_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
+.endfor
+.endif
+# data
+ @${MKDIR} ${DATADIR}
+.for file in ${DATA_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${file} ${DATADIR}
+.endfor
+# jar
+ @${MKDIR} ${PREFIX}/${JAR_DIR}
+.for jar in ${JAR_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${jar} ${PREFIX}/${JAR_DIR}
+.endfor
+# wrapper
+ @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/${PORTNAME:L}
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/net-p2p/freenet05/distinfo b/net-p2p/freenet05/distinfo
new file mode 100644
index 000000000000..1e62a8b34b26
--- /dev/null
+++ b/net-p2p/freenet05/distinfo
@@ -0,0 +1 @@
+MD5 (freenet-0.5.2-rc1.tar.gz) = 4fa988b915517a44def233760662f420
diff --git a/net-p2p/freenet05/files/wrapper.sh b/net-p2p/freenet05/files/wrapper.sh
new file mode 100644
index 000000000000..67b9f119f3de
--- /dev/null
+++ b/net-p2p/freenet05/files/wrapper.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+
+PREFIX="%%PREFIX%%"
+# java
+JAVAVM="%%JAVAVM%%"
+JAR_DIR="%%JAR_DIR%%"
+JAR_FILES="%%JAR_FILES%%"
+JAR_START="%%JAR_START%%"
+# data
+DATA_DIR="%%DATA_DIR%%"
+SEED_FILE=seednodes.ref
+# home
+HOME_DIR=${HOME}/.freenet
+CONFIG_FILE=freenet.conf
+
+configure_freenet () {
+ echo "Configuring FreeNet node"
+ cd ${HOME_DIR} &&
+ ${JAVAVM} -jar ./${JAR_START} freenet.node.Main --config "${@}"
+}
+
+configure_java_classpath () {
+ if [ -z "${CLASSPATH}" ]; then
+ CLASSPATH=./freenet.jar:./freenet-ext.jar
+ else
+ CLASSPATH=./freenet.jar:./freenet-ext.jar:${CLASSPATH}
+ fi
+}
+
+display_usage () {
+ echo "Usage: ${0} [-h] [-i|-o]"
+ echo 'Options:'
+ echo ' -h Display this help message'
+ echo ' -c Configure FreeNet node'
+ echo ' -i Start a FreeNet node'
+ echo ' -o Stop a FreeNet node'
+ echo ''
+}
+
+prepare_configure_freenet () {
+ # do we have a config file?
+ if [ ! -f ${HOME_DIR}/${CONFIG_FILE} ]; then
+ # add basic information prior to configuration
+ echo > ${HOME_DIR}/${CONFIG_FILE}
+
+ # select listenPort randomly
+ if [ -n "${RANDOM}" ]
+ then
+ DEFLP=$((${RANDOM}%30000+2000))
+ else
+ echo "no random in shell, enter a FNP port number + <ENTER>"
+ read DEFLP
+ fi
+ echo "listenPort=${DEFLP}" >> ${HOME_DIR}/${CONFIG_FILE}
+
+ # point to seednodes file
+ echo 'seedNodes=seednodes.ref' >> ${HOME_DIR}/${CONFIG_FILE}
+
+ # tell FreeNet to request configuration procedure
+ CONFIGURE=yes
+ fi
+}
+
+prepare_home_dir () {
+ # create home dir staging area
+ if [ ! -d ${HOME_DIR} ]
+ then
+ mkdir -p ${HOME_DIR}
+ fi
+ # copy a seed file if none exists
+ if [ ! -f ${HOME_DIR}/${SEED_FILE} ]
+ then
+ rm -f ${HOME_DIR}/${SEED_FILE}
+ cp -f ${PREFIX}/${DATA_DIR}/${SEED_FILE} ${HOME_DIR}/${SEED_FILE}
+ # avoid unnecessary reseeding
+ touch -t "197001011200" ${HOME_DIR}/${SEED_FILE}
+ fi
+ # link the jar files
+ for jar in ${JAR_FILES}
+ do
+ if [ ! -h ${HOME_DIR}/${jar} ]
+ then
+ ln -sf ${PREFIX}/${JAR_DIR}/${jar} ${HOME_DIR}/${jar}
+ fi
+ done
+}
+
+start_freenet () {
+ echo "Starting FreeNet node"
+ cd ${HOME_DIR} &&
+ nice -10 ${JAVAVM} -jar ./${JAR_START} "${@}" &
+ echo $! > ${HOME_DIR}/freenet.pid
+ exit 0
+}
+
+stop_freenet () {
+ if [ -f ${HOME_DIR}/freenet.pid ]; then
+ echo "Stopping FreeNet node"
+ cd ${HOME_DIR} &&
+ exec kill `cat freenet.pid` &
+ else
+ echo "Cannot find FreeNet node"
+ echo "Where is the ${HOME_DIR}/freenet.pid file?"
+ fi
+}
+
+# we require at least one command line parameter
+if [ $# -lt 1 ]; then
+ display_usage
+ exit 1
+fi
+
+# parse command line parameters
+while getopts ":io" COMMAND_LINE_ARGUMENT ; do
+ case "${COMMAND_LINE_ARGUMENT}" in
+ c)
+ CONFIGURE=yes
+ ;;
+ h)
+ display_usage
+ exit 0
+ ;;
+ i)
+ START=yes
+ unset STOP
+ ;;
+ o)
+ STOP=yes
+ unset START
+ ;;
+ *)
+ display_usage
+ exit 1
+ ;;
+ esac
+done
+
+# always verify that home dir staging area is pristine
+prepare_home_dir
+
+# check for proper configuration
+prepare_configure_freenet
+
+# prepare java CLASSPATH
+configure_java_classpath
+
+if [ -n "${CONFIGURE}" ]; then
+ configure_freenet
+fi
+
+if [ -n "${START}" ]; then
+ start_freenet
+fi
+
+if [ -n "${STOP}" ]; then
+ stop_freenet
+fi
+
+# we should never get this far
+exit 1
diff --git a/net-p2p/freenet05/pkg-descr b/net-p2p/freenet05/pkg-descr
new file mode 100644
index 000000000000..0f7d4a2c81ca
--- /dev/null
+++ b/net-p2p/freenet05/pkg-descr
@@ -0,0 +1,23 @@
+Freenet is a large-scale peer-to-peer network which pools the power
+of member computers around the world to create a massive virtual
+information store open to anyone to freely publish or view information
+of all kinds. Freenet is:
+
+Highly survivable: All internal processes are completely anonymized
+and decentralized across the global network, making it virtually
+impossible for an attacker to destroy information or take control
+of the system.
+
+Private: Freenet makes it extremely difficult for anyone to spy on
+the information that you are viewing, publishing, or storing.
+
+Secure: Information stored in Freenet is protected by strong
+cryptography against malicious tampering or counterfeiting.
+
+Efficient: Freenet dynamically replicates and relocates information
+in response to demand to provide efficient service and minimal
+bandwidth usage regardless of load. Significantly, Freenet generally
+requires log(n) time to retrieve a piece of information in a network
+of size n.
+
+WWW: http://freenet.sourceforge.net/
diff --git a/net-p2p/freenet05/pkg-message b/net-p2p/freenet05/pkg-message
new file mode 100644
index 000000000000..47addd918baa
--- /dev/null
+++ b/net-p2p/freenet05/pkg-message
@@ -0,0 +1,23 @@
+ ATTENTIONATTENTION:
+
+Restrictions
+============
+
+This program uses heavy encryption algorithms. If your country has
+restrictions against encryption, you should check with legal
+authorities before using it.
+
+Short usage note
+================
+
+Please, check
+/usr/local/share/doc/freenet/README
+for more information.
+
+Using FreeNet
+=============
+
+Point your web browser to http://127.0.0.1:8888/ to get the Freenet
+user interface, this page serves as a "gateway" to Freenet. Try
+clicking the various links in the "Bookmarks" panel to reach some
+of the popular Freenet index sites.
diff --git a/net-p2p/freenet05/pkg-plist b/net-p2p/freenet05/pkg-plist
new file mode 100644
index 000000000000..960fc5ff9d07
--- /dev/null
+++ b/net-p2p/freenet05/pkg-plist
@@ -0,0 +1,9 @@
+bin/freenet
+%%PORTDOCS%%%%DOCSDIR%%/README
+share/freenet/seednodes.ref
+share/java/jar/freenet/freenet-ext.jar
+share/java/jar/freenet/freenet.jar
+@dirrm share/java/jar/freenet
+@unexec rmdir %D/share/java/jar 2>/dev/null || true
+@dirrm share/freenet
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
diff --git a/net/Makefile b/net/Makefile
index d94d51b83a4a..f4749ac9b3e7 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -148,6 +148,7 @@
SUBDIR += forg
SUBDIR += fping
SUBDIR += freebsd-uucp
+ SUBDIR += freenet
SUBDIR += freenet6
SUBDIR += freeradius
SUBDIR += freevrrpd
diff --git a/net/freenet/Makefile b/net/freenet/Makefile
new file mode 100644
index 000000000000..27c70307751c
--- /dev/null
+++ b/net/freenet/Makefile
@@ -0,0 +1,69 @@
+# New ports collection makefile for: freenet
+# Date created: Thu May 1 20:19:56 UTC 2003
+# Whom: Mario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= freenet
+PORTVERSION= 0.5.2.r1
+CATEGORIES= net
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= ${PORTNAME}
+DISTNAME= ${PORTNAME}-${PORTVERSION:S/.r/-rc/}
+
+MAINTAINER= lioux@FreeBSD.org
+COMMENT= peer-to-peer network aiming at anonymity and freedom of speech
+
+USE_JAVA= 1.3+
+NO_BUILD= yes
+NO_BUILD_DEPENDS_JAVA= yes
+WRKSRC= ${WRKDIR}/${PORTNAME}
+PLIST_SUB= JAR_DIR=${JAR_DIR}
+
+JAVAVM= ${LOCALBASE}/bin/javavm
+JAR_DIR= share/java/jar/${PORTNAME}
+#
+DATA_FILES= seednodes.ref
+DOC_FILES= README
+JAR_FILES= freenet.jar freenet-ext.jar
+# jar startup file
+JAR_START= freenet.jar
+# seed file
+SEED_FILE= seednodes.ref
+
+post-patch:
+ @${SED} -e "s|%%PREFIX%%|${PREFIX}|; \
+ s|%%DATA_DIR%%|${DATADIR:S,^${PREFIX}/,,}|; \
+ s|%%JAVAVM%%|${JAVAVM}|; \
+ s|%%JAR_DIR%%|${JAR_DIR}|; \
+ s|%%JAR_FILES%%|${JAR_FILES}|; \
+ s|%%JAR_START%%|${JAR_START}|; \
+ s|%%SEED_FILE%%|${SEED_FILE}|" \
+ ${FILESDIR}/wrapper.sh > ${WRKDIR}/wrapper.sh
+
+do-install:
+# docs
+.ifndef(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+.for doc in ${DOC_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR}
+.endfor
+.endif
+# data
+ @${MKDIR} ${DATADIR}
+.for file in ${DATA_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${file} ${DATADIR}
+.endfor
+# jar
+ @${MKDIR} ${PREFIX}/${JAR_DIR}
+.for jar in ${JAR_FILES}
+ @${INSTALL_DATA} ${WRKSRC}/${jar} ${PREFIX}/${JAR_DIR}
+.endfor
+# wrapper
+ @${INSTALL_SCRIPT} ${WRKDIR}/wrapper.sh ${PREFIX}/bin/${PORTNAME:L}
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/net/freenet/distinfo b/net/freenet/distinfo
new file mode 100644
index 000000000000..1e62a8b34b26
--- /dev/null
+++ b/net/freenet/distinfo
@@ -0,0 +1 @@
+MD5 (freenet-0.5.2-rc1.tar.gz) = 4fa988b915517a44def233760662f420
diff --git a/net/freenet/files/wrapper.sh b/net/freenet/files/wrapper.sh
new file mode 100644
index 000000000000..67b9f119f3de
--- /dev/null
+++ b/net/freenet/files/wrapper.sh
@@ -0,0 +1,160 @@
+#!/bin/sh
+
+PREFIX="%%PREFIX%%"
+# java
+JAVAVM="%%JAVAVM%%"
+JAR_DIR="%%JAR_DIR%%"
+JAR_FILES="%%JAR_FILES%%"
+JAR_START="%%JAR_START%%"
+# data
+DATA_DIR="%%DATA_DIR%%"
+SEED_FILE=seednodes.ref
+# home
+HOME_DIR=${HOME}/.freenet
+CONFIG_FILE=freenet.conf
+
+configure_freenet () {
+ echo "Configuring FreeNet node"
+ cd ${HOME_DIR} &&
+ ${JAVAVM} -jar ./${JAR_START} freenet.node.Main --config "${@}"
+}
+
+configure_java_classpath () {
+ if [ -z "${CLASSPATH}" ]; then
+ CLASSPATH=./freenet.jar:./freenet-ext.jar
+ else
+ CLASSPATH=./freenet.jar:./freenet-ext.jar:${CLASSPATH}
+ fi
+}
+
+display_usage () {
+ echo "Usage: ${0} [-h] [-i|-o]"
+ echo 'Options:'
+ echo ' -h Display this help message'
+ echo ' -c Configure FreeNet node'
+ echo ' -i Start a FreeNet node'
+ echo ' -o Stop a FreeNet node'
+ echo ''
+}
+
+prepare_configure_freenet () {
+ # do we have a config file?
+ if [ ! -f ${HOME_DIR}/${CONFIG_FILE} ]; then
+ # add basic information prior to configuration
+ echo > ${HOME_DIR}/${CONFIG_FILE}
+
+ # select listenPort randomly
+ if [ -n "${RANDOM}" ]
+ then
+ DEFLP=$((${RANDOM}%30000+2000))
+ else
+ echo "no random in shell, enter a FNP port number + <ENTER>"
+ read DEFLP
+ fi
+ echo "listenPort=${DEFLP}" >> ${HOME_DIR}/${CONFIG_FILE}
+
+ # point to seednodes file
+ echo 'seedNodes=seednodes.ref' >> ${HOME_DIR}/${CONFIG_FILE}
+
+ # tell FreeNet to request configuration procedure
+ CONFIGURE=yes
+ fi
+}
+
+prepare_home_dir () {
+ # create home dir staging area
+ if [ ! -d ${HOME_DIR} ]
+ then
+ mkdir -p ${HOME_DIR}
+ fi
+ # copy a seed file if none exists
+ if [ ! -f ${HOME_DIR}/${SEED_FILE} ]
+ then
+ rm -f ${HOME_DIR}/${SEED_FILE}
+ cp -f ${PREFIX}/${DATA_DIR}/${SEED_FILE} ${HOME_DIR}/${SEED_FILE}
+ # avoid unnecessary reseeding
+ touch -t "197001011200" ${HOME_DIR}/${SEED_FILE}
+ fi
+ # link the jar files
+ for jar in ${JAR_FILES}
+ do
+ if [ ! -h ${HOME_DIR}/${jar} ]
+ then
+ ln -sf ${PREFIX}/${JAR_DIR}/${jar} ${HOME_DIR}/${jar}
+ fi
+ done
+}
+
+start_freenet () {
+ echo "Starting FreeNet node"
+ cd ${HOME_DIR} &&
+ nice -10 ${JAVAVM} -jar ./${JAR_START} "${@}" &
+ echo $! > ${HOME_DIR}/freenet.pid
+ exit 0
+}
+
+stop_freenet () {
+ if [ -f ${HOME_DIR}/freenet.pid ]; then
+ echo "Stopping FreeNet node"
+ cd ${HOME_DIR} &&
+ exec kill `cat freenet.pid` &
+ else
+ echo "Cannot find FreeNet node"
+ echo "Where is the ${HOME_DIR}/freenet.pid file?"
+ fi
+}
+
+# we require at least one command line parameter
+if [ $# -lt 1 ]; then
+ display_usage
+ exit 1
+fi
+
+# parse command line parameters
+while getopts ":io" COMMAND_LINE_ARGUMENT ; do
+ case "${COMMAND_LINE_ARGUMENT}" in
+ c)
+ CONFIGURE=yes
+ ;;
+ h)
+ display_usage
+ exit 0
+ ;;
+ i)
+ START=yes
+ unset STOP
+ ;;
+ o)
+ STOP=yes
+ unset START
+ ;;
+ *)
+ display_usage
+ exit 1
+ ;;
+ esac
+done
+
+# always verify that home dir staging area is pristine
+prepare_home_dir
+
+# check for proper configuration
+prepare_configure_freenet
+
+# prepare java CLASSPATH
+configure_java_classpath
+
+if [ -n "${CONFIGURE}" ]; then
+ configure_freenet
+fi
+
+if [ -n "${START}" ]; then
+ start_freenet
+fi
+
+if [ -n "${STOP}" ]; then
+ stop_freenet
+fi
+
+# we should never get this far
+exit 1
diff --git a/net/freenet/pkg-descr b/net/freenet/pkg-descr
new file mode 100644
index 000000000000..0f7d4a2c81ca
--- /dev/null
+++ b/net/freenet/pkg-descr
@@ -0,0 +1,23 @@
+Freenet is a large-scale peer-to-peer network which pools the power
+of member computers around the world to create a massive virtual
+information store open to anyone to freely publish or view information
+of all kinds. Freenet is:
+
+Highly survivable: All internal processes are completely anonymized
+and decentralized across the global network, making it virtually
+impossible for an attacker to destroy information or take control
+of the system.
+
+Private: Freenet makes it extremely difficult for anyone to spy on
+the information that you are viewing, publishing, or storing.
+
+Secure: Information stored in Freenet is protected by strong
+cryptography against malicious tampering or counterfeiting.
+
+Efficient: Freenet dynamically replicates and relocates information
+in response to demand to provide efficient service and minimal
+bandwidth usage regardless of load. Significantly, Freenet generally
+requires log(n) time to retrieve a piece of information in a network
+of size n.
+
+WWW: http://freenet.sourceforge.net/
diff --git a/net/freenet/pkg-message b/net/freenet/pkg-message
new file mode 100644
index 000000000000..47addd918baa
--- /dev/null
+++ b/net/freenet/pkg-message
@@ -0,0 +1,23 @@
+ ATTENTIONATTENTION:
+
+Restrictions
+============
+
+This program uses heavy encryption algorithms. If your country has
+restrictions against encryption, you should check with legal
+authorities before using it.
+
+Short usage note
+================
+
+Please, check
+/usr/local/share/doc/freenet/README
+for more information.
+
+Using FreeNet
+=============
+
+Point your web browser to http://127.0.0.1:8888/ to get the Freenet
+user interface, this page serves as a "gateway" to Freenet. Try
+clicking the various links in the "Bookmarks" panel to reach some
+of the popular Freenet index sites.
diff --git a/net/freenet/pkg-plist b/net/freenet/pkg-plist
new file mode 100644
index 000000000000..960fc5ff9d07
--- /dev/null
+++ b/net/freenet/pkg-plist
@@ -0,0 +1,9 @@
+bin/freenet
+%%PORTDOCS%%%%DOCSDIR%%/README
+share/freenet/seednodes.ref
+share/java/jar/freenet/freenet-ext.jar
+share/java/jar/freenet/freenet.jar
+@dirrm share/java/jar/freenet
+@unexec rmdir %D/share/java/jar 2>/dev/null || true
+@dirrm share/freenet
+%%PORTDOCS%%@dirrm %%DOCSDIR%%