Packaged dev-java/joda-convert (a dependency of dev-java/jodata-convert-2.0.
authorW. Trevor King <wking@drexel.edu>
Sat, 8 Oct 2011 15:15:51 +0000 (11:15 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 8 Oct 2011 15:15:51 +0000 (11:15 -0400)
dev-java/joda-convert/Manifest [new file with mode: 0644]
dev-java/joda-convert/files/1.1-build.xml [new file with mode: 0644]
dev-java/joda-convert/joda-convert-9999.ebuild [new file with mode: 0644]

diff --git a/dev-java/joda-convert/Manifest b/dev-java/joda-convert/Manifest
new file mode 100644 (file)
index 0000000..a1fd31b
--- /dev/null
@@ -0,0 +1,2 @@
+AUX 1.1-build.xml 3819 RMD160 a6be19d47be61f5d2019cfb93d85318b56bcfc61 SHA1 d258b44e22445f77422567e660e04fc3f66f3426 SHA256 57571f3abdd51f9048acf47104a732aa4d6a3bbf7ae74221991dc5b64c335e59
+EBUILD joda-convert-9999.ebuild 1407 RMD160 1b31955faa9db4f2fc698ea496b0067261707400 SHA1 bc2a022a9ba5d517d80e2ccb494d74beb60f63ce SHA256 e4f62456fc46ed13bbe4839b58382ae21f08854615605333732e0212dc0eaa71
diff --git a/dev-java/joda-convert/files/1.1-build.xml b/dev-java/joda-convert/files/1.1-build.xml
new file mode 100644 (file)
index 0000000..07fe6e0
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<project name="Joda convert" default="all" basedir=".">
+  <target name="init" description="Sets build properties">
+    <!-- package configuration -->
+    <property name="package.version" value="devel"/>
+    <!-- directory locations -->
+    <property name="src" value="${basedir}/src"/>
+    <property name="src.lib" value="${src}/main/java"/>
+    <property name="src.test" value="${src}/test/java"/>
+    <property name="build" value="${basedir}/build"/>
+    <property name="build.lib" value="${build}/lib"/>
+    <property name="build.test" value="${build}/test"/>
+    <property name="doc" value="${basedir}/doc"/>
+    <property name="doc.api" value="${doc}/api"/>
+    <!-- external dependencies -->
+    <property name="junit.jar" value="junit.jar"/>
+    <!-- classpaths -->
+    <path id="project.class.path">
+    </path>
+    <path id="test.class.path">
+      <!--pathelement location="${junit.jar}"/--> <!-- handled by Gentoo's ANT_TASKS -->
+    </path>
+    <path id="build.lib.class.path">
+      <pathelement location="${build.lib}"/>
+    </path>
+    <path id="build.test.class.path">
+      <pathelement location="${build.test}"/>
+    </path>
+  </target>
+  <target name="all" depends="jar,javadoc"
+          description="Pseudo-target that builds JAR and Javadoc"/>
+  <target name="build-lib" depends="init"
+          description="Compiles the library classes">
+    <mkdir dir="${build.lib}"/>
+    <javac destdir="${build.lib}" srcdir="${src.lib}" debug="true"
+           deprecation="true" includeantruntime="false">
+      <classpath refid="project.class.path"/>
+      <classpath refid="build.lib.class.path"/>
+      <!--compilerarg line="-Xlint:unchecked"/-->
+    </javac>
+    <!--copy todir="${build}">
+      <mappedresources>
+        <fileset dir="${src}" includes="**/test/test.fits*"/>
+        <globmapper from="*" to="*"/>
+      </mappedresources>
+    </copy-->
+  </target>
+  <target name="build-tests" depends="build-lib"
+          description="Compiles the test classes">
+    <mkdir dir="${build.test}"/>
+    <javac destdir="${build.test}" srcdir="${src.test}" debug="true"
+           deprecation="true" includeantruntime="false">
+      <classpath refid="project.class.path"/>
+      <classpath refid="test.class.path"/>
+      <classpath refid="build.lib.class.path"/>
+    </javac>
+  </target>
+  <target name="build" depends="build-lib"
+          description="Alias for build-lib"/>
+  <target name="test" depends="build-tests">
+    <junit>
+      <classpath refid="project.class.path"/>
+      <classpath refid="test.class.path"/>
+      <classpath refid="build.lib.class.path"/>
+      <classpath refid="build.test.class.path"/>
+      <formatter type="brief" usefile="false" />
+      <batchtest>
+        <fileset dir="${build.test}">
+          <include name="**/*.class" />
+          <exclude name="**/*$*.class" />
+        </fileset>
+      </batchtest>
+    </junit>
+  </target>
+  <target name="javadoc" depends="init"
+          description="Generates Javadoc API documentation">
+    <mkdir dir="${doc.api}"/>
+    <javadoc packagenames="*"
+             sourcepath="${src.lib}" destdir="${doc.api}"
+             author="true"       version="true"
+             use="true"          private="true"/>
+  </target>
+  <target name="jar" depends="build-lib"
+          description="Builds a project JAR file">
+    <jar basedir="${build.lib}" jarfile="${build}/joda-convert.jar">
+      <manifest>
+        <attribute name="Version" value="${package.version}"/>
+      </manifest>
+    </jar>
+  </target>
+  <target name="clean" depends="init"
+          description="Erase all generated files and dirs">
+    <delete dir="${build}" verbose="true"/>
+    <delete dir="${doc}" verbose="true"/>
+    <delete verbose="true">
+        <fileset dir="${basedir}" includes="*.jar"/>
+    </delete>
+  </target>
+</project>
diff --git a/dev-java/joda-convert/joda-convert-9999.ebuild b/dev-java/joda-convert/joda-convert-9999.ebuild
new file mode 100644 (file)
index 0000000..e070e88
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+JAVA_PKG_IUSE="doc examples source test"
+
+inherit java-pkg-2 java-ant-2
+
+if [[ "${PV}" == "9999" ]]; then
+       inherit git-2
+       EGIT_REPO_URI="git://github.com/JodaOrg/${PN}.git"
+       SRC_URI=""
+       MY_P="${P}"
+else
+       #MY_P="${P}-src"
+       #SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+       #S="${WORKDIR}/${MY_P}"
+       SRC_URI="http://github.com/JodaOrg/${PN}/tarball/v${PV} -> ${P}.tar.gz"
+fi
+
+DESCRIPTION="A Java library for Object <-> String conversion."
+HOMEPAGE="http://${PN}.sourceforge.net/"
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+DEPEND="
+       >=virtual/jdk-1.5
+       test? (
+               dev-java/ant-junit4
+               dev-java/hamcrest-core
+       )"
+RDEPEND=">=virtual/jre-1.5"
+
+JAVA_PKG_WANT_SOURCE="5"
+EANT_EXTRA_ARGS="-Dpacakge.version=${PV}"
+EANT_GENTOO_CLASSPATH="junit-4"
+JAVA_ANT_REWRITE_CLASSPATH="true"
+
+src_unpack() {
+       # Work around GitHub's "${PN}-<SHA1>" directory name
+       if [[ "${PV}" == "9999" ]]; then
+               git-2_src_unpack
+       else
+               unpack "${A}"
+               mv "${PN}"-* "${S}"
+       fi
+}
+
+src_prepare() {
+       cp "${FILESDIR}/1.1-build.xml" build.xml
+}
+
+src_test() {
+       ANT_TASKS="ant-junit4" eant test
+}
+
+src_install() {
+       java-pkg_newjar "build/${PN}.jar" "${PN}.jar"
+
+       dodoc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt || die
+       use doc && java-pkg_dojavadoc doc/api
+       use source && java-pkg_dosrc src/main/java/*
+}