diff options
author | James Le Cuirot <chewi@gentoo.org> | 2015-03-19 09:57:43 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2015-03-19 09:57:43 +0000 |
commit | 27958bfe4cfe72d1586418158d686c4548a7c9ac (patch) | |
tree | 0fce3e10f71db5441a5d867b79d889b7d47b1650 /eclass | |
parent | New package written by me (diff) | |
download | gentoo-2-27958bfe4cfe72d1586418158d686c4548a7c9ac.tar.gz gentoo-2-27958bfe4cfe72d1586418158d686c4548a7c9ac.tar.bz2 gentoo-2-27958bfe4cfe72d1586418158d686c4548a7c9ac.zip |
Allow jar to be named something other than ${PN}.jar.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/java-pkg-simple.eclass | 26 |
2 files changed, 21 insertions, 10 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index faa5c257e677..f2a9b66c153b 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1567 2015/03/18 13:04:35 kensington Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1568 2015/03/19 09:57:43 chewi Exp $ + + 19 Mar 2015; <chewi@gentoo.org> java-pkg-simple.eclass: + Allow jar to be named something other than ${PN}.jar. 18 Mar 2015; Michael Palimaka <kensington@gentoo.org> kde5-functions.eclass, kde5.eclass: diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index cafe40adca51..5cad139e7b08 100644 --- a/eclass/java-pkg-simple.eclass +++ b/eclass/java-pkg-simple.eclass @@ -1,10 +1,10 @@ # Eclass for simple bare-source Java packages # -# Copyright (c) 2004-2011, Gentoo Foundation +# Copyright (c) 2004-2015, Gentoo Foundation # # Licensed under the GNU General Public License, v2 # -# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-simple.eclass,v 1.3 2011/12/27 17:55:12 fauli Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-simple.eclass,v 1.4 2015/03/19 09:57:43 chewi Exp $ inherit java-utils-2 @@ -86,13 +86,21 @@ S="${WORKDIR}" # ----------------------------------------------------------------------------- # JAVADOC_ARGS +# ----------------------------------------------------------------------------- +# @variable-external JAVA_JAR_FILENAME +# @variable-default ${PN}.jar +# +# The name of the jar file to create and install +# ----------------------------------------------------------------------------- +: ${JAVA_JAR_FILENAME:=${PN}.jar} + # ------------------------------------------------------------------------------ # @eclass-src_compile # # src_compile for simple bare source java packages. Finds all *.java # sources in ${JAVA_SRC_DIR}, compiles them with the classpath # calculated from ${JAVA_GENTOO_CLASSPATH}, and packages the resulting -# classes to ${PN}.jar. +# classes to ${JAVA_JAR_FILENAME}. # # variables: # JAVA_GENTOO_CLASSPATH - list java packages to put on the classpath. @@ -138,9 +146,9 @@ java-pkg-simple_src_compile() { fi # package - local jar_args="cf ${PN}.jar" + local jar_args="cf ${JAVA_JAR_FILENAME}" if [[ -e ${classes}/META-INF/MANIFEST.MF ]]; then - jar_args="cfm ${PN}.jar ${classes}/META-INF/MANIFEST.MF" + jar_args="cfm ${JAVA_JAR_FILENAME} ${classes}/META-INF/MANIFEST.MF" fi java-pkg-simple_verbose-cmd \ jar ${jar_args} -C ${classes} . || die "jar failed" @@ -150,16 +158,16 @@ java-pkg-simple_src_compile() { # @eclass-src_install # # src_install for simple single jar java packages. Simply packages the -# contents from the target directory and installs it as ${PN}.jar. If -# the file target/META-INF/MANIFEST.MF exists, it is used as the -# manifest of the created jar. +# contents from the target directory and installs it as +# ${JAVA_JAR_FILENAME}. If the file target/META-INF/MANIFEST.MF exists, +# it is used as the manifest of the created jar. # ------------------------------------------------------------------------------ java-pkg-simple_src_install() { local sources=sources.lst classes=target/classes apidoc=target/api # main jar java-pkg-simple_verbose-cmd \ - java-pkg_dojar ${PN}.jar + java-pkg_dojar ${JAVA_JAR_FILENAME} # javadoc if has doc ${JAVA_PKG_IUSE} && use doc; then |