# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 JAVA_PKG_IUSE="source" inherit java-pkg-2 java-ant-2 eutils rpm RPM_VER="1.1" OPSI="opsi40-testing" SUSE="openSUSE_13.1" DESCRIPTION="opsi depot server" HOMEPAGE="http://opsi.org/" SRC_URI="http://download.opensuse.org/repositories/home:/uibmz:/opsi:/${OPSI}/${SUSE}/src/${P}-${RPM_VER}.src.rpm" LICENSE="GPL-2" IUSE="" KEYWORDS="~amd64 ~arm ~x86" COMMON_DEP="dev-java/swingx:1.6 dev-java/commons-io:1" RDEPEND=">=virtual/jre-1.6 ${COMMON_DEP}" DEPEND=">=virtual/jdk-1.6 ${COMMON_DEP}" RESTRICT="" SLOT="0" java_prepare() { rm -rf *.jar mv classes build } src_compile() { ejavac -encoding UTF-8 -sourcepath src -classpath $(java-pkg_getjars swingx-1.6):$(java-pkg_getjars commons-io-1) -d build src/de/uib/configed/configed.java ejavac -encoding UTF-8 -sourcepath src -classpath $(java-pkg_getjars swingx-1.6):$(java-pkg_getjars commons-io-1) -d build src/de/uib/configed/configedApplet.java ejavac -encoding UTF-8 javainfo.java jar -cvfm configed.jar MANIFEST.MF -C build/ . # get the swingx.jar for the java webstart into the right place cp "${ROOT}"/usr/share/swingx-1.6/lib/swingx.jar . cp "${ROOT}"/usr/share/commons-io-1/lib/commons-io.jar . rm -rf keystore cat /dev/urandom | tr -dc A-Za-z0-9 | head -c12 > pass keytool -genkeypair -dname "cn=opsi.org" -alias opsi.org -keypass $(cat pass) -keystore keystore -storepass $(cat pass) -validity 1000 jarsigner -keystore keystore -storepass $(cat pass) configed.jar opsi.org jarsigner -keystore keystore -storepass $(cat pass) swingx.jar opsi.org jarsigner -keystore keystore -storepass $(cat pass) commons-io.jar opsi.org rm -rf pass } src_install() { java-pkg_jarinto /usr/lib/configed insinto /usr/lib/configed doins index.html javainfo.class java-pkg_dojar "${S}"/configed.jar "${S}"/swingx.jar "${S}"/commons-io.jar java-pkg_dolauncher ${PN} --main de.uib.configed.configed insinto /usr/share/configed doins configed_icon.png newicon configed_icon.png ${PN}.png make_desktop_entry ${PN} "Opsi Configuration Editor" ${PN} "Settings;Utility" use source && java-pkg_dosrc "${S}"/src/* }