summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@gentoo.org>2003-07-22 05:15:10 +0000
committerBrandon Low <lostlogic@gentoo.org>2003-07-22 05:15:10 +0000
commit21b1f37bd6bc7f494f7c90c24257305f5172aab7 (patch)
tree1156f8926bbae75361a3963838bcc5b5172ecbe9 /net-p2p/freenet/files
parentMake this ebuild work better (diff)
downloadgentoo-2-21b1f37bd6bc7f494f7c90c24257305f5172aab7.tar.gz
gentoo-2-21b1f37bd6bc7f494f7c90c24257305f5172aab7.tar.bz2
gentoo-2-21b1f37bd6bc7f494f7c90c24257305f5172aab7.zip
Make this ebuild work better
Diffstat (limited to 'net-p2p/freenet/files')
-rw-r--r--net-p2p/freenet/files/conf.freenet9
-rw-r--r--net-p2p/freenet/files/digest-freenet-0.5.2.1-r11
-rw-r--r--net-p2p/freenet/files/rc.freenet57
3 files changed, 67 insertions, 0 deletions
diff --git a/net-p2p/freenet/files/conf.freenet b/net-p2p/freenet/files/conf.freenet
new file mode 100644
index 000000000000..0f8160a976b0
--- /dev/null
+++ b/net-p2p/freenet/files/conf.freenet
@@ -0,0 +1,9 @@
+#Freenet config file
+
+# This is for any options you want to pass to the java virtual machine
+# the default is to allocate up to 256M of memory for freenet.
+JAVA_OPTIONS="-Xmx256M"
+
+# This is the nice level to run freenet at, runs at 1 by default to keep
+# out of the way of your more interactive tasks
+FREENET_NICENESS="1"
diff --git a/net-p2p/freenet/files/digest-freenet-0.5.2.1-r1 b/net-p2p/freenet/files/digest-freenet-0.5.2.1-r1
new file mode 100644
index 000000000000..a9b4651be0e9
--- /dev/null
+++ b/net-p2p/freenet/files/digest-freenet-0.5.2.1-r1
@@ -0,0 +1 @@
+MD5 59270ee48d889e0be9cae584b67d2743 freenet-0.5.2.1.tar.gz 2118774
diff --git a/net-p2p/freenet/files/rc.freenet b/net-p2p/freenet/files/rc.freenet
new file mode 100644
index 000000000000..5b88d1f1b494
--- /dev/null
+++ b/net-p2p/freenet/files/rc.freenet
@@ -0,0 +1,57 @@
+#!/sbin/runscript
+# Freenet init.d-script
+# Gentoo Maintainer: Brandon Low <lostlogic@gentoo.org>
+# Authors: Per Wigren <wigren@home.se>
+
+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
+ return 0
+}
+
+start() {
+ JAVA="$(java-config --java)"
+ 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
+ start-stop-daemon --start --quiet --pidfile \
+ /var/run/freenet.pid -m --background -N ${FREENET_NICENESS} \
+ --exec ${JAVA} ${JAVA_ARGS} -- \
+ freenet.node.Main -p /etc/freenet.conf
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Freenet"
+ start-stop-daemon --stop --quiet --pidfile /var/run/freenet.pid
+ eend $?
+}