Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/i2p/, net-vpn/i2p/files/
Date: Sun, 11 Feb 2018 18:38:35
Message-Id: 1518374306.c5cd846a8c9f46d2480f93e612e6803d8d7947ac.mgorny@gentoo
1 commit: c5cd846a8c9f46d2480f93e612e6803d8d7947ac
2 Author: tharvik <tharvik <AT> users <DOT> noreply <DOT> github <DOT> com>
3 AuthorDate: Wed Jan 31 14:06:06 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 11 18:38:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5cd846a
7
8 net-vpn/i2p: bump to 0.9.33
9
10 Closes: https://bugs.gentoo.org/645936
11 Package-Manager: Portage-2.3.19, Repoman-2.3.6
12
13 net-vpn/i2p/Manifest | 1 +
14 net-vpn/i2p/files/i2p.init | 19 ++++++
15 net-vpn/i2p/files/i2p.service | 13 ++++
16 net-vpn/i2p/i2p-0.9.33.ebuild | 143 ++++++++++++++++++++++++++++++++++++++++++
17 4 files changed, 176 insertions(+)
18
19 diff --git a/net-vpn/i2p/Manifest b/net-vpn/i2p/Manifest
20 index 600f3894eb7..fced4eedf7f 100644
21 --- a/net-vpn/i2p/Manifest
22 +++ b/net-vpn/i2p/Manifest
23 @@ -1,2 +1,3 @@
24 DIST i2psource_0.9.30.tar.bz2 28035272 BLAKE2B 1e1b14b3126b8fd73489ddc99f7f83ea1b501d7c7ce31e11bbdb8e4a4fe33e06bf906277b7f10e912bdf54de8511c3c3d0eccf2607dcfaacb36ed89875425471 SHA512 59819125fd6aca9fd5ae25a424e78f25bd2e8f9ba995256f9bf7c1fb2a99cebf26a1dcaf1f202276f5656b4582c4b86fdcf9d23011f809b99764b0023fd243f8
25 DIST i2psource_0.9.31.tar.bz2 28745769 BLAKE2B e7766eceffb44c7c40ce176c3d98ed9a62472058c90adf1b07bbab11628d6ca4c8c62ca52526a204a6e8f47a182a59e07ccbdef65b6d2c5122d8e64e1df75406 SHA512 ffeb74d02c783febc122580b64561722de04c903e2d33fdeaf74bf3b7d725b8b7ce6556f53a12f0ae0d6c6deb413839e222bc2b8093952e5ecaf1bf96f0d1103
26 +DIST i2psource_0.9.33.tar.bz2 28985659 BLAKE2B 51b9697271c506de8d34b42ff208a12c9f0409c9aff456aa928dc2d411aceb0473878e9ed0d6ccf3684a7432c64700eec798535b4a4f4e01a2297e3d3ef7603a SHA512 ad772a422923636731350e590a14631209503c3d82db32410cb3002c790c60f9f7d950f94bb4d65ced1c2126e67a92ad65e9cd65ae3f045fc5279f57217066e2
27
28 diff --git a/net-vpn/i2p/files/i2p.init b/net-vpn/i2p/files/i2p.init
29 new file mode 100644
30 index 00000000000..bbc73b47005
31 --- /dev/null
32 +++ b/net-vpn/i2p/files/i2p.init
33 @@ -0,0 +1,19 @@
34 +#!/sbin/openrc-run
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +depend() {
39 + need net
40 +}
41 +
42 +CONFIG_PATH="/var/lib/i2p/.i2p"
43 +INSTALL_PATH="/usr/share/i2p"
44 +WRAPPER_CONF="$INSTALL_PATH/wrapper.config"
45 +
46 +command=wrapper
47 +command_args="$WRAPPER_CONF wrapper.syslog.ident=i2p wrapper.logfile=$CONFIG_PATH/wrapper.log"
48 +command_background=true
49 +command_progress=true
50 +command_user=i2p
51 +pidfile="/var/run/i2p.pid"
52 +retry='SIGTERM/20 SIGKILL/20'
53
54 diff --git a/net-vpn/i2p/files/i2p.service b/net-vpn/i2p/files/i2p.service
55 new file mode 100644
56 index 00000000000..ccbadbd4d16
57 --- /dev/null
58 +++ b/net-vpn/i2p/files/i2p.service
59 @@ -0,0 +1,13 @@
60 +[Unit]
61 +Description=Invisible Internet Project
62 +After=network.target
63 +
64 +[Service]
65 +User=i2p
66 +Type=forking
67 +ExecReload=/usr/bin/i2prouter restart
68 +ExecStart=/usr/bin/i2prouter start
69 +ExecStop=/usr/bin/i2prouter stop
70 +
71 +[Install]
72 +WantedBy=multi-user.target
73
74 diff --git a/net-vpn/i2p/i2p-0.9.33.ebuild b/net-vpn/i2p/i2p-0.9.33.ebuild
75 new file mode 100644
76 index 00000000000..cf3d2654ed1
77 --- /dev/null
78 +++ b/net-vpn/i2p/i2p-0.9.33.ebuild
79 @@ -0,0 +1,143 @@
80 +# Copyright 1999-2018 Gentoo Foundation
81 +# Distributed under the terms of the GNU General Public License v2
82 +
83 +EAPI="6"
84 +
85 +inherit java-pkg-2 java-ant-2 systemd user
86 +
87 +DESCRIPTION="A privacy-centric, anonymous network"
88 +HOMEPAGE="https://geti2p.net"
89 +SRC_URI="https://download.i2p2.de/releases/${PV}/i2psource_${PV}.tar.bz2"
90 +
91 +LICENSE="Apache-2.0 Artistic BSD CC-BY-2.5 CC-BY-3.0 CC-BY-SA-3.0 EPL-1.0 GPL-2 GPL-3 LGPL-2.1 LGPL-3 MIT public-domain WTFPL-2"
92 +SLOT="0"
93 +
94 +# Until the deps reach other arches
95 +KEYWORDS="~amd64 ~x86"
96 +IUSE="+ecdsa nls"
97 +
98 +# dev-java/ant-core is automatically added due to java-ant-2.eclass
99 +CP_DEPEND="dev-java/bcprov:1.50
100 + dev-java/jrobin:0
101 + dev-java/slf4j-api:0
102 + dev-java/tomcat-jstl-impl:0
103 + dev-java/tomcat-jstl-spec:0
104 + dev-java/java-service-wrapper:0"
105 +
106 +DEPEND="${CP_DEPEND}
107 + dev-java/eclipse-ecj:*
108 + dev-libs/gmp:0
109 + nls? ( >=sys-devel/gettext-0.19 )
110 + >=virtual/jdk-1.7"
111 +
112 +RDEPEND="${CP_DEPEND}
113 + ecdsa? (
114 + || (
115 + dev-java/icedtea:8[-sunec]
116 + dev-java/icedtea-bin:8
117 + dev-java/oracle-jre-bin
118 + dev-java/oracle-jdk-bin
119 + )
120 + )
121 + !ecdsa? ( >=virtual/jre-1.7 )"
122 +
123 +EANT_BUILD_TARGET="pkg"
124 +JAVA_ANT_ENCODING="UTF-8"
125 +
126 +pkg_setup() {
127 + java-pkg-2_pkg_setup
128 +
129 + enewgroup i2p
130 + enewuser i2p -1 -1 "${EPREFIX}/var/lib/i2p" i2p
131 +}
132 +
133 +src_prepare() {
134 + # as early as possible to allow generic patches to be applied
135 + default
136 +
137 + java-ant_rewrite-classpath
138 +
139 + java-pkg-2_src_prepare
140 +
141 + # We're on GNU/Linux, we don't need .exe files
142 + echo "noExe=true" > override.properties || die
143 + if ! use nls; then
144 + echo "require.gettext=false" >> override.properties || die
145 + fi
146 +
147 + # avoid auto starting browser
148 + sed -i 's|clientApp.4.startOnLoad=true|clientApp.4.startOnLoad=false|' \
149 + 'installer/resources/clients.config' || die
150 +
151 + # generate wrapper classpath, keeping the default to be replaced later
152 + i2p_cp='' # global forced by java-pkg_gen-cp
153 + java-pkg_gen-cp i2p_cp
154 + local lib cp i=2
155 + for lib in ${i2p_cp//,/ }
156 + do
157 + cp+="wrapper.java.classpath.$((i++))=$(java-pkg_getjars ${lib})\n"
158 + done
159 +
160 + # add generated cp and hardcode system VM
161 + sed -e "s|\(wrapper\.java\.classpath\.1=.*\)|\1\n${cp}|" \
162 + -e "s|\(wrapper\.java\.command\)=.*|\1=/etc/java-config-2/current-system-vm/bin/java|" \
163 + -e "s|\(wrapper\.java\.library\.path\.1\)=.*|\1=/usr/lib/java-service-wrapper|" \
164 + -i 'installer/resources/wrapper.config' || die
165 +
166 + # replace paths as the installer would
167 + sed -e "s|[\$%]INSTALL_PATH|${EPREFIX}/usr/share/i2p|" \
168 + -e "s|%SYSTEM_java_io_tmpdir|${EPREFIX}/var/lib/i2p/.i2p|" \
169 + -e "s|%USER_HOME|${EPREFIX}/var/lib/i2p|" \
170 + -i 'installer/resources/'{eepget,i2prouter,runplain.sh,wrapper.config} || die
171 +}
172 +
173 +src_install() {
174 + # cd into pkg-temp.
175 + cd "${S}/pkg-temp" || die
176 +
177 + # we remove system installed jar and install the others
178 + rm lib/{jrobin.jar,wrapper.jar} || \
179 + die 'unable to remove locally built jar already found in system'
180 + java-pkg_dojar lib/*.jar
181 +
182 + # Set up symlinks for binaries
183 + dodir /usr/bin
184 + # workaround portage absolute symlink limitation
185 + dosym '../share/i2p/i2prouter' '/usr/bin/i2prouter'
186 + dosym '../share/i2p/eepget' '/usr/bin/eepget'
187 +
188 + # Install main files and basic documentation
189 + exeinto '/usr/share/i2p'
190 + insinto '/usr/share/i2p'
191 + doins blocklist.txt hosts.txt *.config
192 + doexe eepget i2prouter runplain.sh
193 + dodoc history.txt INSTALL-headless.txt LICENSE.txt
194 + doman man/*
195 +
196 + # Install other directories
197 + doins -r certificates docs eepsite geoip scripts
198 + java-pkg_dowar webapps/*.war
199 +
200 + # Install daemon files
201 + newinitd "${FILESDIR}/i2p.init" i2p
202 + systemd_dounit "${FILESDIR}/i2p.service"
203 +
204 + # setup user
205 + keepdir '/var/lib/i2p/.i2p'
206 + fowners i2p:i2p '/var/lib/i2p/.i2p'
207 +}
208 +
209 +pkg_postinst() {
210 + elog "Custom configuration belongs in ${EPREFIX}/var/lib/i2p/.i2p to avoid being overwritten."
211 + elog 'I2P can be configured through the web interface at http://localhost:7657/console'
212 +
213 + if use !ecdsa
214 + then
215 + ewarn 'Currently, the i2p team does not enforce to use ECDSA keys. But it is more and'
216 + ewarn 'more pushed. To help the network, you are recommended to have the ecdsa USE.'
217 + ewarn
218 + ewarn "This is purely a run-time issue. You're free to build i2p with any JDK, as long as"
219 + ewarn 'the JVM you run it with is one of the above listed and from the same or a newer generation'
220 + ewarn 'as the one you built with.'
221 + fi
222 +}