From 05b37b77d93363bf58df0ff457767515fedde3b5 Mon Sep 17 00:00:00 2001 From: Joe Roberts Date: Sat, 6 May 2017 00:36:19 -0700 Subject: [PATCH] ONEARTH-396 Updated RPM to use mod_proxy with sub-request keepalives --- GNUmakefile | 39 +++++++++++++++++++++++++++++++++++-- deploy/onearth/onearth.spec | 16 +++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 224e28ad..5c38c2b8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -29,6 +29,16 @@ CGICC_URL=http://ftp.gnu.org/gnu/cgicc/$(CGICC_ARTIFACT) SPATIALINDEX_ARTIFACT=spatialindex-src-1.8.5.tar.gz SPATIALINDEX_URL=http://download.osgeo.org/libspatialindex/$(SPATIALINDEX_ARTIFACT) +HTTPD_VERSION=$(shell rpm -q --qf "%{VERSION}" $(shell rpm -q --whatprovides redhat-release)) +ifeq ($(HTTPD_VERSION), 6) + HTTPD_ARTIFACT=httpd-2.2.15.tar.gz + LINE=933 +else + HTTPD_ARTIFACT=httpd-2.4.6.tar.gz + LINE=735 +endif +HTTPD_URL=https://archive.apache.org/dist/httpd/$(HTTPD_ARTIFACT) + MAPSERVER_VERSION=7.0.1 MAPSERVER_ARTIFACT=mapserver-$(MAPSERVER_VERSION).tar.gz MAPSERVER_HOME=http://download.osgeo.org/mapserver @@ -37,13 +47,13 @@ MAPSERVER_URL=$(MAPSERVER_HOME)/$(MAPSERVER_ARTIFACT) all: @echo "Use targets onearth-rpm" -onearth: mpl-unpack cgicc-unpack spatialindex-unpack mapserver-unpack onearth-compile +onearth: mpl-unpack cgicc-unpack spatialindex-unpack httpd-unpack mapserver-unpack onearth-compile #----------------------------------------------------------------------------- # Download #----------------------------------------------------------------------------- -download: mpl-download cgicc-download spatialindex-download mapserver-download +download: mpl-download cgicc-download spatialindex-download httpd-download mapserver-download mpl-download: upstream/$(MPL_ARTIFACT).downloaded @@ -68,6 +78,14 @@ upstream/$(SPATIALINDEX_ARTIFACT).downloaded: rm -f upstream/$(SPATIALINDEX_ARTIFACT) ( cd upstream ; wget $(SPATIALINDEX_URL) ) touch upstream/$(SPATIALINDEX_ARTIFACT).downloaded + +httpd-download: upstream/$(HTTPD_ARTIFACT).downloaded + +upstream/$(HTTPD_ARTIFACT).downloaded: + mkdir -p upstream + rm -f upstream/$(HTTPD_ARTIFACT) + ( cd upstream ; wget $(HTTPD_URL) ) + touch upstream/$(HTTPD_ARTIFACT).downloaded mapserver-download: upstream/$(MAPSERVER_ARTIFACT).downloaded @@ -103,6 +121,18 @@ build/spatialindex/VERSION: --strip-components=1 --exclude=.gitignore cd build/spatialindex && ./configure --libdir=$(DESTDIR)/$(LIB_PREFIX)/$(LIB_DIR) --prefix=$(DESTDIR)/$(LIB_PREFIX) $(MAKE) -C build/spatialindex + +httpd-unpack: build/httpd/VERSION + +build/httpd/VERSION: + mkdir -p build/httpd + mkdir -p /tmp/httpd + tar xf upstream/$(HTTPD_ARTIFACT) -C build/httpd \ + --strip-components=1 --exclude=.gitignore + sed -i "${LINE}d" build/httpd/modules/proxy/mod_proxy_http.c + cd build/httpd && ./configure --prefix=/tmp/httpd --enable-proxy=shared --enable-proxy-balancer=shared + cd build/httpd && make + cd build/httpd && make install mapserver-unpack: build/mapserver/VERSION @@ -254,6 +284,10 @@ onearth-install: install -m 755 -d $(DESTDIR)/$(LIB_PREFIX)/$(LIB_DIR) $(MAKE) install -C build/spatialindex + # Install patched mod_proxy + install -m 755 -d $(DESTDIR)/$(PREFIX)/$(LIB_DIR)/httpd/modules/mod_proxy + cp -r /tmp/httpd/modules/mod_proxy* $(DESTDIR)/$(PREFIX)/$(LIB_DIR)/httpd/modules/mod_proxy + rm -rf /tmp/httpd/ #----------------------------------------------------------------------------- # Local install @@ -292,6 +326,7 @@ onearth-rpm: onearth-artifact upstream/$(MPL_ARTIFACT) \ upstream/$(CGICC_ARTIFACT) \ upstream/$(SPATIALINDEX_ARTIFACT) \ + upstream/$(HTTPD_ARTIFACT) \ upstream/$(MAPSERVER_ARTIFACT) \ dist/onearth-$(ONEARTH_VERSION).tar.bz2 \ build/rpmbuild/SOURCES diff --git a/deploy/onearth/onearth.spec b/deploy/onearth/onearth.spec index 9c86ec20..f0b47538 100644 --- a/deploy/onearth/onearth.spec +++ b/deploy/onearth/onearth.spec @@ -10,6 +10,12 @@ Source1: https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.5.1.t Source2: http://ftp.gnu.org/gnu/cgicc/cgicc-3.2.16.tar.gz Source3: http://download.osgeo.org/libspatialindex/spatialindex-src-1.8.5.tar.gz Source4: http://download.osgeo.org/mapserver/mapserver-7.0.1.tar.gz +%if 0%{?centos} == 6 +Source5: https://archive.apache.org/dist/httpd/httpd-2.2.15.tar.gz +%endif +%if 0%{?centos} == 7 +Source5: https://archive.apache.org/dist/httpd/httpd-2.4.6.tar.gz +%endif BuildRequires: httpd-devel BuildRequires: chrpath @@ -124,6 +130,7 @@ cp %{SOURCE1} upstream cp %{SOURCE2} upstream cp %{SOURCE3} upstream cp %{SOURCE4} upstream +cp %{SOURCE5} upstream %build make onearth PREFIX=%{_prefix} @@ -212,6 +219,7 @@ rm -rf %{buildroot} %files %{_libdir}/httpd/modules/* +%{_libdir}/httpd/modules/mod_proxy/* %defattr(-,gibs,gibs,775) %dir %{_datadir}/onearth %defattr(775,gibs,gibs,775) @@ -226,6 +234,14 @@ cd %{_datadir}/cgicc/ %{_datadir}/cgicc/configure --prefix=/usr make install +for file in %{_libdir}/httpd/modules/mod_proxy*.so; do + mv "$file" "%{_libdir}/httpd/modules/`basename "$file" .so`.save" +done +cd %{_libdir}/httpd/modules/ +for file in %{_libdir}/httpd/modules/mod_proxy/*.so; do + ln -s "$file" `basename "$file"` +done + %files tools %defattr(755,root,root,-) %{_bindir}/oe_generate_legend.py