%global namedreltag -SNAPSHOT %global namedversion %{version}%{?namedreltag} %global base_name primitives %global short_name commons-%{base_name} # OSGi manifest %global with_maven 1 Name: apache-%{short_name} Version: 1.1 Release: %mkrel 2 Summary: Commons Primitives Group: Development/Java License: ASL 2.0 Url: http://commons.apache.org/primitives/ # svn export -r 678495 http://svn.apache.org/repos/asf/commons/proper/primitives/trunk/ commons-primitives-1.1 # tar czf commons-primitives-1.1-src-svn.tar.gz commons-primitives-1.1 Source0: %{short_name}-1.1-src-svn.tar.gz BuildRequires: apache-commons-parent BuildRequires: java-devel BuildRequires: jpackage-utils BuildRequires: junit BuildRequires: apache-commons-collections-testframework %if !%with_maven BuildRequires: ant BuildRequires: java-javadoc %else BuildRequires: maven-assembly-plugin BuildRequires: maven-changes-plugin BuildRequires: maven-checkstyle-plugin BuildRequires: maven-compiler-plugin BuildRequires: maven-install-plugin BuildRequires: maven-jar-plugin BuildRequires: maven-javadoc-plugin BuildRequires: maven-surefire-plugin %endif Requires: jpackage-utils Requires(post): jpackage-utils Requires(postun): jpackage-utils Requires: java BuildArch: noarch %description Commons Primitives is a set of collection and utility classes for primitive types. The Java language has a clear distinction between Object and primitive types. A lot of functionality is provided for Object types, including the Java Collection Framework. Relatively little functionality is provided by the JDK for primitives. This package addresses this by providing a set of utility and collection classes for primitives. %package javadoc Summary: Javadocs for %{name} Group: Development/Java Requires: jpackage-utils %description javadoc This package contains the API documentation for %{name}. %prep %setup -q -n %{short_name}-%{version} for j in $(find . -name "*.jar" -o -name '*.class' ); do rm -rf $j done %if !%with_maven sed -i "s|/usr/local/junit3.8.1|%{_javadir}|" build.xml sed -i 's|${target.javadoc}/api|target/site/apidocs|' build.xml %endif %build %if %with_maven mvn-rpmbuild -e install javadoc:aggregate %else ant \ -Dcollections-testframework.jar=$(build-classpath commons-collections-testframework) \ -Dfinal.name=%{short_name}-%{namedversion} \ jar javadoc test %endif %install [ %{buildroot} != / ] && rm -rf %{buildroot} mkdir -p %{buildroot}%{_javadir} install -pm 644 target/%{short_name}-%{namedversion}.jar \ %{buildroot}%{_javadir}/%{name}-%{version}.jar ( cd %{buildroot}%{_javadir} for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"` done ) ( cd %{buildroot}%{_javadir} for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"` done ) mkdir -p %{buildroot}%{_mavenpomdir} install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom %add_maven_depmap JPP-%{short_name}.pom %{short_name}.jar %add_to_maven_depmap org.apache.commons %{base_name} %{version} JPP %{short_name} mkdir -p %{buildroot}%{_javadocdir}/%{short_name} cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{short_name} %post %update_maven_depmap %postun %update_maven_depmap %files %{_javadir}/%{name}-%{version}.jar %{_javadir}/%{name}.jar %{_javadir}/%{short_name}-%{version}.jar %{_javadir}/%{short_name}.jar %{_mavenpomdir}/* %{_mavendepmapfragdir}/* %doc LICENSE.txt NOTICE.txt PROPOSAL.html RELEASE-NOTES.txt STATUS.txt %files javadoc %{_javadocdir}/%{short_name} %changelog * Fri Jan 11 2013 umeabot <umeabot> 1.1-2.mga3 + Revision: 345819 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Mon Nov 07 2011 gil <gil> 1.1-1.mga2 + Revision: 164811 - imported package apache-commons-primitives