Name: grizzly-http-client
Version: 1.3
Release: 1%{?dist}
Summary: Grizzly Async HTTP Client
Group: Development/Libraries
License: CDDL or GPLv2 with exceptions
URL: http://grizzly.java.net/
Source0: http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-http-client/1.3/grizzly-http-client-1.3-sources.jar
Source1: http://repo1.maven.org/maven2/org/glassfish/grizzly/grizzly-http-client/1.3/grizzly-http-client-1.3.pom
# wget -O glassfish-LICENSE.txt https://svn.java.net/svn/glassfish~svn/tags/legal-1.1/src/main/resources/META-INF/LICENSE.txt
# grizzly-http-client package don't include the license file
Source2: glassfish-LICENSE.txt
BuildRequires: java-devel
BuildRequires: jvnet-parent
# async-http-client >= 1.7.6
BuildRequires: async-http-client
BuildRequires: grizzly
BuildRequires: slf4j
BuildRequires: maven-local
BuildRequires: maven-compiler-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-surefire-plugin
# async-http-client >= 1.7.6
Requires: async-http-client
Requires: grizzly
Requires: slf4j
Requires: java
BuildArch: noarch
%description
Grizzly Async HTTP Client library purpose is to allow Java applications to
easily execute HTTP requests and asynchronously process the HTTP responses.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -T -q -c
# fixing incomplete source directory structure
mkdir -p src/main/{java,resources}
(
cd src/main/java
unzip -qq %{SOURCE0}
rm -rf META-INF
sed -i 's/\r//' readme.txt
mv readme.txt ../resources
)
cp -p %{SOURCE1} pom.xml
cp -p %{SOURCE2} LICENSE.txt
sed -i 's/\r//' LICENSE.txt
# Unavailable plugin
%pom_xpath_remove "pom:build/pom:extensions/pom:extension[pom:artifactId ='wagon-webdav']"
%pom_remove_plugin org.jvnet.maven-antrun-extended-plugin:maven-antrun-extended-plugin
%pom_remove_plugin org.glassfish.copyright:glassfish-copyright-maven-plugin
# disable async-http-client copy
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-bundle-plugin']/pom:configuration/pom:instructions/pom:Export-Package"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-bundle-plugin']/pom:configuration/pom:instructions" "
org.glassfish.grizzly.http.client.*"
%pom_xpath_remove "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-bundle-plugin']/pom:configuration/pom:unpackBundle"
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-bundle-plugin']/pom:configuration" "false"
# remove duplicate m-c-p
%pom_remove_plugin :maven-compiler-plugin
%pom_add_plugin org.apache.maven.plugins:maven-compiler-plugin . '
1.6
${maven.compiler.argument}
'
# remove some warnings
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId ='maven-jar-plugin']" "any"
sed -i 's|${artifactId}|${project.artifactId}|' pom.xml
sed -i 's|${version}|${project.version}|' pom.xml
sed -i 's|${pom.url}|${project.url}|' pom.xml
sed -i 's|${pom.version}|${project.version}|' pom.xml
%build
mvn-rpmbuild package javadoc:aggregate
%install
mkdir -p %{buildroot}%{_javadir}
install -m 644 target/%{name}-%{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/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%files
%{_javadir}/%{name}.jar
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%doc LICENSE.txt
%files javadoc
%{_javadocdir}/%{name}
%doc LICENSE.txt
%changelog
* Wed May 08 2013 gil cattaneo 1.3-1
- initial rpm