packages: java-commons-math/java-commons-math.spec, java-commons-math/notes...

glen glen at pld-linux.org
Wed Apr 20 22:24:26 CEST 2011


Author: glen                         Date: Wed Apr 20 20:24:26 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- disable testing, packages now

---- Files affected:
packages/java-commons-math:
   java-commons-math.spec (1.1 -> 1.2) , notest.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/java-commons-math/java-commons-math.spec
diff -u packages/java-commons-math/java-commons-math.spec:1.1 packages/java-commons-math/java-commons-math.spec:1.2
--- packages/java-commons-math/java-commons-math.spec:1.1	Wed Apr 20 22:06:07 2011
+++ packages/java-commons-math/java-commons-math.spec	Wed Apr 20 22:24:20 2011
@@ -1,28 +1,29 @@
 # $Revision$, $Date$
 # TODO
-# - target jar depends on "tests", meaning not possible to build jar without
-#   tests passing
+# - tests fail. a lot
+# - junit needed for compile target
 #
 # Conditional build:
 %bcond_without	javadoc		# don't build javadoc
-%bcond_without	tests		# don't build and run tests
+%bcond_with	tests		# don't build and run tests
 
 %define		srcname		commons-math
 %include	/usr/lib/rpm/macros.java
 Summary:	Java library of lightweight mathematics and statistics components
 Name:		java-%{srcname}
 Version:	2.2
-Release:	0.1
+Release:	1
 License:	ASL 1.1 and ASL 2.0 and BSD
 Group:		Development/Libraries
 URL:		http://commons.apache.org/math/
 Source0:	http://www.apache.org/dist/commons/math/source/%{srcname}-%{version}-src.tar.gz
 # Source0-md5:	6261d7991154c992477b32b8f3bea18b
+Patch0:		notest.patch
+BuildRequires:	java-junit >= 4.3
 BuildRequires:	jdk >= 1.6
 BuildRequires:	jpackage-utils
 BuildRequires:	rpm-javaprov
 BuildRequires:	rpmbuild(macros) >= 1.555
-%{?with_tests:BuildRequires:	java-junit >= 4.3}
 %if %(locale -a | grep -q '^en_US$'; echo $?)
 BuildRequires:	glibc-localedb-all
 %endif
@@ -45,31 +46,55 @@
 
 %prep
 %setup -q -n commons-math-%{version}-src
+%patch0 -p1
 
 %build
 # source code not US-ASCII
 export LC_ALL=en_US
 
-%if %{with tests}
-junit=$(find-jar junit)
-%endif
-
 %ant \
 	-Dskip.download=1 \
-	-Djunit.jar=$junit \
 	jar %{?with_javadoc:javadoc}
 
+%if %{with tests}
+junit=$(find-jar junit)
+%ant \
+	-Djunit.jar=$junit
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_javadir}
+
+# jars
+cp -p target/%{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}-%{version}.jar
+ln -s %{srcname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{srcname}.jar
+
+# javadoc
+%if %{with javadoc}
+install -d $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version}
+cp -a target/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{srcname}-%{version}
+ln -s %{srcname}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{srcname} # ghost symlink
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post javadoc
+ln -nfs %{srcname}-%{version} %{_javadocdir}/%{srcname}
+
 %files
 %defattr(644,root,root,755)
 %doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
+%{_javadir}/%{srcname}.jar
+%{_javadir}/%{srcname}-%{version}.jar
 
+%if %{with javadoc}
 %files javadoc
+%defattr(644,root,root,755)
+%{_javadocdir}/%{srcname}-%{version}
+%ghost %{_javadocdir}/%{srcname}
+%endif
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -77,5 +102,8 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2011/04/20 20:24:20  glen
+- disable testing, packages now
+
 Revision 1.1  2011/04/20 20:06:07  glen
 - new, can't package as tests fail and jar target pulls testing

================================================================
Index: packages/java-commons-math/notest.patch
diff -u /dev/null packages/java-commons-math/notest.patch:1.1
--- /dev/null	Wed Apr 20 22:24:26 2011
+++ packages/java-commons-math/notest.patch	Wed Apr 20 22:24:20 2011
@@ -0,0 +1,11 @@
+--- commons-math-2.2-src/build.xml~	2011-02-26 20:12:55.000000000 +0200
++++ commons-math-2.2-src/build.xml	2011-04-20 23:07:02.289885444 +0300
+@@ -247,7 +247,7 @@
+ 
+ <!-- ========== Create Jar ================================================ -->
+ 
+-  <target name="jar" depends="test" description="Create jar file">
++  <target name="jar" description="Create jar file">
+ 
+     <copy file="LICENSE.txt" tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
+     <copy file="NOTICE.txt"  tofile="${build.home}/classes/META-INF/NOTICE.txt"/>
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/java-commons-math/java-commons-math.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list