3dc5dd0
%global jar_version 1.4
3dc5dd0
%global lh_version 1.1
3dc5dd0
%global id_version 1.1
3dc5dd0
3dc5dd0
Name:		apache-resource-bundles
3dc5dd0
Version:	2
3dc5dd0
Release:	3%{?dist}
3dc5dd0
Summary:	Apache Resource Bundles
3dc5dd0
3dc5dd0
Group:		Development/Libraries
3dc5dd0
License:	ASL 2.0
3dc5dd0
URL:		http://repo1.maven.org/maven2/org/apache/apache-resource-bundles/
3dc5dd0
Source0:	http://repo1.maven.org/maven2/org/apache/%{name}/%{version}/%{name}-%{version}.pom
3dc5dd0
Source1:	http://repo1.maven.org/maven2/org/apache/apache-jar-resource-bundle/%{jar_version}/apache-jar-resource-bundle-%{jar_version}-sources.jar
3dc5dd0
Source2:	http://repo1.maven.org/maven2/org/apache/apache-jar-resource-bundle/%{jar_version}/apache-jar-resource-bundle-%{jar_version}.pom
3dc5dd0
Source3:	http://repo1.maven.org/maven2/org/apache/apache-license-header-resource-bundle/%{lh_version}/apache-license-header-resource-bundle-%{lh_version}-sources.jar
3dc5dd0
Source4:	http://repo1.maven.org/maven2/org/apache/apache-license-header-resource-bundle/%{lh_version}/apache-license-header-resource-bundle-%{lh_version}.pom
3dc5dd0
Source5:	http://repo1.maven.org/maven2/org/apache/apache-incubator-disclaimer-resource-bundle/%{id_version}/apache-incubator-disclaimer-resource-bundle-%{id_version}-sources.jar
3dc5dd0
Source6:	http://repo1.maven.org/maven2/org/apache/apache-incubator-disclaimer-resource-bundle/%{id_version}/apache-incubator-disclaimer-resource-bundle-%{id_version}.pom
3dc5dd0
3dc5dd0
# Remove maven-release plugin (not yet available on Fedora)
3dc5dd0
Patch0:		apache-resource-bundles-cleanup-poms.patch
3dc5dd0
3dc5dd0
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
3dc5dd0
3dc5dd0
BuildRequires:	maven2
3dc5dd0
BuildRequires:	maven2-plugin-compiler
3dc5dd0
BuildRequires:	maven2-plugin-install
3dc5dd0
BuildRequires:	maven2-plugin-jar
3dc5dd0
BuildRequires:	maven2-plugin-remote-resources
3dc5dd0
BuildRequires:	maven2-plugin-resources
3dc5dd0
BuildRequires:	maven-surefire-maven-plugin
3dc5dd0
3dc5dd0
# Requirements from the POMs
3dc5dd0
Requires:	maven2-plugin-remote-resources
3dc5dd0
3dc5dd0
Requires(post):	jpackage-utils
3dc5dd0
Requires(postun): jpackage-utils
3dc5dd0
3dc5dd0
BuildArch:	noarch
3dc5dd0
3dc5dd0
%description
3dc5dd0
An archive which contains templates for generating the necessary license files
3dc5dd0
and notices for all Apache releases.
3dc5dd0
3dc5dd0
%prep
3dc5dd0
%setup -c -T
3dc5dd0
cp %SOURCE0 ./pom.xml
3dc5dd0
%patch0 -p1
3dc5dd0
3dc5dd0
# jar
3dc5dd0
mkdir -p apache-jar-resource-bundle
3dc5dd0
pushd apache-jar-resource-bundle
3dc5dd0
jar xvf %SOURCE1
3dc5dd0
cp %SOURCE2 ./pom.xml
3dc5dd0
mkdir -p src/main/resources
3dc5dd0
mv META-INF src/main/resources
3dc5dd0
popd
3dc5dd0
3dc5dd0
# license-header
3dc5dd0
mkdir -p apache-license-header-resource-bundle
3dc5dd0
pushd apache-license-header-resource-bundle
3dc5dd0
jar xvf %SOURCE3
3dc5dd0
cp %SOURCE4 ./pom.xml
3dc5dd0
mkdir -p src/main/resources
3dc5dd0
mv META-INF src/main/resources
3dc5dd0
popd
3dc5dd0
3dc5dd0
# incubator-disclaimer
3dc5dd0
mkdir -p apache-incubator-disclaimer-resource-bundle
3dc5dd0
pushd apache-incubator-disclaimer-resource-bundle
3dc5dd0
jar xvf %SOURCE5
3dc5dd0
cp %SOURCE6 ./pom.xml
3dc5dd0
mkdir -p src/main/resources
3dc5dd0
mv META-INF src/main/resources
3dc5dd0
popd
3dc5dd0
3dc5dd0
3dc5dd0
%build
3dc5dd0
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
3dc5dd0
mkdir -p $MAVEN_REPO_LOCAL
3dc5dd0
3dc5dd0
mvn-jpp \
3dc5dd0
	-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
3dc5dd0
	install
3dc5dd0
3dc5dd0
%install
3dc5dd0
rm -rf $RPM_BUILD_ROOT
3dc5dd0
3dc5dd0
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
3dc5dd0
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
3dc5dd0
3dc5dd0
# jar
3dc5dd0
# 
3dc5dd0
pushd apache-jar-resource-bundle
3dc5dd0
install -m 644 \
3dc5dd0
	target/apache-jar-resource-bundle-%{jar_version}.jar \
3dc5dd0
	$RPM_BUILD_ROOT%{_javadir}/%{name}/jar-%{jar_version}.jar
3dc5dd0
cp pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-apache-jar-resource-bundle.pom
3dc5dd0
%add_to_maven_depmap org.apache apache-jar-resource-bundle %{jar_version} JPP %{name}/jar
3dc5dd0
popd
3dc5dd0
3dc5dd0
# license-header
3dc5dd0
pushd apache-license-header-resource-bundle
3dc5dd0
install -m 644 \
3dc5dd0
	target/apache-license-header-resource-bundle-%{lh_version}.jar \
3dc5dd0
	$RPM_BUILD_ROOT%{_javadir}/%{name}/license-header-%{lh_version}.jar
3dc5dd0
cp pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-apache-license-header-resource-bundle.pom
3dc5dd0
%add_to_maven_depmap org.apache apache-license-header-resource-bundle %{lh_version} JPP %{name}/license-header
3dc5dd0
popd
3dc5dd0
3dc5dd0
# incubator-disclaimer
3dc5dd0
pushd apache-incubator-disclaimer-resource-bundle
3dc5dd0
install -m 644 \
3dc5dd0
	target/apache-incubator-disclaimer-resource-bundle-%{id_version}.jar \
3dc5dd0
	$RPM_BUILD_ROOT%{_javadir}/%{name}/incubator-disclaimer-%{id_version}.jar
3dc5dd0
cp pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-apache-incubator-disclaimer-resource-bundle.pom
3dc5dd0
%add_to_maven_depmap org.apache apache-incubator-disclaimer-resource-bundle %{id_version} JPP %{name}/incubator-disclaimer
3dc5dd0
popd
3dc5dd0
3dc5dd0
# Unversioned jars
3dc5dd0
pushd $RPM_BUILD_ROOT%{_javadir}/%{name}
3dc5dd0
ln -sf jar-%{jar_version}.jar jar.jar
3dc5dd0
ln -sf license-header-%{lh_version}.jar license-header.jar
3dc5dd0
ln -sf incubator-disclaimer-%{id_version}.jar incubator-disclaimer.jar
3dc5dd0
popd
3dc5dd0
3dc5dd0
# Add parent to depmap too
3dc5dd0
cp pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
3dc5dd0
%add_to_maven_depmap org.apache %{name} %{version} JPP %{name}
3dc5dd0
3dc5dd0
%clean
3dc5dd0
rm -rf $RPM_BUILD_ROOT
3dc5dd0
3dc5dd0
%post
3dc5dd0
%update_maven_depmap
3dc5dd0
3dc5dd0
%postun
3dc5dd0
%update_maven_depmap
3dc5dd0
3dc5dd0
%files
3dc5dd0
%defattr(-,root,root,-)
3dc5dd0
%{_javadir}/%{name}
3dc5dd0
%config(noreplace) %{_mavendepmapfragdir}/*
3dc5dd0
%{_mavenpomdir}/*.pom
3dc5dd0
3dc5dd0
3dc5dd0
3dc5dd0
%changelog
3dc5dd0
* Mon Feb  1 2010 Mary Ellen Foster <mefoster at gmail.com> 2-3
3dc5dd0
- Fix license 
3dc5dd0
3dc5dd0
* Tue Jan 19 2010 Mary Ellen Foster <mefoster at gmail.com> 2-2
3dc5dd0
- Add plugin dependencies from POMs
3dc5dd0
- Fix description
3dc5dd0
- Remove maven-release plugin (not on Fedora yet)
3dc5dd0
3dc5dd0
* Mon Jan 18 2010 Mary Ellen Foster <mefoster at gmail.com> 2-1
3dc5dd0
- Initial package