%global commit 889599ceef60cd1577367e97f27d82914d01b9b8
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: aether-connector-okhttp
Version: 0.12.0
Release: 4%{?dist}
Summary: OkHttp Aether Connector
# src/main/java/io/tesla/aether/wagon/OkHttpsWagon.java is ASL and EPL
License: EPL and (ASL 2.0 and EPL)
URL: https://github.com/tesla/%{name}
Source0: https://github.com/tesla/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
Source1: eclipse-1.0.txt
Patch0: %{name}-updated-aether-api.patch
# This patch has been submitted upstream: https://github.com/tesla/aether-connector-okhttp/pull/3
Patch1: 0001-Port-to-latest-guava.patch
BuildArch: noarch
BuildRequires: mvn(org.eclipse.jetty:jetty-util)
BuildRequires: mvn(org.eclipse.sisu:org.eclipse.sisu.plexus)
BuildRequires: mvn(org.eclipse.sisu:sisu-maven-plugin)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations)
BuildRequires: mvn(com.google.guava:guava)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(com.squareup.okhttp:okhttp)
BuildRequires: mvn(javax.inject:javax.inject)
BuildRequires: mvn(org.slf4j:slf4j-simple)
BuildRequires: mvn(org.apache.maven.wagon:wagon-provider-api)
BuildRequires: maven-local
%description
A repository connector implementation based on Square's OkHttp.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
API documentation for %{name}.
%prep
%setup -q -n %{name}-%{commit}
cp %{SOURCE1} .
find -name '*.class' -delete
find -name '*.jar' -delete
# Doesn't really need the parent
%pom_remove_parent
# Unbundle SslContextFactory
%pom_add_dep org.eclipse.jetty:jetty-util
rm -r src/main/java/io/tesla/aether/okhttp/ssl/
sed -i -e "s/io.tesla.aether.okhttp.ssl.SslContextFactory/org.eclipse.jetty.util.ssl.SslContextFactory/" \
-e "s/scf.setTrustStore(trustStorePath)/scf.setTrustStorePath(trustStorePath)/" \
src/main/java/io/tesla/aether/okhttp/OkHttpAetherClient.java
%patch0 -b .orig
%patch1 -p1 -b .orig
%build
# We don't have all test deps (e.g. npn-boot)
%mvn_build --skip-tests
%install
%mvn_install
%files -f .mfiles
%dir %{_javadir}/%{name}
%doc eclipse-1.0.txt
%doc license-header.txt
%files javadoc -f .mfiles-javadoc
%doc eclipse-1.0.txt
%changelog
* Fri Jul 25 2014 Mat Booth <mat.booth@redhat.com> - 0.12.0-4
- Fix failure to build with the latest version of guava
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sat May 24 2014 Gerard Ryan <galileo@fedoraproject.org> - 0.12.0-2
- Update to latest upstream version 0.12.0
- RHBZ#1100949: Patch for latest aether api
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0.0.11-3
- Use Requires: java-headless rebuild (#1067528)
* Wed Feb 5 2014 Gerard Ryan <galileo@fedoraproject.org> - 0.0.11-2
- Initial rpm