Blob Blame History Raw
%global jarname   rabbitmq-client

%global failjava  true
%global failjunit no
#global failjunit yes

#%global buildtex  0

Name:          rabbitmq-java-client
Version:       3.4.2
Release:       5%{?dist}
Summary:       Java Advanced Message Queue Protocol client library
License:       ASL 2.0 and GPLv2+ and MPLv1.1
URL:           http://www.rabbitmq.com/java-client.html
Source0:       http://www.rabbitmq.com/releases/%{name}/v%{version}/%{name}-%{version}.tar.gz

BuildArch:     noarch
BuildRequires: maven-local mvn(commons-cli:commons-cli) mvn(commons-io:commons-io) mvn(junit:junit)
BuildRequires: ant ant-junit
BuildRequires: java-headless
BuildRequires: python >= 2.6 python-simplejson

%if 0%{?buildtex:1}
BuildRequires: texi2html
BuildRequires: %{_bindir}/pdflatex
%endif

#Suggests:       rabbitmq-server
#Suggests:       activemq


%description
The library allows Java code to interface to AMQP servers.
Please see the specification page for more information on AMQP
inter-operation and standards-conformance

You will need an AMQP server, such as our very own RabbitMQ server,
to use with the client library.


%package doc
Summary:       Documentation for %{name}
Requires:      %{name} = %{version}-%{release}

%description doc
This package contains additional documentation for %{name}.

%package javadoc
Summary:       Javadoc for %{name}

%description javadoc
This package contains javadoc for %{name}.


%prep
%setup -q
find . -name "*.bat" -delete
find . -name "*.class" -delete
find . -name "*.jar" -print -delete
# use ant only
rm Makefile

ln -sf $(build-classpath commons-cli) lib/
ln -sf $(build-classpath commons-io) lib/
ln -sf $(build-classpath junit) lib/

# Disable Spring bundlor support
sed -i "s|, bundlor.do||" build.xml
sed -i "s|, test-bundlor.do||" build.xml

#sed -i 's,\(\"jar.name\" value=\"\).*\",\1%{jarname}\",' build.xml
sed -i 's,\(\"haltOnFailureJunit\" value=\"\).*\",\1%{failjunit}\",' build.xml
sed -i 's,\(\"haltOnFailureJava\" value=\"\).*\",\1%{failjava}\",' build.xml


%build
%mvn_file com.rabbitmq:amqp-client %{name} %{jarname} amqp-client
export JAVA_HOME=%{java_home}
ant -Dimpl.version=%{version} maven-bundle

# distribute documentation
cd doc/channels
%if 0%{?buildtex:1}
find . -name \*.tex -print -exec 'texi2html {} ; pdflatex {}' \; -delete
%endif
find . -not -name channels.\* -delete


%check
ant test-jar

# client tests need a mock server
export RABBITMQ_LOG_BASE=.
export RABBITMQ_MNESIA_BASE=.
export RABBITMQ_NODENAME=testrabbit
su rabbitmq -c 'rabbitmq-server -detach' &disown

#ant test-suite
#ant -Dtest=testDoubleDeletionExchange test-single
ant test-server
ant test-client
# FIXME functional tests failure ahead!
#ant test-functional
#ant test-functional-and-server-with-ha


%install
%mvn_artifact build/bundle/amqp-client-%{version}.pom build/bundle/amqp-client-%{version}.jar
%mvn_install -J build/doc/api


%clean
#ant clean
# FIXME assume there's only our test server
su rabbitmq -c 'pgrep -u rabbitmq -f $RABBITMQ_NODENAME |xargs kill' || :


%files -f .mfiles
%license LICENSE*
%doc README*

%files doc
%doc doc/*

%files javadoc -f .mfiles-javadoc
%license LICENSE*


%changelog
* Wed Jan 28 2015 Raphael Groner <projects.rg (AT) smart.ms> - 3.4.2-5
- introduce license macro

* Thu Dec 11 2014 Raphael Groner <projects.rg [AT] smart.ms> - 3.4.2-4
- fix documentation again

* Thu Dec 11 2014 Raphael Groner <projects.rg [AT] smart.ms> - 3.4.2-3
- fix documentation

* Wed Dec 10 2014 Raphael Groner <projects.rg [AT] smart.ms> - 3.4.2-2
- documentation subpackage

* Wed Dec 10 2014 Raphael Groner <projects.rg [AT] smart.ms> - 3.4.2-1
- maven contributions from puntogil
- update to 3.4.2

* Tue Nov 25 2014 Raphael Groner <projects.rg [AT] smart.ms> - 3.4.1-1
- update to 3.4.1

* Wed Jun 11 2014 gil cattaneo <puntogil@libero.it> 3.3.2-1
- initial rpm