Name: uncommons-antlib
Version: 0.3.2
Release: 1%{?dist}
Summary: Tools for building modular software with Apache Ant
License: ASL 2.0
Url: http://wiki.github.com/dwdyer/uncommons-antlib
Source0: https://github.com/dwdyer/uncommons-antlib/archive/Release-%{version}.tar.gz
Source1: uncommons-antlib-template-pom.xml
BuildRequires: java-devel
BuildRequires: javapackages-tools
BuildRequires: ant
BuildRequires: fop
BuildRequires: xmlgraphics-commons
Requires: ant
Requires: fop
%if %{?fedora} <= 20
Requires: java
%else
Requires: java-headless
%endif
Requires: javapackages-tools
Requires: xerces-j2
Requires: xmlgraphics-commons
BuildArch: noarch
%description
The Uncommons Antlib provides macro definitions, custom tasks and other tools
to support the development of modular Java software using Apache Ant. It
builds on the concepts, processes and best practices established in the
development of several Ant-based projects, particularly the Uncommons.org
open source projects.
The guiding principle behind the design of the Uncommons Antlib is convention
over configuration. Ant build scripts are greatly simplified by relying on
consistent directory structures and naming conventions.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{name}-Release-%{version}
find . -name "*.jar" -print -delete
find . -name "*.class" -print -delete
sed -i 's|||' build.xml
pushd lib
pushd compiletime
ln -sf $(build-classpath ant)
ln -sf $(build-classpath fop)
ln -sf $(build-classpath xmlgraphics-commons)
popd
popd
cp -p %{SOURCE1} pom.xml
sed -i "s|@VERSION@|%{version}|" pom.xml
%build
ant jar
mkdir -p docs
%javadoc -classpath $(build-classpath ant fop xmlgraphics-commons):$PWD/build/%{name}-%{version}.jar \
-d docs -sourcepath src/java/main -subpackages org.uncommons.antlib
%install
mkdir -p %{buildroot}%{_javadir} %{buildroot}%{_datadir}/ant/lib
install -pm 644 build/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
echo "ant %{name} fop xerces-j2 xmlgraphics-commons" > %{name}
install -p -m 644 %{name} %{buildroot}%{_sysconfdir}/ant.d/%{name}
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr docs/* %{buildroot}%{_javadocdir}/%{name}
%files
%{_javadir}/%{name}.jar
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%config(noreplace) %{_sysconfdir}/ant.d/%{name}
%doc CHANGELOG.txt LICENCE.txt README.txt
%files javadoc
%{_javadocdir}/%{name}
%doc LICENCE.txt
%changelog
* Fri Aug 23 2013 gil cattaneo 0.3.2-1
- initial rpm