/[gentoo-x86]/net-p2p/freenet/freenet-0.7.5_p1422.ebuild
Gentoo

Contents of /net-p2p/freenet/freenet-0.7.5_p1422.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Oct 30 18:31:09 2012 UTC (23 months, 3 weeks ago) by tommy
Branch: MAIN
Version bump, update and cleanup the wrapper config

(Portage version: 2.2.0_alpha142-r1/cvs/Linux x86_64, signed Manifest commit with key 0x35899067)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-p2p/freenet/freenet-0.7.5_p1421.ebuild,v 1.1 2012/10/25 20:46:25 tommy Exp $
4
5 EAPI="2"
6 DATE=20121030
7 JAVA_PKG_IUSE="doc source"
8
9 inherit eutils java-pkg-2 java-ant-2 multilib user
10
11 DESCRIPTION="An encrypted network without censorship"
12 HOMEPAGE="https://freenetproject.org/"
13 SRC_URI="http://github.com/${PN}/fred-official/zipball/build0${PV#*p} -> ${P}.zip
14 mirror://gentoo/seednodes-${DATE}.fref.bz2
15 mirror://gentoo/freenet-ant-1.7.1.jar"
16
17 LICENSE="as-is GPL-2"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="test"
21
22 CDEPEND=">=dev-java/bcprov-1.45:0
23 dev-java/commons-compress:0
24 dev-db/db-je:3.3
25 dev-java/fec:0
26 dev-java/java-service-wrapper:0
27 dev-java/db4o-jdk11:0
28 dev-java/db4o-jdk12:0
29 dev-java/db4o-jdk5:0
30 dev-java/jbitcollider-core:0
31 dev-java/lzma:0
32 dev-java/lzmajio:0
33 dev-java/mersennetwister:0"
34 DEPEND="app-arch/unzip
35 >=virtual/jdk-1.6
36 ${CDEPEND}
37 test? ( dev-java/junit:0
38 dev-java/ant-junit:0 )
39 dev-java/ant-core:0"
40 RDEPEND=">=virtual/jre-1.6
41 net-libs/nativebiginteger:0
42 ${CDEPEND}"
43 PDEPEND="net-libs/NativeThread:0"
44
45 JAVA_PKG_BSFIX_NAME+=" build-clean.xml"
46 JAVA_ANT_REWRITE_CLASSPATH="yes"
47 JAVA_ANT_CLASSPATH_TAGS+=" javadoc"
48 JAVA_ANT_ENCODING="utf8"
49
50 EANT_BUILD_TARGET="package"
51 EANT_TEST_TARGET="unit"
52 EANT_BUILD_XML="build-clean.xml"
53 EANT_GENTOO_CLASSPATH="bcprov,commons-compress,db4o-jdk5,db4o-jdk12,db4o-jdk11,db-je-3.3,fec,java-service-wrapper,jbitcollider-core,lzma,lzmajio,mersennetwister"
54 EANT_EXTRA_ARGS="-Dsuppress.gjs=true -Dlib.contrib.present=true -Dlib.bouncycastle.present=true -Dlib.junit.present=true -Dtest.skip=true"
55
56 pkg_setup() {
57 has_version dev-java/icedtea[cacao] && {
58 ewarn "dev-java/icedtea was built with cacao USE flag."
59 ewarn "freenet may compile with it, but it will refuse to run."
60 ewarn "Please remerge dev-java/icedtea without cacao USE flag,"
61 ewarn "if you plan to use it for running freenet."
62 }
63 java-pkg-2_pkg_setup
64 enewgroup freenet
65 enewuser freenet -1 -1 /var/freenet freenet
66 }
67
68 src_unpack() {
69 unpack ${P}.zip seednodes-${DATE}.fref.bz2
70 mv "${WORKDIR}"/freenet-fred-* "${S}"
71 }
72
73 java_prepare() {
74 cp "${FILESDIR}"/freenet-0.7.5_p1422-wrapper.conf freenet-wrapper.conf || die
75 cp "${FILESDIR}"/run.sh-20090501 run.sh || die
76 epatch "${FILESDIR}"/0.7.5_p1321-ext.patch
77
78 sed -i -e "s:=/usr/lib:=/usr/$(get_libdir):g" \
79 freenet-wrapper.conf || die "sed failed"
80
81 echo "wrapper.java.classpath.1=/usr/share/freenet/lib/freenet.jar" >> freenet-wrapper.conf
82
83 local i=2 pkg jars jar
84 local ifs_original=${IFS}
85 IFS=","
86 for pkg in ${EANT_GENTOO_CLASSPATH} ; do
87 jars="$(java-pkg_getjars ${pkg})"
88 for jar in ${jars} ; do
89 echo "wrapper.java.classpath.$((i++))=${jar}" >> freenet-wrapper.conf
90 done
91 done
92 IFS=${ifs_original}
93 echo "wrapper.java.classpath.$((i++))=/usr/share/freenet/lib/ant.jar" >> freenet-wrapper.conf
94
95 cp "${DISTDIR}"/freenet-ant-1.7.1.jar lib/ant.jar || die
96 }
97
98 EANT_TEST_EXTRA_ARGS="-Dtest.skip=false"
99
100 src_test() {
101 java-pkg-2_src_test
102 }
103
104 src_install() {
105 java-pkg_dojar dist/freenet.jar
106 java-pkg_newjar "${DISTDIR}"/freenet-ant-1.7.1.jar ant.jar
107 if has_version =sys-apps/baselayout-2*; then
108 doinitd "${FILESDIR}"/freenet
109 else
110 newinitd "${FILESDIR}"/freenet.old freenet
111 fi
112 dodoc AUTHORS README || die
113 insinto /etc
114 doins freenet-wrapper.conf || die
115 insinto /var/freenet
116 doins run.sh || die
117 newins "${WORKDIR}"/seednodes-${DATE}.fref seednodes.fref || die
118 fperms +x /var/freenet/run.sh
119 dosym java-service-wrapper/libwrapper.so /usr/$(get_libdir)/libwrapper.so
120 use doc && java-pkg_dojavadoc javadoc
121 use source && java-pkg_dosrc src
122 }
123
124 pkg_postinst() {
125 elog " "
126 elog "1. Start freenet with /etc/init.d/freenet start."
127 elog "2. Open localhost:8888 in your browser for the web interface."
128 #workaround for previously existing freenet user
129 [[ $(stat --format="%U" /var/freenet) == "freenet" ]] || chown \
130 freenet:freenet /var/freenet
131 }
132
133 pkg_postrm() {
134 if ! [[ -e /usr/share/freenet/lib/freenet.jar ]] ; then
135 elog " "
136 elog "If you dont want to use freenet any more"
137 elog "and dont want to keep your identity/other stuff"
138 elog "remember to do 'rm -rf /var/freenet' to remove everything"
139 fi
140 }

  ViewVC Help
Powered by ViewVC 1.1.20