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