9d2bc8
%{!?_httpd_apxs:       %{expand: %%global _httpd_apxs       %%{_sbindir}/apxs}}
4e1944
%{!?_httpd_mmn:        %{expand: %%global _httpd_mmn        %%(cat %{_includedir}/httpd/.mmn || echo 0-0)}}
9d2bc8
%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
9d2bc8
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
9d2bc8
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
48a2d2
a2841e
%global namedreltag .Final
a2841e
%global namedversion %{version}%{?namedreltag}
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
%if 0%{?fedora}
Michal Karm Babacek 6bf9d2
%bcond_with java
Marek Goldmann 8e4ec0
%endif
Marek Goldmann 8e4ec0
Michal Karm Babacek 6bf9d2
Name:          mod_cluster
Michal Karm Babacek 6bf9d2
Version:       1.3.3
Michal Karm Babacek 7e9002
Release:       6%{?dist}
Michal Karm Babacek 6bf9d2
Summary:       Apache HTTP Server dynamic load balancer with Wildfly and Tomcat libraries
Michal Karm Babacek 6bf9d2
License:       LGPLv3
Michal Karm Babacek 6bf9d2
URL:           http://modcluster.io/
Michal Karm Babacek 6bf9d2
Source0:       https://github.com/modcluster/mod_cluster/archive/%{namedversion}/%{name}-%{namedversion}.tar.gz
Michal Karm Babacek 6bf9d2
Source1:       mod_cluster.conf
Michal Karm Babacek 6bf9d2
Source2:       README.fedora
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
Patch0:        MODCLUSTER-528-CatalinaContext.java.patch
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
Requires:      httpd >= 2.2.26
Michal Karm Babacek 6bf9d2
Requires:      httpd-mmn = %{_httpd_mmn}
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
BuildRequires: httpd-devel >= 2.2.26
Marek Goldmann 5eedfb
BuildRequires: autoconf
a2841e
BuildRequires: make
a2841e
BuildRequires: gcc
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
%if %{without java}
Michal Karm Babacek 6bf9d2
BuildRequires: maven-local
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(net.jcip:jcip-annotations)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
Michal Karm Babacek 7e9002
BuildRequires: mvn(org.apache.maven.plugins:maven-release-plugin)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.apache.tomcat:tomcat-catalina)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.apache.tomcat:tomcat-coyote)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.apache.tomcat:tomcat-util)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.jboss:jboss-parent:pom:)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.jboss.logging:jboss-logging)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.jboss.logging:jboss-logging-processor)
Michal Karm Babacek 6bf9d2
BuildRequires: mvn(org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec)
Michal Karm Babacek 6bf9d2
%endif
Michal Karm Babacek 6bf9d2
Marek Goldmann 5eedfb
%description
Marek Goldmann 5eedfb
Mod_cluster is an httpd-based load balancer. Like mod_jk and mod_proxy,
Marek Goldmann 5eedfb
mod_cluster uses a communication channel to forward requests from httpd to one
Marek Goldmann 5eedfb
of a set of application server nodes. Unlike mod_jk and mod_proxy, mod_cluster
Marek Goldmann 5eedfb
leverages an additional connection between the application server nodes and
Marek Goldmann 5eedfb
httpd. The application server nodes use this connection to transmit server-side
Marek Goldmann 5eedfb
load balance factors and lifecycle events back to httpd via a custom set of
Marek Goldmann 5eedfb
HTTP methods, affectionately called the Mod-Cluster Management Protocol (MCMP).
Marek Goldmann 5eedfb
This additional feedback channel allows mod_cluster to offer a level of
Marek Goldmann 5eedfb
intelligence and granularity not found in other load balancing solutions.
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
%if %{without java}
a2841e
%package java
Michal Karm Babacek 6bf9d2
Summary:          Java libraries for %{name}
Michal Karm Babacek 6bf9d2
BuildArch:        noarch
a2841e
a2841e
%description java
Michal Karm Babacek 6bf9d2
This package contains %{name} core Java libraries
Michal Karm Babacek 6bf9d2
that can be used with WildFly application server.
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%package java-tomcat8
Michal Karm Babacek 6bf9d2
Summary:          Tomcat 8 Java libraries for %{name}
Michal Karm Babacek 6bf9d2
Requires:         tomcat >= 1:8
Michal Karm Babacek 6bf9d2
BuildArch:        noarch
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%description java-tomcat8
Michal Karm Babacek 6bf9d2
This package contains %{name} Java libraries that can be used with Tomcat 8.
a2841e
a2841e
%package javadoc
Michal Karm Babacek 6bf9d2
Summary:          Javadoc for %{name}
Michal Karm Babacek 6bf9d2
BuildArch:        noarch
Marek Goldmann 5eedfb
a2841e
%description javadoc
a2841e
This package contains the API documentation for %{name}.
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%package container
Michal Karm Babacek 7e9002
Summary:          Mod_cluster Container Parent POM
Michal Karm Babacek 7e9002
BuildArch:        noarch
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%description container
Michal Karm Babacek 7e9002
Mod_cluster Container Parent POM.
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%package parent
Michal Karm Babacek 7e9002
Summary:          Mod_cluster Parent POM.
Michal Karm Babacek 7e9002
BuildArch:        noarch
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%description parent
Michal Karm Babacek 7e9002
Mod_cluster Parent POM.
Michal Karm Babacek 7e9002
Marek Goldmann 8e4ec0
%endif
Marek Goldmann 5eedfb
a2841e
%prep
Michal Karm Babacek 6bf9d2
%setup -q -n %{name}-%{namedversion}
Michal Karm Babacek 6bf9d2
%patch0 -p0
Marek Goldmann a998e6
Michal Karm Babacek 6bf9d2
%if %{without java}
Marek Goldmann a998e6
%pom_disable_module demo
Michal Karm Babacek 6bf9d2
%pom_disable_module tomcat6 container
Michal Karm Babacek 6bf9d2
%pom_disable_module tomcat7 container
Michal Karm Babacek 6bf9d2
%pom_disable_module jbossweb container
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%pom_remove_plugin :animal-sniffer-maven-plugin
Michal Karm Babacek 6bf9d2
%pom_remove_plugin :versions-maven-plugin
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%pom_change_dep :jboss-servlet-api_3.0_spec org.apache.tomcat:tomcat-util container/catalina
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%pom_change_dep org.apache.tomcat: ::'${version.tomcat8}' container/catalina
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%pom_change_dep :catalina :tomcat-catalina:'${version.tomcat8}' container/catalina-standalone
Michal Karm Babacek 6bf9d2
%pom_change_dep :coyote :tomcat-coyote:'${version.tomcat8}' container/catalina-standalone
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%pom_xpath_remove "pom:dependency[pom:type = 'test-jar']" container/tomcat8
Michal Karm Babacek 6bf9d2
%pom_xpath_inject "pom:profile[pom:id = 'TC8']/pom:modules" "<module>catalina-standalone</module>"  container
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%pom_xpath_set "pom:profile[pom:id = 'TC7']/pom:id" TC8 container/catalina
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 7e9002
# Wildfly/core lib
Michal Karm Babacek 6bf9d2
%mvn_package ":mod_cluster-core" java
Michal Karm Babacek 6bf9d2
%mvn_package ":mod_cluster-container-spi" java
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%mvn_file :mod_cluster-core:jar: mod_cluster/mod_cluster-core tomcat/mod_cluster-core
Michal Karm Babacek 6bf9d2
%mvn_file :mod_cluster-container-spi:jar: mod_cluster/mod_cluster-container-spi tomcat/mod_cluster-container-spi
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
# Tomcat-ish
Michal Karm Babacek 7e9002
%mvn_package ":mod_cluster-container-tomcat8" java-tomcat8
Michal Karm Babacek 7e9002
%mvn_package ":mod_cluster-container-catalina-standalone" java-tomcat8
Michal Karm Babacek 7e9002
%mvn_package ":mod_cluster-container-catalina" java-tomcat8
Michal Karm Babacek 7e9002
Michal Karm Babacek 6bf9d2
%mvn_file :mod_cluster-container-catalina:jar: tomcat/mod_cluster-container-catalina 
Michal Karm Babacek 6bf9d2
%mvn_file :mod_cluster-container-catalina-standalone:jar: tomcat/mod_cluster-container-catalina-standalone
Michal Karm Babacek 6bf9d2
%mvn_file :mod_cluster-container-tomcat8:jar: tomcat/mod_cluster-container-tomcat8
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
# Disable useless artifacts generation, package __noinstall do not work
Michal Karm Babacek 6bf9d2
%pom_add_plugin org.apache.maven.plugins:maven-source-plugin . '
Michal Karm Babacek 6bf9d2
<configuration>
Michal Karm Babacek 6bf9d2
 <skipsource>true</skipsource>
Michal Karm Babacek 6bf9d2
</configuration>'
Michal Karm Babacek 6bf9d2
Marek Goldmann 8e4ec0
%endif
Marek Goldmann 5eedfb
Marek Goldmann 5eedfb
%build
Michal Karm Babacek 6bf9d2
Marek Goldmann 5eedfb
CFLAGS="$RPM_OPT_FLAGS"
Marek Goldmann 5eedfb
export CFLAGS
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
module_dirs=( advertise mod_manager mod_proxy_cluster mod_cluster_slotmem )
Marek Goldmann 5eedfb
Marek Goldmann 5eedfb
for dir in ${module_dirs[@]} ; do
9230fb
    pushd native/${dir}
Marek Goldmann 5eedfb
        sh buildconf
Michal Karm Babacek 6bf9d2
        %configure --libdir=%{_libdir} --with-apxs=%{_httpd_apxs}
Marek Goldmann 5eedfb
        make %{?_smp_mflags}
Marek Goldmann 5eedfb
    popd
Marek Goldmann 5eedfb
done
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
%if %{without java}
Michal Karm Babacek 6bf9d2
%mvn_build -s -f -- -PTC8
Marek Goldmann 8e4ec0
%endif
Marek Goldmann 5eedfb
a2841e
%install
Marek Goldmann 5eedfb
install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/httpd/modules
Michal Karm Babacek 7e9002
install -d -m 755 $RPM_BUILD_ROOT%{_httpd_confdir}
Marek Goldmann a998e6
Michal Karm Babacek 6bf9d2
module_dirs=( advertise mod_manager mod_proxy_cluster mod_cluster_slotmem )
Marek Goldmann 5eedfb
for dir in ${module_dirs[@]} ; do
9230fb
    pushd native/${dir}
Marek Goldmann 5eedfb
        cp ./*.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules
Marek Goldmann 5eedfb
    popd
Marek Goldmann 5eedfb
done
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
%if %{without java}
Michal Karm Babacek 6bf9d2
%mvn_install
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
ln -sf %{_javadir}/jboss-logging/jboss-logging.jar \
Michal Karm Babacek 6bf9d2
 $RPM_BUILD_ROOT%{_javadir}/tomcat/jboss-logging.jar
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%endif
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 7e9002
cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_httpd_confdir}/
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
install -pm 0644 %{SOURCE2} README
Marek Goldmann 5eedfb
a2841e
%files
Marek Goldmann 5eedfb
%doc README
Michal Karm Babacek 6bf9d2
%license lgpl.txt
Marek Goldmann 5eedfb
%{_libdir}/httpd/modules/mod_advertise.so
Marek Goldmann 5eedfb
%{_libdir}/httpd/modules/mod_manager.so
Marek Goldmann 5eedfb
%{_libdir}/httpd/modules/mod_proxy_cluster.so
Michal Karm Babacek 6bf9d2
%{_libdir}/httpd/modules/mod_cluster_slotmem.so
Marek Goldmann 5eedfb
%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
Marek Goldmann 5eedfb
Michal Karm Babacek 6bf9d2
%if %{without java}
Marek Goldmann a998e6
%files java -f .mfiles-java
Michal Karm Babacek 6bf9d2
%license lgpl.txt
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
%files java-tomcat8 -f .mfiles-java-tomcat8
Michal Karm Babacek 6bf9d2
%{_javadir}/tomcat/jboss-logging.jar
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%files javadoc -f .mfiles-javadoc
Michal Karm Babacek 7e9002
%license lgpl.txt
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%files container -f .mfiles-mod_cluster-container
Michal Karm Babacek 7e9002
%license lgpl.txt
Michal Karm Babacek 7e9002
Michal Karm Babacek 7e9002
%files parent -f .mfiles-mod_cluster-parent
Michal Karm Babacek 6bf9d2
%license lgpl.txt
Marek Goldmann 8e4ec0
%endif
a2841e
Marek Goldmann 5eedfb
%changelog
Michal Karm Babacek 7e9002
* Mon Aug 30 2016 gil cattaneo <puntogil@libero.it> 1.3.3-5
Michal Karm Babacek 7e9002
- remove useless pom macros
Michal Karm Babacek 7e9002
- add subpackages for parent POMs
Michal Karm Babacek 7e9002
- use custom _httpd_confdir macro
Michal Karm Babacek 0e223e
Michal Karm Babacek 6bf9d2
* Mon Aug 29 2016 gil cattaneo <puntogil@libero.it> 1.3.3-4
Michal Karm Babacek 6bf9d2
- fix BR list
Michal Karm Babacek 6bf9d2
- marked as noarch only the java stuff
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
* Mon Aug 29 2016 Michal Karm Babacek  <karm@fedoraproject.org> 1.3.3-3
Michal Karm Babacek 6bf9d2
- Added mvn(..) BuildRequires for Tomcat libs instead of direct dependency on tomcat package
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
* Mon Aug 29 2016 gil cattaneo <puntogil@libero.it> 1.3.3-2
Michal Karm Babacek 6bf9d2
- fix pom macros
Michal Karm Babacek 6bf9d2
Michal Karm Babacek 6bf9d2
* Mon Aug 29 2016 Michal Karm Babacek  <karm@fedoraproject.org> - 1.3.3-1
Michal Karm Babacek 6bf9d2
- Upstream release 1.3.3.Final
Michal Karm Babacek 6bf9d2
- Refactored spec file
Michal Karm Babacek 6bf9d2
df2b95
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.6-7
df2b95
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
df2b95
0eeac1
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.6-6
0eeac1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
0eeac1
9bb5dc
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.6-5
9bb5dc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
9bb5dc
852958
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.6-4
852958
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
852958
4e1944
* Thu Jan 23 2014 Joe Orton <jorton@redhat.com> - 1.2.6-3
4e1944
- fix _httpd_mmn expansion in absence of httpd-devel
4e1944
Marek Goldmann 8e4ec0
* Fri Jan 17 2014 Marek Goldmann <mgoldman@redhat.com> - 1.2.6-2
Marek Goldmann 8e4ec0
- Add support for conditional build that builds only HTTPD module
Marek Goldmann 8e4ec0
Marek Goldmann 1036ba
* Wed Sep 25 2013 Marek Goldmann <mgoldman@redhat.com> - 1.2.6-1
Marek Goldmann 1036ba
- Upstream release 1.2.6.Final
Marek Goldmann 1036ba
- Support for Apache 2.4 in mod_cluster.conf
Marek Goldmann 1036ba
Marek Goldmann a998e6
* Mon Aug 05 2013 Marek Goldmann <mgoldman@redhat.com> - 1.2.4-1
Marek Goldmann a998e6
- Upstream release 1.2.4.Final
Marek Goldmann a998e6
b39cf5
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-6
b39cf5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
b39cf5
23976a
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-5
23976a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
23976a
Stanislav Ochotnicky 5af739
* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 1.2.1-4
Stanislav Ochotnicky 5af739
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
Stanislav Ochotnicky 5af739
- Replace maven BuildRequires with maven-local
Stanislav Ochotnicky 5af739
940406
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-3
940406
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
940406
832db5
* Tue Jun 05 2012 Marek Goldmann <mgoldman@redhat.com> - 1.2.1-2
832db5
- Added missing container.pom
832db5
9230fb
* Mon May 07 2012 Marek Goldmann <mgoldman@redhat.com> - 1.2.1-1
9230fb
- Upstream release 1.2.1.Final
9230fb
- Port to httpd 2.4, RHBZ#813871
9230fb
a2841e
* Wed Mar 28 2012 Marek Goldmann <mgoldman@redhat.com> - 1.2.0-1
a2841e
- Upstream release 1.2.0.Final
a2841e
- Add java subpackage with AS7 required jars
a2841e
48a2d2
* Tue Mar 27 2012 Marek Goldmann <mgoldman@redhat.com> - 1.1.1-4
48a2d2
- Require httpd-mmn RHBZ#803068
48a2d2
267820
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-3
267820
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
267820
Marek Goldmann 5eedfb
* Fri Mar 11 2011 Marek Goldmann <mgoldman@redhat.com> - 1.1.1-2
Marek Goldmann 5eedfb
- Another round of cleanup in spec file
Marek Goldmann 5eedfb
- Patch that disables compilation-time warnings
Marek Goldmann 5eedfb
Marek Goldmann 5eedfb
* Thu Mar 10 2011 Marek Goldmann <mgoldman@redhat.com> - 1.1.1-1
Marek Goldmann 5eedfb
- Upstream release 1.1.1
Marek Goldmann 5eedfb
- Cleanup in spec file
Marek Goldmann 5eedfb
Marek Goldmann 5eedfb
* Fri Nov 12 2010 Marek Goldmann <mgoldman@redhat.com> - 1.1.0-1
Marek Goldmann 5eedfb
- Initial release
Marek Goldmann 5eedfb