From 7385dfc10018880e13526f7015432de0be792082 Mon Sep 17 00:00:00 2001 From: Steve Hill Date: Wed, 23 Nov 2016 14:45:52 -0500 Subject: [PATCH] Fix build_release to work on Ubuntu 14 --- install/Makefile | 41 ++++++++++----------- install/setup_test_machine.sh | 2 +- install/ubuntu/install_required_packages.sh | 2 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/install/Makefile b/install/Makefile index 4761b919b..3c7c157ce 100644 --- a/install/Makefile +++ b/install/Makefile @@ -91,16 +91,6 @@ PAGESPEED_MODULE = $(MOD_PAGESPEED_ROOT)/out/Release/libmod_pagespeed.so PAGESPEED_MODULE_24 = $(MOD_PAGESPEED_ROOT)/out/Release/libmod_pagespeed_ap24.so PAGESPEED_JS_MINIFY = $(MOD_PAGESPEED_ROOT)/out/Release/js_minify -# On systems dervied from the NCSA configuration files by Rob McCool, -# you enable a module by writing its .conf file into -# $(APACHE_ROOT)/mods-available/pagespeed.conf, and a single Load command into -# $(APACHE_ROOT)/mods-enabled/pagespeed.conf. So if that exists, then we'll -# try to automate that. -MODS_ENABLED_DIR = $(shell if [ -d $(APACHE_ROOT)/mods-enabled ]; then \ - echo $(APACHE_ROOT)/mods-enabled; fi) -MODS_AVAILABLE_DIR = $(shell if [ -d $(APACHE_ROOT)/mods-available ]; then \ - echo $(APACHE_ROOT)/mods-available; fi) - # Determines where mod_pagespeed should put cache. MOD_PAGESPEED_CACHE = /var/cache/mod_pagespeed @@ -119,6 +109,16 @@ ENABLE_PROXY = 0 DISTRO_NAME = $(shell lsb_release -is | tr A-Z a-z) include $(MOD_PAGESPEED_ROOT)/install/$(DISTRO_NAME)/make_vars.mk +# On systems derived from the NCSA configuration files by Rob McCool, +# you enable a module by writing its .conf file into +# $(APACHE_ROOT)/mods-available/pagespeed.conf, and a single Load command into +# $(APACHE_ROOT)/mods-enabled/pagespeed.conf. So if that exists, then we'll +# try to automate that. +MODS_ENABLED_DIR = $(shell if [ -d $(APACHE_ROOT)/mods-enabled ]; then \ + echo $(APACHE_ROOT)/mods-enabled; fi) +MODS_AVAILABLE_DIR = $(shell if [ -d $(APACHE_ROOT)/mods-available ]; then \ + echo $(APACHE_ROOT)/mods-available; fi) + .PHONY : config_file echo_vars echo_vars : @@ -154,26 +154,27 @@ echo_vars : # but there is no implicit loading of modules, so we write our Load line # directly into our config file. -# In either case, independent configuration files go here (this directory -# is read by both distributions on startup after the modules load). -APACHE_CONF_D = $(APACHE_ROOT)/conf.d - ifeq ($(MODS_ENABLED_DIR),) # This is a CentOS-like installation, where there is no explicit .load # file, and we instead pre-pend the LoadModule command to the .conf file. -APACHE_CONF_DIR = $(APACHE_CONF_D) +APACHE_CONF_DIR = $(APACHE_ROOT)/conf.d CONF_SOURCES = $(STAGING_DIR)/pagespeed.load $(STAGING_DIR)/pagespeed.conf +MODS_ENABLED_INSTALL_COMMANDS = \ + cp -f $(STAGING_DIR)/pagespeed_libraries.conf \ + $(APACHE_CONF_DIR)/pagespeed_libraries.conf + else # This is an Ubuntu-like installation, where the .load files are placed # separately into a mods-enabled directory, and the .conf file is loaded # independently. MODS_ENABLED_INSTALL_COMMANDS = \ - rm -f $(MODS_ENABLED_DIR)/pagespeed.load ; \ - cp -f $(STAGING_DIR)/pagespeed.load $(MODS_AVAILABLE_DIR) ; \ - cd $(MODS_ENABLED_DIR) && ln -s ../mods-available/pagespeed.load ; \ + for file in pagespeed.load pagespeed_libraries.conf; do \ + cp -f $(STAGING_DIR)/$$file $(MODS_AVAILABLE_DIR) ; \ + cd $(MODS_ENABLED_DIR) && ln -sf ../mods-available/$$file ; \ + done; \ rm -f $(MODS_ENABLED_DIR)/headers.load ; \ cd $(MODS_ENABLED_DIR) && ln -s ../mods-available/headers.load ; \ rm -f $(MODS_ENABLED_DIR)/deflate.load ; \ @@ -309,8 +310,6 @@ staging : staging_except_module install_except_module : mod_pagespeed_file_root $(MODS_ENABLED_INSTALL_COMMANDS) cat $(CONF_SOURCES) > $(APACHE_CONF_DIR)/pagespeed.conf - cp -f $(STAGING_DIR)/pagespeed_libraries.conf \ - $(APACHE_CONF_D)/pagespeed_libraries.conf ln -Tsf $(STAGING_DIR)/mod_pagespeed_example \ $(APACHE_DOC_ROOT)/mod_pagespeed_example ln -Tsf $(STAGING_DIR)/mod_pagespeed_test \ @@ -383,7 +382,7 @@ setup_test_machine : APACHE_DOC_ROOT=$(APACHE_DOC_ROOT) \ APACHE_CONF_FILE=$(APACHE_CONF_FILE) \ MOD_PAGESPEED_ROOT=$(MOD_PAGESPEED_ROOT) \ - APACHE_CONF_D=$(APACHE_CONF_D) \ + APACHE_CONF_DIR=$(APACHE_CONF_DIR) \ ./setup_test_machine.sh sudo $(APACHE_CONTROL_PROGRAM) restart diff --git a/install/setup_test_machine.sh b/install/setup_test_machine.sh index ca011a5b4..3f5723499 100755 --- a/install/setup_test_machine.sh +++ b/install/setup_test_machine.sh @@ -41,7 +41,7 @@ done # We need to add the following configuration snippet into the global conf file, # if not already present. -conf_file="$APACHE_CONF_D/pagespeed_test.conf" +conf_file="$APACHE_CONF_DIR/pagespeed_test.conf" if grep -q pagespeed_test.conf $APACHE_CONF_FILE; then echo $conf_file is already included in $APACHE_CONF_FILE else diff --git a/install/ubuntu/install_required_packages.sh b/install/ubuntu/install_required_packages.sh index d3b558a6c..b3600dea3 100644 --- a/install/ubuntu/install_required_packages.sh +++ b/install/ubuntu/install_required_packages.sh @@ -33,7 +33,7 @@ install_redis_from_src=false if "$additional_test_packages"; then binary_packages+=(memcached libapache2-mod-php5) - if version_compare $(lsb_release -sr) -ge 14.04; then + if version_compare $(lsb_release -sr) -ge 16.04; then binary_packages+=(redis-server) else src_packages+=(redis-server)