Blob Blame Raw
%{!?_httpd_apxs:       %{expand: %%global _httpd_apxs       %%{_sbindir}/apxs}}
%{!?_httpd_mmn:        %{expand: %%global _httpd_mmn        %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}

%global namedreltag .Final
%global namedversion %{version}%{?namedreltag}

Summary:    Apache HTTP load balancer
Name:       mod_cluster
Version:    1.2.1
Release:    5%{?dist}
License:    LGPLv2
Group:      System Environment/Daemons

# svn export mod_cluster-1.2.1.Final
# tar cafJ mod_cluster-1.2.1.Final.tar.xz mod_cluster-1.2.1.Final
Source:     mod_cluster-%{namedversion}.tar.xz

Source1:    mod_cluster.conf
Source2:    README.fedora

Patch0:     mod_cluster-%{namedversion}-pom.patch

Requires:      httpd >= 2.2.8
Requires:      httpd-mmn = %{_httpd_mmn}

BuildRequires: maven-local
BuildRequires: maven-enforcer-plugin
BuildRequires: jboss-parent
BuildRequires: jpackage-utils
BuildRequires: java-devel
BuildRequires: jcip-annotations
BuildRequires: jboss-logging
BuildRequires: jboss-servlet-3.0-api
BuildRequires: jboss-web
BuildRequires: httpd-devel >= 2.2.8
BuildRequires: autoconf
BuildRequires: make
BuildRequires: gcc
BuildRequires: tomcat-lib

Mod_cluster is an httpd-based load balancer. Like mod_jk and mod_proxy,
mod_cluster uses a communication channel to forward requests from httpd to one
of a set of application server nodes. Unlike mod_jk and mod_proxy, mod_cluster
leverages an additional connection between the application server nodes and
httpd. The application server nodes use this connection to transmit server-side
load balance factors and lifecycle events back to httpd via a custom set of
HTTP methods, affectionately called the Mod-Cluster Management Protocol (MCMP).
This additional feedback channel allows mod_cluster to offer a level of
intelligence and granularity not found in other load balancing solutions.

%package java
Summary:          Java bindings for %{name}
Group:            Development/Libraries
Requires:         jpackage-utils
Requires:         jcip-annotations
Requires:         jboss-logging
Requires:         jboss-servlet-3.0-api

%description java
This package contains Java part of %{name}.

%package javadoc
Summary:          Javadocs for %{name}
Group:            Documentation
Requires:         jpackage-utils

%description javadoc
This package contains the API documentation for %{name}.

%setup -q -n mod_cluster-%{namedversion}
%patch0 -p1

export CFLAGS

module_dirs=( advertise mod_manager mod_proxy_cluster mod_slotmem )

for dir in ${module_dirs[@]} ; do
    pushd native/${dir}
        sh buildconf
        ./configure --libdir=%{_libdir} --with-apxs=%{_httpd_apxs}
        make %{?_smp_mflags}

# Build the AS7 required libs
# Tests skipped because of lack of mockito library
mvn-rpmbuild -Dmaven.test.skip=true -P AS7 install javadoc:aggregate

install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/httpd/modules
install -d -m 755 $RPM_BUILD_ROOT/etc/httpd/conf.d
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}

module_dirs=( advertise mod_manager mod_proxy_cluster mod_slotmem )

for dir in ${module_dirs[@]} ; do
    pushd native/${dir}
        cp ./*.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules

cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/conf.d/

install -m 0644 %{SOURCE2} README

cp -p core/target/mod_cluster-core-%{namedversion}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/core.jar
cp -p container/catalina/target/mod_cluster-container-catalina-%{namedversion}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/container-catalina.jar
cp -p container/jbossweb/target/mod_cluster-container-jbossweb-%{namedversion}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/container-jbossweb.jar
cp -p container-spi/target/mod_cluster-container-spi-%{namedversion}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/container-spi.jar

cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}

install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-parent.pom
install -pm 644 core/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-core.pom
install -pm 644 container/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-container.pom
install -pm 644 container-spi/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-container-spi.pom
install -pm 644 container/catalina/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-container-catalina.pom
install -pm 644 container/jbossweb/pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{name}-container-jbossweb.pom

%add_maven_depmap JPP.%{name}-parent.pom
%add_maven_depmap JPP.%{name}-core.pom %{name}/core.jar
%add_maven_depmap JPP.%{name}-container-spi.pom %{name}/container-spi.jar
%add_maven_depmap JPP.%{name}-container.pom
%add_maven_depmap JPP.%{name}-container-jbossweb.pom %{name}/container-jbossweb.jar
%add_maven_depmap JPP.%{name}-container-catalina.pom %{name}/container-catalina.jar

%doc lgpl.txt
%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf

%files javadoc
%doc lgpl.txt

%files java
%doc lgpl.txt

* Thu Feb 14 2013 Fedora Release Engineering <> - 1.2.1-5
- Rebuilt for

* Wed Feb 06 2013 Java SIG <> - 1.2.1-4
- Update for
- Replace maven BuildRequires with maven-local

* Fri Jul 20 2012 Fedora Release Engineering <> - 1.2.1-3
- Rebuilt for

* Tue Jun 05 2012 Marek Goldmann <> - 1.2.1-2
- Added missing container.pom

* Mon May 07 2012 Marek Goldmann <> - 1.2.1-1
- Upstream release 1.2.1.Final
- Port to httpd 2.4, RHBZ#813871

* Wed Mar 28 2012 Marek Goldmann <> - 1.2.0-1
- Upstream release 1.2.0.Final
- Add java subpackage with AS7 required jars

* Tue Mar 27 2012 Marek Goldmann <> - 1.1.1-4
- Require httpd-mmn RHBZ#803068

* Fri Jan 13 2012 Fedora Release Engineering <> - 1.1.1-3
- Rebuilt for

* Fri Mar 11 2011 Marek Goldmann <> - 1.1.1-2
- Another round of cleanup in spec file
- Patch that disables compilation-time warnings

* Thu Mar 10 2011 Marek Goldmann <> - 1.1.1-1
- Upstream release 1.1.1
- Cleanup in spec file

* Fri Nov 12 2010 Marek Goldmann <> - 1.1.0-1
- Initial release