384
|
1
|
|
2 EAPI="5"
|
|
3
|
|
4 inherit java-pkg-2
|
|
5
|
|
6 MY_PN=apache-${PN%%-bin}
|
|
7 MY_PV=${PV/_alpha/-alpha-}
|
|
8 MY_P="${MY_PN}-${MY_PV}"
|
|
9 MY_MV="${PV%%.*}"
|
|
10
|
|
11 DESCRIPTION="Project Management and Comprehension Tool for Java"
|
|
12 SRC_URI="mirror://apache/maven/maven-${MY_MV}/${PV}/binaries/${MY_P}-bin.tar.gz"
|
|
13 HOMEPAGE="http://maven.apache.org/"
|
|
14
|
|
15 LICENSE="Apache-2.0"
|
|
16 SLOT="3.2"
|
|
17 KEYWORDS="amd64 x86"
|
|
18
|
|
19 DEPEND="|| ( app-admin/eselect-java app-admin/eselect-maven )"
|
|
20
|
|
21 RDEPEND=">=virtual/jdk-1.5
|
|
22 ${DEPEND}"
|
|
23
|
|
24 S="${WORKDIR}/${MY_P}"
|
|
25
|
|
26 MAVEN=${PN}-${SLOT}
|
|
27 MAVEN_SHARE="/usr/share/${MAVEN}"
|
|
28
|
|
29 java_prepare() {
|
|
30 rm -v "${S}"/bin/*.bat || die
|
|
31 chmod 644 "${S}"/boot/*.jar "${S}"/lib/*.jar "${S}"/conf/settings.xml || die
|
|
32 }
|
|
33
|
|
34 src_install() {
|
|
35 dodir "${MAVEN_SHARE}"
|
|
36
|
|
37 cp -Rp bin boot conf lib "${ED}/${MAVEN_SHARE}" || die "failed to copy"
|
|
38
|
|
39 java-pkg_regjar "${ED}/${MAVEN_SHARE}"/boot/*.jar
|
|
40 java-pkg_regjar "${ED}/${MAVEN_SHARE}"/lib/*.jar
|
|
41
|
|
42 dodoc README.txt
|
|
43
|
|
44 dodir /usr/bin
|
|
45 dosym "${MAVEN_SHARE}/bin/mvn" /usr/bin/mvn-${SLOT}
|
|
46
|
|
47 # See bug #342901.
|
|
48 echo "CONFIG_PROTECT=\"${MAVEN_SHARE}/conf\"" > "${T}/25${MAVEN}" || die
|
|
49 doenvd "${T}/25${MAVEN}"
|
|
50 }
|
|
51
|
|
52 pkg_postinst() {
|
|
53 eselect maven update mvn-${SLOT}
|
|
54 }
|
|
55
|
|
56 pkg_postrm() {
|
|
57 eselect maven update
|
|
58 }
|