%global namedreltag .Final
%global namedversion %{version}%{?namedreltag}
%global customnamedversion 2_4_1_Final
# Use this switch to rebuild without narayana
# This is useful to break the hornetq circular dependency
%define with_narayana 1
Name: hornetq
Version: 2.4.1
Release: 2%{?dist}
Summary: High performance messaging system
License: ASL 2.0
URL: http://www.jboss.org/hornetq
Source0: https://github.com/hornetq/hornetq/archive/HornetQ_%{customnamedversion}.tar.gz
BuildRequires: automake libtool autoconf
BuildRequires: apiviz
BuildRequires: aether
BuildRequires: apache-commons-logging
BuildRequires: javacc
BuildRequires: jboss-connector-1.6-api
BuildRequires: jboss-ejb-3.1-api
BuildRequires: jboss-ejb3-ext-api
BuildRequires: jboss-jaspi-1.0-api
BuildRequires: jboss-jms-1.1-api
BuildRequires: jboss-logging
BuildRequires: jboss-servlet-3.0-api
BuildRequires: jboss-transaction-1.1-api
BuildRequires: jboss-transaction-spi
BuildRequires: jboss-logging
BuildRequires: jboss-logging-tools
BuildRequires: jboss-remoting
BuildRequires: jboss-naming
BuildRequires: jbossws-parent
BuildRequires: jdepend
BuildRequires: libaio-devel
%if 0%{?fedora} > 20
BuildRequires: netty
%else
BuildRequires: netty4
%endif
BuildRequires: maven-local
BuildRequires: maven-license-plugin
BuildRequires: maven-checkstyle-plugin
BuildRequires: javacc-maven-plugin
BuildRequires: java-service-wrapper
BuildRequires: jgroups
BuildRequires: jboss-integration
BuildRequires: mvn(org.jboss.resteasy:resteasy-jaxrs)
BuildRequires: mvn(org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec)
%if %{with_narayana}
BuildRequires: narayana
%endif
BuildRequires: xml-maven-plugin
BuildRequires: saxon
BuildRequires: qpid-proton-java
BuildRequires: mvn(org.jboss.spec.javax.resource:jboss-connector-api_1.6_spec)
BuildRequires: mvn(org.jboss.spec.javax.jms:jboss-jms-api_2.0_spec)
BuildRequires: nar-maven-plugin >= 3.0.0-3
%description
HornetQ is an open source project to build a multi-protocol, embeddable,
very high performance, clustered, asynchronous messaging system.
%package javadoc
Summary: Javadocs for %{name}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n hornetq-HornetQ_%{customnamedversion}
# Remove bundled .so files
find -name "*.so" -delete
%pom_remove_dep "org.jboss.jbossts.jts:jbossjts-jacorb" hornetq-jms-server/pom.xml
%pom_add_dep "org.jboss.narayana.jta:jta" hornetq-jms-server/pom.xml
%pom_disable_module hornetq-service-sar
%pom_disable_module hornetq-bootstrap
%pom_disable_module tests
%pom_disable_module examples
%pom_disable_module hornetq-rest
%pom_disable_module integration/hornetq-jboss-as-integration
%pom_disable_module integration/hornetq-spring-integration
%pom_disable_module integration/hornetq-twitter-integration
%pom_disable_module integration/hornetq-aerogear-integration
%if !%{with_narayana}
%pom_disable_module hornetq-jms-server
%pom_disable_module hornetq-ra
%pom_disable_module hornetq-tools
%endif
%pom_remove_dep "org.jboss.microcontainer:jboss-kernel"
# Use netty version 4, always
sed -i 's|>4.0.13.Final<|>4<|' pom.xml
# Replace old jca
%pom_remove_dep "org.jboss.javaee:jboss-jca-api" hornetq-ra/pom.xml
%pom_add_dep "org.jboss.spec.javax.resource:jboss-connector-api_1.6_spec" hornetq-ra/pom.xml
# Make xslt 2.0 avaialble!
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId = 'xml-maven-plugin']/pom:configuration" "<transformerFactory>net.sf.saxon.TransformerFactoryImpl</transformerFactory>" hornetq-core-client/pom.xml
sed -i "s|>com.mycila<|>com.mycila.maven-license-plugin<|g" pom.xml
sed -i "s|>license-maven-plugin<|>maven-license-plugin<|g" pom.xml
%build
# Workaround for building native bits
# Currently the build script uses the .so in the hornetq-nativebin/ directory
# but we need to rebuild them. The issue is that the mvn build process does not
# use the new .so files we've built. Here is a simple workaround.
%if %{with_narayana}
pushd hornetq-native
# Let's build the .so files
%mvn_build -i -f -- -Pnative-build
# Copy them to hornetq-native/bin/ dir
find -name "*.so" -exec cp {} bin/libHornetQAIO.so \;
find -name "*.so" -exec cp {} bin/libHornetQAIO%{__isa_bits}.so \;
popd
%endif
# This will rebuild one more time the hornet-native stuff,
# but this time will include the correct native libraries
# Tests are skipped because required modules are disabled
%mvn_build -f -- -Pmaven-release
%install
%mvn_install
# Install native stuff
%if %{with_narayana}
install -d -m 755 %{buildroot}/%{_libdir}
cp -L hornetq-native/bin/libHornetQAIO.so %{buildroot}/%{_libdir}/libHornetQAIO.so
%endif
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files -f .mfiles
%dir %{_javadir}/%{name}
%if %{with_narayana}
%{_libdir}/libHornetQAIO.so
%endif
%doc distribution/hornetq/src/main/resources/licenses/LICENSE.txt
%doc NOTICE
%doc README.md
%files javadoc -f .mfiles-javadoc
%doc distribution/hornetq/src/main/resources/licenses/LICENSE.txt
%doc NOTICE
%changelog
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 2.4.1-2
- Use Requires: java-headless rebuild (#1067528)
* Thu Feb 13 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.1-1
- Upstream release 2.4.1.Final
* Fri Jan 24 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-6
- Rebuild with narayana deps
* Fri Jan 24 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-5
- Rebuild without narayana deps
- Enable ARM build
* Tue Jan 21 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-4
- Rebuild to recreate debug package and use new qpid-proton-java package
* Tue Jan 14 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-3
- Rebuild with new narayana
- Exclude ARM for now
* Tue Jan 14 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-2
- Rebuild without narayana to disable circular dependency
- Changes to netty requirement
* Thu Jan 09 2014 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-1
- Upstream release 2.4.0.Final
* Mon Dec 16 2013 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-0.3.Beta3
- Upstream release 2.4.0.Beta3
* Thu Oct 24 2013 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-0.2.Beta1
- Upstream release 2.4.0.Beta2
* Wed Sep 11 2013 Marek Goldmann <mgoldman@redhat.com> - 2.4.0-0.1.Beta1
- Upstream release 2.4.0.Beta1
* Tue Jul 30 2013 Marek Goldmann <mgoldman@redhat.com> - 2.3.1-2
- Rebuild with narayana
- Added hornetq-jms-server and hornetq-ra modules
* Wed Jun 12 2013 Marek Goldmann <mgoldman@redhat.com> - 2.3.1-1
- Upstream release 2.3.1.Final
- New guidelines
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.13-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.13-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Thu May 24 2012 Marek Goldmann <mgoldman@redhat.com> 2.2.13-4
- Removed unnecessary Requires
* Wed May 23 2012 Marek Goldmann <mgoldman@redhat.com> 2.2.13-3
- Removed unnecessary %%global
- Added License file to -devel subpackage
- Removed static files
* Wed May 16 2012 Marek Goldmann <mgoldman@redhat.com> 2.2.13-2
- Added native part to the build
* Tue May 15 2012 Marek Goldmann <mgoldman@redhat.com> 2.2.13-1
- Initial packaging