%define apxs %{_sbindir}/apxs %define real_name mod_cluster %define _libdir64 %{_prefix}/lib64 Summary: Apache version 2.2.X HTTP load balancer Name: mod_cluster_ap22_64 Version: 1.3.0 Release: 1 License: LGPLv2 URL: http://jboss.org/mod_cluster Group: System Environment/Daemons Source0: %{real_name}-%{version}.Final.tar.gz Source1: %{real_name}.conf Source2: %{real_name}.README BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: apr-devel >= 1.4.6-2 BuildRequires: apr-util-devel >= 1.3.10-3 BuildRequires: httpd_64-devel >= 2.2.27-2 BuildRequires: httpd_64-devel < 2.3 PreReq: apr >= 1.4.6-2 PreReq: apr-util >= 1.3.10-3 PreReq: httpd_64 >= 2.2.27-2 PreReq: httpd_64 < 2.3 Provides: %{real_name} %description 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. %prep export PATH=/opt/freeware/bin:$PATH %setup -q -n %{real_name}-%{version}.Final %build export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" cd native module_dirs="advertise mod_cluster_slotmem mod_manager mod_proxy_cluster" for dir in ${module_dirs} ; do cd ${dir} sh buildconf ./configure \ --with-apxs=%{apxs} make %{?_smp_mflags} cd .. done %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} mkdir -p ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules chmod 0755 ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra chmod 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra chmod 0644 ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf/extra/* cp %{SOURCE2} README cd native module_dirs="advertise mod_cluster_slotmem mod_manager mod_proxy_cluster" for dir in ${module_dirs} ; do cd ${dir} cp ./*.so ${RPM_BUILD_ROOT}%{_libdir64}/httpd/modules cd .. done %preun if [ "$1" = 0 ]; then cat %{_sysconfdir}/httpd/conf/httpd.conf | \ grep -v "# mod_cluster settings" | \ grep -v "Include conf/extra/mod_cluster.conf" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" fi %post cat %{_sysconfdir}/httpd/conf/httpd.conf | \ grep -v "# mod_cluster settings" | \ grep -v "Include conf/extra/mod_cluster.conf" \ > %{_sysconfdir}/httpd/conf/tmp_httpd.conf mv -f %{_sysconfdir}/httpd/conf/tmp_httpd.conf %{_sysconfdir}/httpd/conf/httpd.conf echo "# mod_cluster settings" >> %{_sysconfdir}/httpd/conf/httpd.conf echo "Include conf/extra/mod_cluster.conf" >> %{_sysconfdir}/httpd/conf/httpd.conf echo "Please restart your web server using: '/opt/freeware/sbin/apachectl restart'" %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc README lgpl.txt %config(noreplace) %{_sysconfdir}/httpd/conf/extra/*.conf %{_libdir64}/httpd/modules/* %changelog * Wed Nov 12 2014 Michael Perzl - 1.3.0-1 - first version for AIX V5.1 and higher