dev-qt/qthelp: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / sci-geosciences / josm / josm-10966.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 JAVA_ANT_ENCODING=UTF-8
7
8 [[ ${PV} == "9999" ]] && SUBVERSION_ECLASS="subversion"
9 ESVN_REPO_URI="https://josm.openstreetmap.de/svn/trunk"
10 inherit eutils java-pkg-2 java-ant-2 ${SUBVERSION_ECLASS}
11 unset SUBVERSION_ECLASS
12
13 DESCRIPTION="Java-based editor for the OpenStreetMap project"
14 HOMEPAGE="https://josm.openstreetmap.de/"
15 # Upstream doesn't provide versioned tarballs, so we'll have to create one on our own:
16 # REVISION=${PV}
17 # mkdir -p josm-${REVISION}
18 # svn co -r ${REVISION} https://josm.openstreetmap.de/svn/trunk/ josm-${REVISION}
19 # cd josm-${REVISION} && ant init-svn-revision-xml && cd -
20 # tar -cz  --exclude=.svn -f /usr/portage/distfiles/josm-${REVISION}.tar.gz josm-${REVISION}
21 [[ ${PV} == "9999" ]] || SRC_URI="mirror://gentoo/${P}.tar.gz"
22
23 LICENSE="GPL-2"
24 SLOT="0"
25
26 # Don't move KEYWORDS on the previous line or ekeyword won't work # 399061
27 [[ ${PV} == "9999" ]] || \
28 KEYWORDS="amd64 x86"
29
30 DEPEND=">=virtual/jdk-1.8"
31 RDEPEND=">=virtual/jre-1.8"
32
33 IUSE=""
34
35 src_prepare() {
36
37         if [[ ${PV} == "9999" ]]; then
38
39                 # create-revision needs the compile directory to be a svn directory
40                 # see also https://lists.openstreetmap.org/pipermail/dev/2009-March/014182.html
41                 sed -i \
42                         -e "s:arg[ ]value=\".\":arg value=\"${ESVN_STORE_DIR}\/${PN}\/trunk\":" \
43                         build.xml || die "sed failed"
44
45         else
46
47                 # Remove dependency on git and svn just for generating a
48                 # revision - the tarball should already have REVISION.XML
49                 sed -i -e 's:, *init-git-revision-xml::g' \
50                         -e '/<exec[ \t].*"svn"[ \t].*/,+5{d;n;}' \
51                         -e 's:${svn.info.result}:1:' \
52                         build.xml || die "sed failed"
53
54         fi
55
56 }
57
58 src_compile() {
59         eant dist-optimized
60 }
61
62 src_install() {
63         java-pkg_newjar "dist/${PN}-custom-optimized.jar" "${PN}.jar" || die "java-pkg_newjar failed"
64         java-pkg_dolauncher "${PN}" --jar "${PN}.jar" || die "java-pkg_dolauncher failed"
65
66         newicon images/logo.png josm.png || die "newicon failed"
67         make_desktop_entry "${PN}" "Java OpenStreetMap Editor" josm "Utility;Science;Geoscience"
68 }