%global namedreltag -incubating %global namedversion %{version}%{?namedreltag} %if 0%{?fedora} # Unavailable deps # https://bugzilla.redhat.com/show_bug.cgi?id=1279201 %bcond_with flume %bcond_with kafka %bcond_with msgpack %endif Name: apache-htrace Version: 4.1.0 Release: 0.1.incubating%{?dist} Summary: Tracing framework for java based distributed systems License: ASL 2.0 URL: http://htrace.incubator.apache.org/ Source0: http://www.apache.org/dist/incubator/htrace/htrace-%{namedversion}/htrace-%{namedversion}-src.tar.gz # Use ${LIB_INSTALL_DIR} instead of hardcoded lib in cmake file Patch0: apache-htrace-4.1.0-multiarch.patch BuildRequires: maven-local BuildRequires: mvn(com.fasterxml.jackson.core:jackson-core) BuildRequires: mvn(com.fasterxml.jackson.core:jackson-databind) BuildRequires: mvn(commons-codec:commons-codec) BuildRequires: mvn(commons-lang:commons-lang) BuildRequires: mvn(commons-logging:commons-logging) BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache:apache:pom:) %if %{with flume} BuildRequires: mvn(org.apache.flume:flume-ng-sdk:::1.5.2) BuildRequires: mvn(org.apache.flume:flume-ng-sdk::tests:1.5.2) %endif %if %{with kafka} BuildRequires: mvn(org.apache.kafka:kafka_2.11:0.8.2.1) BuildRequires: mvn(org.apache.kafka:kafka_2.11::tests:0.8.2.1) %endif BuildRequires: mvn(org.apache.thrift:libthrift) BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) BuildRequires: mvn(org.eclipse.jetty:jetty-client) %if %{with msgpack} # https://gil.fedorapeople.org/msgpack-java-0.8.4-1.fc23.src.rpm BuildRequires: mvn(org.msgpack:msgpack-core:0.7.0-p9) %endif BuildRequires: mvn(org.slf4j:slf4j-api) BuildRequires: mvn(org.slf4j:slf4j-nop) BuildRequires: thrift BuildRequires: cmake BuildRequires: json-c-devel BuildRequires: libcurl-devel # Go support use: # BuildRequires: godep # BuildRequires: golang-bin # BuildRequires: golang-github-gorilla-context # BuildRequires: golang-github-gorilla-mux # BuildRequires: golang-github-jmhodges-levigo # BuildRequires: golang-github-ugorji-go # golang(github.com/ugorji/go/codec) # BuildRequires: patchelf # ... and other unavailable build deps: # github.com/alecthomas/kingpin # github.com/alecthomas/units %description HTrace is a tracing framework for use with distributed systems written in java. %package core Summary: Apache HTrace Core BuildArch: noarch %description core This package provides HTrace Core. %package htraced Summary: SpanReceiver implementation via REST BuildArch: noarch %description htraced A SpanReceiver implementation that passes Spans to htraced via REST. %package zipkin Summary: SpanReceiver implementation BuildArch: noarch %description zipkin htrace-zipkin provides the SpanReceiver implementation which sends spans to Zipkin collector. %package parent Summary: Apache HTrace Parent POM BuildArch: noarch %description parent Apache HTrace Parent POM. %package javadoc Summary: Javadoc for %{name} BuildArch: noarch %description javadoc This package contains javadoc for %{name}. %package -n libhtrace Summary: The HTrace C client library %description -n libhtrace The HTrace C client is useful for distributed systems in C and C++ that need tracing. %package -n libhtrace-devel Summary: Development files for the HTrace C client library Requires: libhtrace%{?_isa} = %{version}-%{release} %description -n libhtrace-devel The libhtrace-devel package contains libraries and header files for developing applications that use HTrace C client. %prep %setup -q -n htrace-%{namedversion} # Cleanup find . -name "*.jar" -print -delete find . -name "*.class" -print -delete find . -name "*.js" -print -delete %patch0 -p1 %pom_remove_plugin -r :maven-source-plugin %pom_remove_plugin -r :maven-javadoc-plugin %pom_remove_plugin -r :maven-gpg-plugin %pom_remove_plugin -r :maven-deploy-plugin %pom_remove_plugin -r :maven-shade-plugin %pom_remove_plugin -r :maven-site-plugin %pom_remove_plugin -r :maven-assembly-plugin %pom_remove_plugin -r :apache-rat-plugin # Unavailable dep %if %{without kafka} %pom_disable_module htrace-flume %endif # HBase was retired, because of incompatibility with protobuf 2.6+. # Circular dep with hadoop 2.4.0 %pom_disable_module htrace-hbase %pom_disable_module htrace-webapp %pom_disable_module htrace-c %pom_remove_plugin -r :rpm-maven-plugin htrace-htraced %pom_remove_dep -r :htrace-webapp htrace-htraced %if %{without kafka} %pom_remove_dep org.apache.kafka: htrace-zipkin rm htrace-zipkin/src/main/java/org/apache/htrace/impl/KafkaTransport.java \ htrace-zipkin/src/test/java/org/apache/htrace/zipkin/ITZipkinReceiver.java # package org.apache.commons.lang.exception does not exist %pom_add_dep commons-lang:commons-lang htrace-zipkin %endif # Disable golang support doesn't build under Fedora. Unavailable build tools/deps %pom_remove_plugin :maven-antrun-plugin htrace-htraced %pom_remove_plugin :maven-clean-plugin htrace-htraced rm -r htrace-htraced/src/test/java/org/apache/htrace/impl/TestHTracedReceiver.java \ htrace-htraced/src/test/java/org/apache/htrace/impl/TestDroppedSpans.java %if %{without msgpack} %pom_remove_dep org.msgpack:msgpack-core htrace-htraced rm htrace-htraced/src/main/java/org/apache/htrace/impl/PackedBuffer.java \ htrace-htraced/src/main/java/org/apache/htrace/impl/PackedBufferManager.java \ htrace-htraced/src/test/java/org/apache/htrace/impl/TestPackedBuffer.java sed -i "s|= new PackedBufferManager(conf);|= null;|" \ htrace-htraced/src/main/java/org/apache/htrace/impl/HTracedSpanReceiver.java %endif sed -i "s,json/json_object.h,json-c/json_object.h,;s,json/json_tokener.h,json-c/json_tokener.h," \ htrace-c/src/test/mini_htraced.c \ htrace-c/src/test/span_util.c chmod 644 htrace-c/README.md htrace-c/style.txt htrace-c/src/**/** %mvn_alias :htrace-core4 :htrace-core %build ( cd bin sh gen_thrift.sh ) # java.lang.ArrayIndexOutOfBoundsException: 366 # Test disabled too many troubles for run test suite in different arch builder #%%ifarch %%{arm} #opts="-f" #%%else #%% mvn_package ":{*}::tests:" @1 #%%endif %mvn_build -s -f mkdir -p htrace-c/src/build CFLAGS="${CFLAGS:-%optflags}" CXXFLAGS="${CXXFLAGS:-%optflags}" export CFLAGS CXXFLAGS ( cd htrace-c/src/build %{__cmake} -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} .. ) make %{?_smp_mflags} -C htrace-c/src/build %install %mvn_install make install DESTDIR=%{buildroot} -C htrace-c/src/build %check CFLAGS="${CFLAGS:-%optflags}" CXXFLAGS="${CXXFLAGS:-%optflags}" export CFLAGS CXXFLAGS ( cd htrace-c/src/build %{__cmake} -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} -DLIB_INSTALL_DIR:PATH=%{_libdir} .. # TODO: failures; get them fixed and remove || : # The following tests FAILED: # 1 - cmp_util-unit (Failed) only on arm builder # 4 - htraced_rcv-unit (Failed) # 9 - mini_htraced-unit (Failed) make %{?_smp_mflags} test || : ) %files core -f .mfiles-htrace-core4 %doc DISCLAIMER.txt README.md %license LICENSE.txt NOTICE.txt %files htraced -f .mfiles-htrace-htraced %files zipkin -f .mfiles-htrace-zipkin %doc htrace-zipkin/README.md %files parent -f .mfiles-htrace %license LICENSE.txt NOTICE.txt %files javadoc -f .mfiles-javadoc %license LICENSE.txt NOTICE.txt %post -n libhtrace -p /sbin/ldconfig %postun -n libhtrace -p /sbin/ldconfig %files -n libhtrace %{_libdir}/libhtrace.so.* %doc htrace-c/README.md htrace-c/style.txt %license LICENSE.txt NOTICE.txt %files -n libhtrace-devel %{_includedir}/htrace.h %{_libdir}/libhtrace.so %changelog * Sun Apr 10 2016 gil cattaneo 4.1.0-0.1.incubating - update to 4.1.0 * Mon Nov 09 2015 gil cattaneo 4.0.0-0.1.incubating - update to 4.0.0 * Fri Aug 21 2015 gil cattaneo 3.2.0-0.1.incubating - initial rpm