summaryrefslogtreecommitdiff
path: root/dev-java/stringprep/stringprep-2.2.ebuild
blob: 0c0be2c3c2c4e373cc453660c8d4cfd703ee2513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# tests are wip
JAVA_PKG_IUSE="doc source"
MAVEN_ID="com.ongres.stringprep:stringprep:2.2"

inherit java-pkg-2 java-pkg-simple

DESCRIPTION="Stringprep (RFC 3454) Java implementation"
HOMEPAGE="https://gitlab.com/ongresinc/stringprep"
SRC_URI="https://github.com/ongres/stringprep/archive/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${P}"

LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"

DEPEND=">=virtual/jdk-11:*"	# module-info
RDEPEND=">=virtual/jre-1.8:*"

JAVADOC_SRC_DIRS=( {string,name,sasl}prep/src/main/java )

src_compile() {
	mkdir -p target/classes || die
	local module
	for module in stringprep nameprep saslprep; do
		einfo "Compiling ${module}"
		JAVA_JAR_FILENAME="${module}.jar"
		JAVA_SRC_DIR=( "${module}"/src/main/java{,9} )
		if [[ -d "${module}/src/main/resources" ]]; then
			JAVA_RESOURCE_DIRS="${module}/src/main/resources"
		fi
		java-pkg-simple_src_compile
		JAVA_GENTOO_CLASSPATH_EXTRA+=":${module}.jar"
		rm -r target || die
	done

	use doc && ejavadoc
}

src_install() {
	JAVA_JAR_FILENAME="stringprep.jar"
	java-pkg-simple_src_install
	java-pkg_dojar {name,sasl}prep.jar

	local module
	for module in stringprep nameprep saslprep; do
		if use source; then
			java-pkg_dosrc "${module}/src/main/java/*"
		fi
	done
}