Sandro Mathys 66235d
%global shortname commons-compress
Sandro Mathys 66235d
Sandro Mathys 66235d
Name:             apache-%{shortname}
Sandro Mathys 66235d
Version:          1.0
Sandro Mathys b0b6e5
Release:          5%{?dist}
Sandro Mathys 66235d
Summary:          Java API for working with tar, zip and bzip2 files
Sandro Mathys 66235d
Group:            Development/Libraries
Sandro Mathys 66235d
License:          ASL 2.0
Sandro Mathys 66235d
URL:              http://commons.apache.org/compress/
Sandro Mathys 66235d
Source0:          http://www.apache.org/dist/commons/compress/source/%{shortname}-%{version}-src.tar.gz
Sandro Mathys 66235d
BuildArch:        noarch
Sandro Mathys 66235d
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Sandro Mathys 66235d
Sandro Mathys 66235d
BuildRequires:    java-devel >= 1:1.6.0
Sandro Mathys 66235d
BuildRequires:    jpackage-utils
Sandro Mathys 66235d
BuildRequires:    maven2
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-antrun
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-assembly
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-compiler
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-idea
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-install
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-jar
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-javadoc
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-resources
Sandro Mathys 66235d
BuildRequires:    maven2-plugin-source
Sandro Mathys 66235d
BuildRequires:    maven-doxia-sitetools
Sandro Mathys 66235d
BuildRequires:    maven-plugin-bundle
Sandro Mathys 66235d
BuildRequires:    maven-surefire-maven-plugin
Sandro Mathys 66235d
BuildRequires:    maven-surefire-provider-junit
Sandro Mathys 66235d
Requires:         java >= 1:1.6.0
Sandro Mathys 66235d
Requires:         jpackage-utils
Sandro Mathys 66235d
Requires(post):   jpackage-utils
Sandro Mathys 66235d
Requires(postun): jpackage-utils
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
# Upstream name change
Sandro Mathys 66235d
Provides:         jakarta-%{shortname} = %{version}-%{release}
Sandro Mathys 66235d
Obsoletes:        jakarta-%{shortname} < 1.0-2
Sandro Mathys 66235d
Sandro Mathys 66235d
%description
Sandro Mathys 66235d
The code in this component came from Avalon's Excalibur, but originally
Sandro Mathys 66235d
from Ant, as far as life in Apache goes. The tar package is originally
Sandro Mathys 66235d
Tim Endres' public domain package. The bzip2 package is based on the
Sandro Mathys 66235d
work done by Keiron Liddle. It has migrated via:
Sandro Mathys 66235d
Ant -> Avalon-Excalibur -> Commons-IO -> Commons-Compress. 
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%package javadoc
Sandro Mathys 66235d
Summary:        Javadocs for %{name}
Sandro Mathys 66235d
Group:          Documentation
Sandro Mathys 66235d
Requires:       %{name} = %{version}-%{release}
Sandro Mathys 66235d
Requires:       jpackage-utils
Sandro Mathys 66235d
Sandro Mathys b0b6e5
# Upstream name change
Sandro Mathys b0b6e5
Provides:         jakarta-%{shortname}-javadoc = %{version}-%{release}
Sandro Mathys b0b6e5
Obsoletes:        jakarta-%{shortname}-javadoc < 1.0-2
Sandro Mathys b0b6e5
Sandro Mathys 66235d
%description javadoc
Sandro Mathys 66235d
Development documentation for %{name}.
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%prep
Sandro Mathys 66235d
%setup -q -n %{shortname}-%{version}-src
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%build
Sandro Mathys 66235d
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
Sandro Mathys 66235d
mkdir -p $MAVEN_REPO_LOCAL
Sandro Mathys 66235d
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%install
Sandro Mathys 66235d
rm -rf $RPM_BUILD_ROOT
Sandro Mathys 66235d
Sandro Mathys 66235d
# jar
Sandro Mathys 66235d
install -d $RPM_BUILD_ROOT%{_javadir}
Sandro Mathys 66235d
install -m644 target/%{shortname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{shortname}-%{version}.jar
Sandro Mathys 66235d
ln -s %{shortname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{shortname}.jar
Sandro Mathys 66235d
ln -s %{shortname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
Sandro Mathys 66235d
ln -s %{shortname}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
Sandro Mathys 66235d
Sandro Mathys 66235d
# javadoc
Sandro Mathys 66235d
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}
Sandro Mathys 66235d
cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
Sandro Mathys 66235d
Sandro Mathys 66235d
# pomfile
Sandro Mathys 66235d
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
Sandro Mathys 66235d
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{shortname}.pom
Sandro Mathys 66235d
%add_to_maven_depmap org.apache.maven %{name} %{version} JPP %{name}
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%clean
Sandro Mathys 66235d
rm -rf $RPM_BUILD_ROOT
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%post
Sandro Mathys 66235d
%update_maven_depmap
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%postun
Sandro Mathys 66235d
%update_maven_depmap
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%files
Sandro Mathys 66235d
%defattr(-,root,root,-)
Sandro Mathys 66235d
%doc LICENSE.txt NOTICE.txt
Sandro Mathys 66235d
%{_javadir}/%{shortname}.jar
Sandro Mathys 66235d
%{_javadir}/%{shortname}-%{version}.jar
Sandro Mathys 66235d
%{_javadir}/%{name}.jar
Sandro Mathys 66235d
%{_javadir}/%{name}-%{version}.jar
Sandro Mathys 66235d
%{_mavendepmapfragdir}/%{name}
Sandro Mathys 66235d
%{_mavenpomdir}/JPP-%{shortname}.pom
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%files javadoc
Sandro Mathys 66235d
%defattr(-,root,root,-)
Sandro Mathys 66235d
%{_javadocdir}/%{name}
Sandro Mathys 66235d
Sandro Mathys 66235d
Sandro Mathys 66235d
%changelog
Sandro Mathys b0b6e5
* Thu May 13 2010 Sandro Mathys <red at fedoraproject.org> - 1.0-5
Sandro Mathys b0b6e5
- Added missing Provides/Obsoletes for javadocs
Sandro Mathys b0b6e5
Sandro Mathys 66235d
* Mon May 10 2010 Sandro Mathys <red at fedoraproject.org> - 1.0-4
Sandro Mathys b0b6e5
- Cleared some problems after the review
Sandro Mathys 66235d
Sandro Mathys 66235d
* Thu May 06 2010 Sandro Mathys <red at fedoraproject.org> - 1.0-3
Sandro Mathys 66235d
- Now using maven2 (mvn-jpp) instead of directly calling javac & co
Sandro Mathys 66235d
Sandro Mathys 66235d
* Tue May 04 2010 Sandro Mathys <red at fedoraproject.org> - 1.0-2
Sandro Mathys 66235d
- Renamed from jakarta-commons-compress
Sandro Mathys 66235d