%global base_name betwixt %global short_name commons-%{base_name} Name: apache-commons-betwixt Version: 0.8 Release: 1%{?dist} Summary: Java bean to XML mapping library Group: Development/Libraries License: ASL 2.0 URL: http://commons.apache.org/%{base_name}/ Source0: ftp://ftp.gbnet.net/pub/apache/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz Source1: http://repo1.maven.org/maven2/%{short_name}/%{short_name}/%{version}/%{short_name}-%{version}.pom # remove: # maven-artifact-plugin 1.5 # maven-xdoc-plugin # distributionManagement.status # change: # maven-plugins maven-cobertura-plugin 1.1.1 in org.codehaus.mojo cobertura-maven-plugin 2.5.1 # aId commons-beanutils-core in commons-beanutils Patch0: %{name}-%{version}-pom.patch # fix manifest entries Patch1: %{name}-%{version}-manifest.patch BuildRequires: java-devel BuildRequires: jpackage-utils BuildRequires: ant BuildRequires: ant-junit BuildRequires: apache-commons-beanutils BuildRequires: apache-commons-collections BuildRequires: apache-commons-digester BuildRequires: apache-commons-logging BuildRequires: xerces-j2 BuildRequires: xml-commons-apis Requires: apache-commons-beanutils Requires: apache-commons-collections Requires: apache-commons-digester Requires: apache-commons-logging Requires: xerces-j2 Requires: xml-commons-apis Requires: java Requires: jpackage-utils BuildArch: noarch %description The Betwixt library provides an XML introspection mechanism for mapping beans to XML in a flexible way. It is implemented using an XMLIntrospector and XMLBeanInfo classes which are similar to the standard Introspector and BeanInfo from the Java Beans specification. Betwixt provides a way of turning beans into XML as well as automatically generating digester rules in a way that can be customized on a per type manner in the same way that the BeanInfo mechanism can be used to customize the default introspection on a java object. %package javadoc Group: Documentation Summary: Javadoc for %{name} Requires: jpackage-utils %description javadoc This package contains javadoc for %{name}. %prep %setup -q -n %{short_name}-%{version}-src find . -name '*.class' -delete find . -name '*.jar' -delete cp -p %{SOURCE1} pom.xml %patch0 -p0 %patch1 -p0 # fix non ASCII chars for s in src/test/org/apache/commons/betwixt/strategy/TestBadCharacterReplacingNMapper.java\ src/test/org/apache/commons/betwixt/strategy/TestDefaultNameMapper.java;do native2ascii -encoding UTF8 ${s} ${s} done # require commons-digester-rss in classpath rm src/test/org/apache/commons/betwixt/TestRSSRoundTrip.java %build export CLASSPATH=$(build-classpath commons-beanutils commons-collections) CLASSPATH=$CLASSPATH:$(build-classpath commons-digester commons-logging-api) CLASSPATH=$CLASSPATH:$(build-classpath commons-logging xml-commons-apis) CLASSPATH=$CLASSPATH:$(build-classpath xerces-j2 ant/ant-junit junit) ant \ -Dnoget=true \ -Dbuild.sysclasspath=first \ dist %install mkdir -p %{buildroot}%{_javadir} install -m 644 dist/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar ( cd %{buildroot}%{_javadir} && ln -s %{name}.jar %{short_name}.jar ) mkdir -p %{buildroot}%{_mavenpomdir} install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom %add_maven_depmap JPP-%{short_name}.pom %{short_name}.jar mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/%{name} %files %{_javadir}/%{name}.jar %{_javadir}/%{short_name}.jar %{_mavenpomdir}/JPP-%{short_name}.pom %{_mavendepmapfragdir}/%{name} %doc LICENSE.txt NOTICE.txt README.txt RELEASE-NOTES.txt %files javadoc %{_javadocdir}/%{name} %doc LICENSE.txt NOTICE.txt %changelog * Sat Jun 16 2012 gil cattaneo 0.8-1 - initial rpm