summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@gentoo.org>2003-09-08 22:02:14 +0000
committerBrandon Low <lostlogic@gentoo.org>2003-09-08 22:02:14 +0000
commit356f85a4ef594a6cbb13303e6e3e60939cb1afc5 (patch)
treec391dd149e9f0220a2353e71268ef2b51dfbd6a7 /net-p2p
parentBugfix, direct to stable (diff)
downloadgentoo-2-356f85a4ef594a6cbb13303e6e3e60939cb1afc5.tar.gz
gentoo-2-356f85a4ef594a6cbb13303e6e3e60939cb1afc5.tar.bz2
gentoo-2-356f85a4ef594a6cbb13303e6e3e60939cb1afc5.zip
Bugfix, direct to stable
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/freenet/ChangeLog8
-rw-r--r--net-p2p/freenet/Manifest4
-rw-r--r--net-p2p/freenet/files/digest-freenet-0.5.2.1-r61
-rw-r--r--net-p2p/freenet/files/rc.freenet478
-rw-r--r--net-p2p/freenet/freenet-0.5.2.1-r6.ebuild146
5 files changed, 234 insertions, 3 deletions
diff --git a/net-p2p/freenet/ChangeLog b/net-p2p/freenet/ChangeLog
index 3d53b4ca949a..eee7a9d76d7d 100644
--- a/net-p2p/freenet/ChangeLog
+++ b/net-p2p/freenet/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-p2p/freenet
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-p2p/freenet/ChangeLog,v 1.30 2003/09/03 20:58:39 lostlogic Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/freenet/ChangeLog,v 1.31 2003/09/08 22:02:11 lostlogic Exp $
+
+*freenet-0.5.2.1-r6 (08 Sep 2003)
+
+ 08 Sep 2003; Brandon Low <lostlogic@gentoo.org> freenet-0.5.2.1-r6.ebuild,
+ files/rc.freenet4:
+ Fix bug 28020 thanks a lot to Guaka on IRC for his help and patience
03 Sep 2003; Brandon Low <lostlogic@gentoo.org> freenet-0.5.2.1-r5.ebuild:
x86 keyword
diff --git a/net-p2p/freenet/Manifest b/net-p2p/freenet/Manifest
index ed31eca12e52..a7fbd357f42a 100644
--- a/net-p2p/freenet/Manifest
+++ b/net-p2p/freenet/Manifest
@@ -1,7 +1,7 @@
-MD5 d05274d9c4a6f0583b398689b4e6b8fd freenet-0.5.2.1-r6.ebuild 4521
+MD5 12db48e1d3b36119fb243885d02f5886 freenet-0.5.2.1-r6.ebuild 4524
MD5 711416ea33c7ebb89c6110bea2baf9a9 freenet-0.5.2.1-r3.ebuild 4315
MD5 9b8a0f03aca02e9c18ac827965eec956 freenet-0.5.2.1-r5.ebuild 4505
-MD5 993a2d9f9bfe3b5a06f88fdb5af6018d ChangeLog 6074
+MD5 f7bd21080e384fa7210d424aa958581e ChangeLog 6279
MD5 2102c07c25f233d96f3ee92f4d075704 files/rc.freenet2 1713
MD5 f42bcccd602282dd4fad406f9be9b829 files/rc.freenet3 2213
MD5 c790a3f14dce4b353ab89ed06df54d32 files/rc.freenet4 2218
diff --git a/net-p2p/freenet/files/digest-freenet-0.5.2.1-r6 b/net-p2p/freenet/files/digest-freenet-0.5.2.1-r6
new file mode 100644
index 000000000000..a9b4651be0e9
--- /dev/null
+++ b/net-p2p/freenet/files/digest-freenet-0.5.2.1-r6
@@ -0,0 +1 @@
+MD5 59270ee48d889e0be9cae584b67d2743 freenet-0.5.2.1.tar.gz 2118774
diff --git a/net-p2p/freenet/files/rc.freenet4 b/net-p2p/freenet/files/rc.freenet4
new file mode 100644
index 000000000000..f62b0f1faaeb
--- /dev/null
+++ b/net-p2p/freenet/files/rc.freenet4
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# Gentoo freenet init.d-script
+#
+# This script requires the companion script start-freenet.sh to do it's
+# job. This script is needed to facilitate full logging of freenet.
+#
+# Also requires the /etc/conf.d/freenet file to be configured correctly.
+#
+# Gentoo Maintainer: Brandon Low <lostlogic@gentoo.org>
+# Authors: Per Wigren <wigren@home.se>
+# Brandon Low <lostlogic@gentoo.org>
+#
+
+depend() {
+ need net
+}
+
+check_config() {
+ if [ -z "${FREENET_NICENESS}" ] || [ -z "${JAVA_OPTIONS}" ]; then
+ eerror "Please set all options in /etc/conf.d/freenet"
+ return 1
+ fi
+ if [ ! -f /etc/freenet.conf ]; then
+ eerror "To configure freenet, please run:"
+ eerror "# ebuild /usr/portage/net-p2p/freenet/freenet-[version].ebuild"
+ return 1
+ fi
+ return 0
+}
+
+start() {
+ JAVA="$(java-config --java)"
+ #The JVMs don't support NPTL yet, so this is necessary
+ export LD_ASSUME_KERNEL=2.4.1
+
+ check_config || return 1
+
+ ebegin "Starting Freenet now"
+ if [ ! -f /usr/lib/freenet/freenet-ext.jar ]; then
+ ewarn "freenet-ext.jar not found. It can be downloaded from"
+ ewarn "http://freenetproject.org/snapshots/freenet-ext.jar"
+ eend 1
+ return 1
+ fi
+ if [ ! -f /var/freenet/seednodes.ref ]; then
+ ewarn "seednodes.ref not found, you can download some seeds"
+ ewarn "from http://hawk.freenetproject.org/~freenet4/seednodes.ref"
+ eend 1
+ return 1
+ fi
+
+ CLASSPATH=/usr/lib/freenet/freenet.jar:/usr/lib/freenet/freenet-ext.jar:$CLASSPATH
+
+ # if Sun JDK set -server option as suggested on mailing list
+ if [ ! -z "`${JAVA} -help 2>&1 | grep '[-]server'`" ]; then
+ JAVA_ARGS="-server"
+ else
+ JAVA_ARGS=""
+ fi
+ JAVA_ARGS="${JAVA_ARGS} ${JAVA_OPTIONS}"
+ ulimit -n 4096
+ # Had to change off of using start-stop-daemon to start it,
+ # because of suckage. This allows us to log the stdout and
+ # stderr of freenet.
+ export JAVA JAVA_ARGS CLASSPATH
+ echo "XXXXXX" > /var/freenet/freenet.pid
+ nice -n ${FREENET_NICENESS} sudo -u freenet -- /usr/bin/start-freenet.sh \
+ > /var/freenet/freenet.pid
+ sleep 1
+ ps ax|grep "^ *$(cat /var/freenet/freenet.pid)" > /dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Freenet"
+ start-stop-daemon --stop --quiet --pidfile /var/freenet/freenet.pid
+ eend $?
+}
diff --git a/net-p2p/freenet/freenet-0.5.2.1-r6.ebuild b/net-p2p/freenet/freenet-0.5.2.1-r6.ebuild
new file mode 100644
index 000000000000..dae90ef33fbc
--- /dev/null
+++ b/net-p2p/freenet/freenet-0.5.2.1-r6.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/freenet/freenet-0.5.2.1-r6.ebuild,v 1.1 2003/09/08 22:02:11 lostlogic Exp $
+
+IUSE=""
+
+S=${WORKDIR}/${PN}
+
+DESCRIPTION="large-scale peer-to-peer network that creates a massive virtual information store open to anyone"
+SRC_URI="mirror://sourceforge/freenet/${P}.tar.gz"
+HOMEPAGE="http://freenetproject.org/"
+
+SLOT="0"
+KEYWORDS="x86 ~ppc"
+LICENSE="GPL-2"
+
+DEPEND="virtual/jre
+ >=sys-apps/sed-4
+ app-admin/sudo"
+
+src_install() {
+ exeinto /usr/bin
+ doexe ${FILESDIR}/start-freenet.sh
+
+ dodoc README
+
+ dodir /var/freenet/stats /var/freenet/store
+ keepdir /var/freenet/stats /var/freenet/store
+
+ insinto /usr/lib/freenet
+ doins freenet.jar freenet-ext.jar
+
+ insinto /etc/conf.d
+ newins ${FILESDIR}/conf.freenet freenet
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/rc.freenet4 freenet
+}
+
+pkg_preinst() {
+ if ! groupmod freenet > /dev/null 2>&1; then
+ groupadd freenet 2> /dev/null || \
+ die "Failed to create freenet group"
+ fi
+ if ! usermod freenet > /dev/null 2>&1; then
+ useradd -g freenet -s /bin/bash -d /var/empty \
+ -c "freenet" freenet 2> /dev/null || \
+ die "Failed to create freenet user"
+ else
+ usermod -s /bin/bash freenet
+ fi
+}
+
+pkg_postinst() {
+ if [ -f /etc/freenet.conf ];then
+ chmod 664 /etc/freenet.conf
+ chown root:freenet /etc/freenet.conf
+ fi
+ chown -R freenet:freenet /var/freenet
+ einfo "Congratulations on merging freenet, please run"
+ einfo "# ebuild ${EBUILD} config"
+ einfo "to update freenet to the latest jars and seednodes."
+ einfo "This step is also necessary to configure freenet for"
+ einfo "first use. You may also run this step again at any time"
+ einfo "to get any updates available to freenet"
+ ewarn "Anyone who merged a freenet prior to 0.5.2.1-r3 will"
+ ewarn "need to change their logFile setting to /var/freenet/freenet.log"
+ ewarn "in order for freenet to continue to function"
+}
+
+pkg_postrm() {
+ if [ -z has_version ]; then
+ einfo "Please remove /var/freenet manually if you are't going to"
+ einfo "continue to use Freenet on this machine!"
+ fi
+}
+
+pkg_config() {
+ YN="X"
+ while [ "${YN}" != "y" -a "${YN}" != "Y" -a "${YN}" != "n" -a "${YN}" != "N" -a "${YN}" != "" ]; do
+ einfo "Would you like to update freenet files now? [Y/n]"
+ read YN
+ done
+ if [ -z "$(echo ${YN}|sed -e s/y//i)" ];then
+ einfo "Press U within 2 seconds to try an unstable snapshot"
+ read -n 1 -t 2 YN
+ if [ "${YN}" == "U" ] || [ "${YN}" == "u" ]; then
+ wget http://freenetproject.org/snapshots/freenet-unstable-latest.jar -O /usr/lib/freenet/freenet.jar
+ else
+ wget http://freenetproject.org/snapshots/freenet-latest.jar -O /usr/lib/freenet/freenet.jar
+ fi
+ wget http://freenetproject.org/snapshots/seednodes.ref -O /var/freenet/seednodes.ref
+ touch -d "1/1/1970" /var/freenet/seednodes.ref
+ chown freenet:freenet /var/freenet/seednodes.ref
+ fi
+
+ if [ -f /etc/freenet.conf ]; then
+ einfo "Press C within 2 seconds to force reconfiguration of freenet"
+ read -n 1 -t 2 YN
+ fi
+ if [ ! -f /etc/freenet.conf ] || [ "${YN}" == C ] || [ "${YN}" == "c" ]; then
+ einfo "Preparing to configure freenet..."
+ if [ -f /etc/freenet.conf ]; then
+ cp /etc/freenet.conf .
+ else
+ # Pre-determine IP address
+ IP="$(hostname -i)"
+ declare -i DEFLP
+ if [ "${RANDOM}" ]; then
+ DEFLP=${RANDOM}%30000+2000
+ else
+ echo "no random in shell, enter a FNP port number + <ENTER>"
+ read DEFLP
+ fi
+
+ cat << EOF > freenet.conf
+ipAddress=${IP}
+listenPort=${DEFLP}
+seedFile=/var/freenet/seednodes.ref
+logFile=/var/freenet/freenet.log
+storeFile=/var/freenet/store
+diagnosticsPath=/var/freenet/stats
+routingDir=/var/freenet
+nodeFile=/var/freenet/node
+EOF
+ fi
+
+ CLASSPATH="/usr/lib/freenet/freenet.jar:/usr/lib/freenet/freenet-ext.jar:${CLASSPATH}"
+ $(java-config --java) freenet.node.Main --config
+ mv freenet.conf /etc
+ sed -i -e "s/^%\(ipAddress\)/\1/" \
+ -e "s/^%\(listenPort\)/\1/" \
+ -e "s/^%\(seedFile\)/\1/" \
+ -e "s/^%\(logFile\)/\1/" \
+ -e "s/^%\(storeFile\)/\1/" \
+ -e "s/^%\(diagnosticsPath\)/\1/" \
+ -e "s/^%\(routingDir\)/\1/" \
+ -e "s/^%\(nodeFile\)/\1/" /etc/freenet.conf
+ chmod 664 /etc/freenet.conf
+ chown root:freenet /etc/freenet.conf
+ fi
+ einfo "Congratulations, freenet is configured and up to date"
+ einfo "use '/etc/init.d/freenet start' to start it"
+ einfo "You can always re-update/reconfigure your freenet with:"
+ einfo "# ebuild ${EBUILD} config"
+}