diff options
author | Brandon Low <lostlogic@gentoo.org> | 2003-07-22 05:15:10 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@gentoo.org> | 2003-07-22 05:15:10 +0000 |
commit | adfa44294475f5d253436f2cdf128df950fa41e5 (patch) | |
tree | 6a5ec08ac803ec4e742af8a0de7497fe36dd987d /net-p2p | |
parent | Make this ebuild work better (diff) | |
download | historical-adfa44294475f5d253436f2cdf128df950fa41e5.tar.gz historical-adfa44294475f5d253436f2cdf128df950fa41e5.tar.bz2 historical-adfa44294475f5d253436f2cdf128df950fa41e5.zip |
Make this ebuild work better
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/freenet/Manifest | 7 | ||||
-rw-r--r-- | net-p2p/freenet/files/conf.freenet | 9 | ||||
-rw-r--r-- | net-p2p/freenet/files/digest-freenet-0.5.2.1-r1 | 1 | ||||
-rw-r--r-- | net-p2p/freenet/files/rc.freenet | 57 | ||||
-rw-r--r-- | net-p2p/freenet/freenet-0.5.2.1-r1.ebuild | 91 |
5 files changed, 162 insertions, 3 deletions
diff --git a/net-p2p/freenet/Manifest b/net-p2p/freenet/Manifest index 45cae34d05cf..be51d762db26 100644 --- a/net-p2p/freenet/Manifest +++ b/net-p2p/freenet/Manifest @@ -1,17 +1,18 @@ MD5 0b03cc47b8abad9dfc40aab776959a9d freenet-0.5.0.6.ebuild 2005 -MD5 9a4c973040f25611845e110a7b7d398b freenet-0.5.2.1-r1.ebuild 2390 +MD5 4e3907b4a279b4e5a7ae5a188ce17c64 freenet-0.5.2.1-r1.ebuild 2713 MD5 39a33e12384fb7d28a92c358e782f942 freenet-0.5.2_rc3.ebuild 2058 MD5 428ee623760f03deab555da1fcccd7af freenet-0.5.ebuild 1998 MD5 4a572336e5656ed9e389c1253785d40e freenet-0.5.0.5.ebuild 2005 MD5 1f41b68bc47197176b77df6c977812e4 freenet-0.5.1.ebuild 2016 MD5 7008d46e46b0cbbad9e1ad5608a5b216 freenet-0.5.2.1.ebuild 2060 -MD5 06e5438deb3cf23d3e121b54ba3ce268 ChangeLog 2860 +MD5 dbe3ba412d6faefff7753a2391af8fd7 ChangeLog 3085 MD5 0c3733e4f32eb31b35911b1607a89b26 files/digest-freenet-0.5.0.5 68 MD5 0d58992419b9ac733891b7d7d5d3bdf3 files/digest-freenet-0.5.0.6 68 MD5 3a391b52e5e7740c7bdafcba7a9ee4d3 files/digest-freenet-0.5.2.1 68 MD5 890e052f3e48c07373faf6800fbfbb37 files/digest-freenet-0.5 61 MD5 4bd090725f69c1d13e2f08134e99f51f files/digest-freenet-0.5.1 66 +MD5 169efe0f216ade927538fab48315ecc7 files/conf.freenet 323 MD5 24f25cc59216bf29f6312ecc48491c04 files/freenet 1171 MD5 3a391b52e5e7740c7bdafcba7a9ee4d3 files/digest-freenet-0.5.2.1-r1 68 MD5 7318827f8ff1d596bea432329487ce89 files/digest-freenet-0.5.2_rc3 70 -MD5 544ef8d0a6d619532ffe6c53455187fc files/rc.freenet 816 +MD5 5afb665aa34f275aaae7ffab606b4f3a files/rc.freenet 1470 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 $? +} diff --git a/net-p2p/freenet/freenet-0.5.2.1-r1.ebuild b/net-p2p/freenet/freenet-0.5.2.1-r1.ebuild new file mode 100644 index 000000000000..2f01b95c3ddc --- /dev/null +++ b/net-p2p/freenet/freenet-0.5.2.1-r1.ebuild @@ -0,0 +1,91 @@ +# 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-r1.ebuild,v 1.1 2003/07/22 05:15:07 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" + +src_install() { + 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.freenet freenet +} + +pkg_postinst() { + 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" +} + +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 + echo "Would you like to update freenet files now? [Y/n]" + read YN + done + if [ -z "$(echo ${YN}|sed -e s/y//i)" ];then + wget http://freenetproject.org/snapshots/freenet-latest.jar -O /usr/lib/freenet/freenet.jar + wget http://freenetproject.org/snapshots/seednodes.ref -O /var/freenet/seednodes.ref + touch -d "1/1/1970" /var/freenet/seednodes.ref + fi + + if [ ! -f /etc/freenet.conf ]; then + einfo "Preparing to configure freenet..." + # 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/log/freenet.log +storeFile=/var/freenet/store +diagnosticsPath=/var/freenet/stats +nodeFile=/var/freenet/node +EOF + + CLASSPATH="/usr/lib/freenet/freenet.jar:/usr/lib/freenet/freenet-ext.jar:${CLASSPATH}" + $(java-config --java) freenet.node.Main --config + mv freenet.conf /etc + fi + einfo "Congratulations, freenet is configured and up to date" + einfo "use '/etc/init.d/freenet start' to start it" +} |