dev-java/maven-bin: Version bump courtesy of Thanh Ha <zxiiro@gmail.com>. Fixes bug...
[gentoo.git] / dev-java / icedtea-bin / icedtea-bin-6.1.13.7.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit java-vm-2 prefix versionator
8
9 dist="https://dev.gentoo.org/~chewi/distfiles"
10 TARBALL_VERSION="${PV}"
11
12 DESCRIPTION="A Gentoo-made binary build of the IcedTea JDK"
13 HOMEPAGE="http://icedtea.classpath.org"
14 SRC_URI="doc? ( ${dist}/${PN}-doc-${TARBALL_VERSION}.tar.xz )
15         source? ( ${dist}/${PN}-src-${TARBALL_VERSION}.tar.xz )"
16
17 for arch in amd64 ppc x86; do
18         SRC_URI+="
19                 ${arch}? (
20                         ${dist}/${PN}-core-${TARBALL_VERSION}-${arch}.tar.xz
21                         examples? ( ${dist}/${PN}-examples-${TARBALL_VERSION}-${arch}.tar.xz )
22                 )"
23 done
24
25 LICENSE="GPL-2-with-linking-exception"
26 SLOT="6"
27 KEYWORDS="-* amd64 ppc x86"
28
29 IUSE="+X +alsa cjk +cups doc examples nsplugin selinux source webstart"
30 REQUIRED_USE="nsplugin? ( X )"
31 RESTRICT="strip"
32
33 # 423161
34 QA_PREBUILT="opt/.*"
35
36 ALSA_COMMON_DEP="
37         >=media-libs/alsa-lib-1.0"
38 CUPS_COMMON_DEP="
39         >=net-print/cups-2.0"
40 X_COMMON_DEP="
41         >=media-libs/freetype-2.5:2
42         >=x11-libs/gtk+-2.24:2
43         >=x11-libs/libX11-1.6
44         >=x11-libs/libXext-1.3
45         >=x11-libs/libXi-1.7
46         >=x11-libs/libXrender-0.9.4
47         >=x11-libs/libXtst-1.2"
48
49 COMMON_DEP="
50         >=media-libs/giflib-4.1.6-r1
51         >=media-libs/lcms-2.6:2
52         media-libs/libpng:0/16
53         >=sys-devel/gcc-4.8.4
54         >=sys-libs/glibc-2.20
55         >=sys-libs/zlib-1.2.3-r1
56         virtual/jpeg:62"
57
58 RDEPEND="${COMMON_DEP}
59         X? (
60                 ${X_COMMON_DEP}
61                 media-fonts/dejavu
62                 cjk? (
63                         media-fonts/arphicfonts
64                         media-fonts/baekmuk-fonts
65                         media-fonts/lklug
66                         media-fonts/lohit-fonts
67                         media-fonts/sazanami
68                 )
69         )
70         alsa? ( ${ALSA_COMMON_DEP} )
71         cups? ( ${CUPS_COMMON_DEP} )
72         selinux? ( sec-policy/selinux-java )"
73
74 PDEPEND="webstart? ( dev-java/icedtea-web:0 )
75         nsplugin? ( dev-java/icedtea-web:0[nsplugin] )"
76
77 src_prepare() {
78         # Ensures HeadlessGraphicsEnvironment is used.
79         if ! use X; then
80                 rm -r jre/lib/$(get_system_arch)/xawt || die
81         fi
82
83         # Reprefixify because prefix may be different.
84         sed -i 's:=/:=@GENTOO_PORTAGE_EPREFIX@/:' jre/lib/fontconfig.Gentoo.properties || die
85         eprefixify jre/lib/fontconfig.Gentoo.properties
86 }
87
88 src_install() {
89         local dest="/opt/${P}"
90         local ddest="${ED}${dest#/}"
91         dodir "${dest}"
92
93         # doins doesn't preserve executable bits.
94         cp -pRP bin include jre lib man "${ddest}" || die
95
96         dodoc doc/{ASSEMBLY_EXCEPTION,AUTHORS,NEWS,README,THIRD_PARTY_README}
97         use doc && dodoc -r doc/html
98
99         if use examples; then
100                 cp -pRP demo sample "${ddest}" || die
101         fi
102
103         if use source; then
104                 cp src.zip "${ddest}" || die
105         fi
106
107         if use webstart || use nsplugin; then
108                 dosym /usr/libexec/icedtea-web/itweb-settings "${dest}/bin/itweb-settings"
109                 dosym /usr/libexec/icedtea-web/itweb-settings "${dest}/jre/bin/itweb-settings"
110         fi
111         if use webstart; then
112                 dosym /usr/libexec/icedtea-web/javaws "${dest}/bin/javaws"
113                 dosym /usr/libexec/icedtea-web/javaws "${dest}/jre/bin/javaws"
114         fi
115
116         set_java_env
117         java-vm_revdep-mask "${dest}"
118         java-vm_sandbox-predict /proc/self/coredump_filter
119 }
120
121 pkg_preinst() {
122         if has_version "<=dev-java/icedtea-bin-1.10.4:${SLOT}"; then
123                 # portage would preserve the symlink otherwise, related to bug #384397
124                 rm -f "${EROOT}/usr/lib/jvm/icedtea6-bin"
125                 elog "To unify the layout and simplify scripts, the identifier of Icedtea-bin-6*"
126                 elog "has changed from 'icedtea6-bin' to 'icedtea-bin-6' starting from version 6.1.10.4"
127                 elog "If you had icedtea6-bin as system VM, the change should be automatic, however"
128                 elog "build VM settings in /etc/java-config-2/build/jdk.conf are not changed"
129                 elog "and the same holds for any user VM settings. Sorry for the inconvenience."
130         fi
131 }
132
133 pkg_postinst() {
134         if use nsplugin; then
135                 if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 6.1.13.3-r1 ${REPLACING_VERSIONS} ]]; then
136                         elog "The nsplugin for icedtea-bin is now provided by the icedtea-web package"
137                         elog "If you had icedtea-bin-6 nsplugin selected, you may see a related error below"
138                         elog "The switch should complete properly during the subsequent installation of icedtea-web"
139                         elog "Afterwards you may verify the output of 'eselect java-nsplugin list' and adjust accordingly'"
140                 fi
141         fi
142
143         # Set as default VM if none exists
144         java-vm-2_pkg_postinst
145 }