%global _name Hystrix Name: hystrix Version: 1.4.21 Release: 4%{?dist} Summary: Library for Latency and Fault Tolerance in Distributed Systems License: ASL 2.0 URL: https://github.com/Netflix/%{_name}/wiki Source0: https://github.com/Netflix/%{_name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch0: hystrix.build.gradle.patch BuildArch: noarch BuildRequires: gradle-local BuildRequires: mvn(junit:junit) BuildRequires: mvn(com.netflix.archaius:archaius-core) BuildRequires: mvn(io.reactivex:rxjava) BuildRequires: mvn(org.slf4j:slf4j-api) BuildRequires: mvn(com.fasterxml.jackson.core:jackson-core) BuildRequires: mvn(commons-configuration:commons-configuration) BuildRequires: mvn(javax.servlet:servlet-api) BuildRequires: mvn(org.mockito:mockito-all) BuildRequires: mvn(org.slf4j:slf4j-log4j12) BuildRequires: mvn(log4j:log4j) %description Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable. %package core Summary: Core module of Hystrix Requires: mvn(com.netflix.archaius:archaius-core) Requires: mvn(io.reactivex:rxjava) Requires: mvn(org.slf4j:slf4j-api) %package metrics-event-stream Summary: Java servlet which exposes %{_name} metrics Requires: mvn(com.fasterxml.jackson.core:jackson-core) Requires: mvn(com.netflix.hystrix:hystrix-core) = %{version} %package javadoc Summary: API documentation for %{name} %package dashboard Summary: Dashboard to visualize %{_name} metrics event streams Requires: mvn(org.apache.httpcomponents:httpclient) Requires: mvn(org.slf4j:slf4j-log4j12) Requires: mvn(log4j:log4j) Requires: jetty %description core Core module of %{_name}. %description metrics-event-stream Java servlet which exposes %{_name} metrics in a text/event-stream formatted stream. %description dashboard Dashboard to visualize %{_name} metrics event streams. %description javadoc This package provides API documentation for %{name}. %prep %setup -q -n %{_name}-%{version} %patch0 -p1 find . -name '*.class' -delete find . -name '*.jar' -delete %build gradle -s --offline hystrix-core:build gradle -s --offline hystrix-metrics-event-stream:build gradle -s --offline hystrix-dashboard:build # Javadoc generation for hystrix-core fails on Java8: https://github.com/Netflix/Hystrix/issues/762 #javadoc -d javadoc \ # -sourcepath hystrix-core/src/main/java:hystrix-contrib/hystrix-metrics-event-stream/src/main/java \ # -subpackages com.netflix.hystrix -Xdoclint:none javadoc -d javadoc \ -sourcepath hystrix-contrib/hystrix-metrics-event-stream/src/main/java \ -subpackages com.netflix.hystrix -Xdoclint:none %mvn_artifact com.netflix.hystrix:hystrix-core:%{version} hystrix-core/build/libs/hystrix-core.jar %mvn_artifact com.netflix.hystrix:hystrix-metrics-event-stream:%{version} hystrix-contrib/hystrix-metrics-event-stream/build/libs/hystrix-metrics-event-stream.jar %mvn_package ":hystrix-core" core %mvn_package ":hystrix-metrics-event-stream" metrics-event-stream %install %mvn_install -J javadoc mkdir -p %{buildroot}%{_datadir}/webapps/%{name}/hystrix-dashboard unzip hystrix-dashboard/build/libs/hystrix-dashboard.war -d %{buildroot}%{_datadir}/webapps/%{name}/hystrix-dashboard xmvn-subst %{buildroot}%{_datadir}/webapps/%{name}/hystrix-dashboard/WEB-INF/lib/ mkdir -p %{buildroot}%{_datadir}/jetty/webapps ln -sf %{_datadir}/webapps/%{name}/hystrix-dashboard %{buildroot}%{_datadir}/jetty/webapps/hystrix-dashboard %files core -f .mfiles-core %doc README.md CHANGELOG.md %license LICENSE %files metrics-event-stream -f .mfiles-metrics-event-stream %license LICENSE %files dashboard %{_datadir}/webapps/%{name} %{_datadir}/jetty/webapps/hystrix-dashboard %license LICENSE %files javadoc -f .mfiles-javadoc %license LICENSE %changelog * Wed Dec 09 2015 Roman Mohr - 1.4.21-4 - Properly own the webapps subdirectories * Tue Dec 08 2015 Roman Mohr - 1.4.21-3 - Add dashboard * Wed Dec 02 2015 Roman Mohr - 1.4.21-2 - Run hystrix unit tests * Wed Nov 04 2015 Roman Mohr - 1.4.21-1 - Initial packaging