Builds an RPM for EL6 with SCL python27 and httpd24

This commit is contained in:
Graham Mainwaring 2016-03-10 16:44:31 -05:00
parent 46bbc83d0d
commit 9bd1520efb
2 changed files with 28 additions and 11 deletions

View File

@ -16,6 +16,7 @@ DEPS_SCRIPT ?= packaging/bundle/deps.py
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
VENV_BASE ?= /tower_devel/venv
SCL_PREFIX ?=
CLIENT_TEST_DIR ?= build_test
@ -109,6 +110,7 @@ MOCK_CFG ?=
RPM_SPECDIR= packaging/rpm
RPM_SPEC = $(RPM_SPECDIR)/$(NAME).spec
RPM_DIST ?= $(shell rpm --eval '%{?dist}' 2>/dev/null)
# Provide a fallback value for RPM_DIST
ifeq ($(RPM_DIST),)
RPM_DIST = .el6
@ -118,7 +120,17 @@ RPM_ARCH ?= $(shell rpm --eval '%{_arch}' 2>/dev/null)
ifeq ($(RPM_ARCH),)
RPM_ARCH = $(shell uname -m)
endif
RPM_NVR = $(NAME)-$(VERSION)-$(RELEASE)$(RPM_DIST)
# Software collections settings if on EL6
ifeq ($(RPM_DIST),.el6)
SCL_PREFIX = python27-
SCL_DEFINES = --define 'scl python27'
else
SCL_PREFIX =
SCL_DEFINES =
endif
RPM_NVR = $(SCL_PREFIX)$(NAME)-$(VERSION)-$(RELEASE)$(RPM_DIST)
# TAR Bundle build parameters
DIST = $(shell echo $(RPM_DIST) | sed -e 's|^\.\(el\)\([0-9]\).*|\1|')
@ -701,7 +713,7 @@ rpmtar: sdist rpm-build/$(SDIST_TAR_FILE)
rpm-build/$(RPM_NVR).src.rpm: /etc/mock/$(MOCK_CFG).cfg
$(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build \
--define "tower_version $(VERSION)" --define "tower_release $(RELEASE)"
--define "tower_version $(VERSION)" --define "tower_release $(RELEASE)" $(SCL_DEFINES)
mock-srpm: rpmtar rpm-build/$(RPM_NVR).src.rpm
@echo "#############################################"
@ -711,7 +723,7 @@ mock-srpm: rpmtar rpm-build/$(RPM_NVR).src.rpm
rpm-build/$(RPM_NVR).$(RPM_ARCH).rpm: rpm-build/$(RPM_NVR).src.rpm
$(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build --rebuild rpm-build/$(RPM_NVR).src.rpm \
--define "tower_version $(VERSION)" --define "tower_release $(RELEASE)"
--define "tower_version $(VERSION)" --define "tower_release $(RELEASE)" $(SCL_DEFINES)
mock-rpm: rpmtar rpm-build/$(RPM_NVR).$(RPM_ARCH).rpm
@echo "#############################################"
@ -843,9 +855,11 @@ packaging/packer/ansible-tower-$(VERSION)-vmx/ansible-tower-$(VERSION).vmx: pack
# TODO - figure out how to build the front-end and python requirements with
# 'build'
build:
export SCL_PREFIX
$(PYTHON) setup.py build
install:
export SCL_PREFIX
$(PYTHON) setup.py install $(SETUP_INSTALL_ARGS)
# Docker Compose Development environment

View File

@ -17,26 +17,29 @@ if os.getenv('OFFICIAL', 'no') == 'yes':
else:
build_timestamp = '-' + os.getenv("BUILD", datetime.datetime.now().strftime('0.git%Y%m%d%H%M'))
# Path prefix for when we're running under a software collection
scl_prefix = os.getenv('SCL_PREFIX', '')
# Paths we'll use later
etcpath = "/etc/tower"
etcpath = scl_prefix + "/etc/tower"
homedir = "/var/lib/awx"
sharedir = "/usr/share/awx"
bindir = "/usr/bin"
docdir = "/usr/share/doc/ansible-tower"
sharedir = scl_prefix + "/usr/share/awx"
bindir = scl_prefix + "/usr/bin"
docdir = scl_prefix + "/usr/share/doc/ansible-tower"
munin_plugin_path = "/etc/munin/plugins/"
munin_plugin_conf_path = "/etc/munin/plugin-conf.d"
if os.path.exists("/etc/debian_version"):
sysinit = "/etc/init.d"
webconfig = "/etc/apache2/conf.d"
sysinit = scl_prefix + "/etc/init.d"
webconfig = scl_prefix + "/etc/apache2/conf.d"
shutil.copy("config/awx-munin-ubuntu.conf", "config/awx-munin.conf")
# sosreport-3.1 (and newer) look in '/usr/share/sosreport/sos/plugins'
# sosreport-3.0 looks in '/usr/lib/python2.7/dist-packages/sos/plugins'
# debian/<package>.links will create symlinks to support both versions
sosconfig = "/usr/share/sosreport/sos/plugins"
else:
sysinit = "/etc/rc.d/init.d"
webconfig = "/etc/httpd/conf.d"
sysinit = scl_prefix + "/etc/rc.d/init.d"
webconfig = scl_prefix + "/etc/httpd/conf.d"
shutil.copy("config/awx-munin-el.conf", "config/awx-munin.conf")
# The .spec will create symlinks to support multiple versions of sosreport
sosconfig = "/usr/share/sosreport/sos/plugins"