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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun Oct 14 10:27:36 2012 UTC (21 months, 2 weeks ago) by tommy
Branch: MAIN
Version bump, drop old, finally fix bug 429716

(Portage version: 2.2.0_alpha137-r1/cvs/Linux x86_64)

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_p1407.ebuild,v 1.4 2012/06/22 18:37:41 tommy Exp $
4
5 EAPI="2"
6 DATE=20120730
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="freemail test"
21
22 CDEPEND="freemail? ( >=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="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.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_p1389-wrapper.conf freenet-wrapper.conf || die
75 cp "${FILESDIR}"/run.sh-20090501 run.sh || die
76 epatch "${FILESDIR}"/0.7.5_p1302-ext.patch \
77 "${FILESDIR}"/freenet-0.7.5_p1384-nativebiginteger-no-nativedoublevalue.patch
78
79 EPATCH_OPTS+=" -R"
80 epatch "${FILESDIR}"/libraryloader-revert-using-of-absolute-path.patch
81
82 sed -i -e "s:=/usr/lib:=/usr/$(get_libdir):g" \
83 freenet-wrapper.conf || die "sed failed"
84
85 echo "wrapper.java.classpath.1=/usr/share/freenet/lib/freenet.jar" >> freenet-wrapper.conf
86
87 local i=2 pkg jars jar
88 local ifs_original=${IFS}
89 IFS=","
90 for pkg in ${EANT_GENTOO_CLASSPATH} ; do
91 jars="$(java-pkg_getjars ${pkg})"
92 for jar in ${jars} ; do
93 echo "wrapper.java.classpath.$((i++))=${jar}" >> freenet-wrapper.conf
94 done
95 done
96 IFS=${ifs_original}
97 echo "wrapper.java.classpath.$((i++))=/usr/share/freenet/lib/ant.jar" >> freenet-wrapper.conf
98
99 if use freemail ; then
100 jars="$(java-pkg_getjars bcprov)"
101 for jar in ${jars} ; do
102 echo "wrapper.java.classpath.$((i++))=${jar}" >> freenet-wrapper.conf
103 done
104 fi
105
106 cp "${DISTDIR}"/freenet-ant-1.7.1.jar lib/ant.jar || die
107 }
108
109 EANT_TEST_EXTRA_ARGS="-Dtest.skip=false"
110
111 src_test() {
112 java-pkg-2_src_test
113 }
114
115 src_install() {
116 java-pkg_dojar dist/freenet.jar
117 java-pkg_newjar "${DISTDIR}"/freenet-ant-1.7.1.jar ant.jar
118 if has_version =sys-apps/baselayout-2*; then
119 doinitd "${FILESDIR}"/freenet
120 else
121 newinitd "${FILESDIR}"/freenet.old freenet
122 fi
123 dodoc AUTHORS README || die
124 insinto /etc
125 doins freenet-wrapper.conf || die
126 insinto /var/freenet
127 doins run.sh || die
128 newins "${WORKDIR}"/seednodes-${DATE}.fref seednodes.fref || die
129 fperms +x /var/freenet/run.sh
130 dosym java-service-wrapper/libwrapper.so /usr/$(get_libdir)/libwrapper.so
131 use doc && java-pkg_dojavadoc javadoc
132 use source && java-pkg_dosrc src
133 }
134
135 pkg_postinst() {
136 elog " "
137 elog "1. Start freenet with /etc/init.d/freenet start."
138 elog "2. Open localhost:8888 in your browser for the web interface."
139 #workaround for previously existing freenet user
140 [[ $(stat --format="%U" /var/freenet) == "freenet" ]] || chown \
141 freenet:freenet /var/freenet
142 }
143
144 pkg_postrm() {
145 if ! [[ -e /usr/share/freenet/lib/freenet.jar ]] ; then
146 elog " "
147 elog "If you dont want to use freenet any more"
148 elog "and dont want to keep your identity/other stuff"
149 elog "remember to do 'rm -rf /var/freenet' to remove everything"
150 fi
151 }

  ViewVC Help
Powered by ViewVC 1.1.20