Name: jcr-api
Version: 2.0
Release: 1%{?dist}
Summary: Java Content Repository Technology (JSR-283) API
# http://www.day.com/dam/day/downloads/jsr283/day-spec-license.htm Day Specification License
License: Day Specification License
# http://www.day.com/day/en/products/jcr/jsr-283.html http://www.day.com/specs/jcr/2.0/index.html
URL: http://www.jcp.org/en/jsr/detail?id=283
# must agree the Software License Agreement for donwload
# wget http://download.oracle.com/otn-pub/jcp/content_repository-2.0-fr-oth-JSpec/content_repository-2_0-final-spec.zip
# or
# wget https://svn.java.net/svn/jsr-283~svn/trunk/packages/jsr-283-fcs.zip
# or
# http://repo1.maven.org/maven2/javax/jcr/jcr/2.0/jcr-2.0-sources.jar
# use pom file in http://repo1.maven.org/maven2/javax/jcr/jcr/2.0/jcr-2.0.jar
Source0: jsr-283-fcs.zip
# Day Specification License addendum
# wget -O jcr-api-LICENSE.txt http://www.day.com/content/dam/day/downloads/jsr283/LICENSE.txt
Source1: jcr-api-LICENSE.txt
BuildRequires: java-devel
BuildRequires: maven-local
BuildRequires: maven-plugin-bundle
BuildRequires: maven-source-plugin
Requires: java
BuildArch: noarch
%description
The Content Repository API for JavaTM Technology Version 2.0
is specified by JSR-283. This module contains the complete API
as specified.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n jsr-283-fcs
# extract the pom file
(
cd lib
%jar -xf jcr-2.0.jar
mv META-INF/maven/javax.jcr/jcr/pom.xml ../
)
sed -i "s,,,;s,1.4,1.5,;s,ISO-8859-1,UTF-8,;s,pom.version,project.version," pom.xml
# cleanup
rm -rf docs/* lib/* spec/*
sed -i 's/\r//' README.txt
mkdir -p src/main/resources
cp %{SOURCE1} LICENSE.txt
sed -i 's/\r//' LICENSE.txt README.txt
cp LICENSE.txt src/main/resources/additional-LICENSE.txt
%build
mvn-rpmbuild -Dproject.build.sourceEncoding=UTF-8 package javadoc:aggregate
%install
mkdir -p %{buildroot}%{_javadir}
install -m 644 target/jcr-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
mkdir -p %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr target/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%files -f .mfiles
%doc LICENSE.txt README.txt license/day-spec-license.htm
%files javadoc
%{_javadocdir}/%{name}
%doc LICENSE.txt license/day-spec-license.htm
%changelog
* Tue Oct 23 2012 gil cattaneo 2.0-1
- initial rpm