From 265802322d74b95905e708f9364b89d9e5176990 Mon Sep 17 00:00:00 2001 From: James Laska Date: Wed, 26 Aug 2015 16:15:07 -0400 Subject: [PATCH] Add a new default build target Also override dh_auto_clean to avoid removing the awx/ui/dist during DEB package builds. Update the `.spec` file to call the same Makefile targets used by in `debian/rules`. --- Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6d8811e3d2..fde0d07f06 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,15 @@ OFFLINE_TAR_NAME=$(NAME)-offline-$(DIST_FULL)-$(VERSION)-$(RELEASE) OFFLINE_TAR_FILE=$(OFFLINE_TAR_NAME).tar.gz OFFLINE_TAR_LINK=$(NAME)-setup-latest.tar.gz +DISTRO := $(shell source /etc/os-release 2>/dev/null && echo $${ID} || echo redhat) +ifeq ($(DISTRO),ubuntu) + SETUP_INSTALL_ARGS = --skip-build --no-compile --root=$(DESTDIR) -v --install-layout=deb +else + SETUP_INSTALL_ARGS = --skip-build --no-compile --root=$(DESTDIR) -v +endif + +.DEFAULT_GOAL := build + .PHONY: clean rebase push requirements requirements_dev requirements_jenkins \ real-requirements real-requirements_dev real-requirements_jenkins \ develop refresh adduser syncdb migrate dbchange dbshell runserver celeryd \ @@ -153,10 +162,6 @@ push: # Install runtime, development and jenkins requirements requirements requirements_dev requirements_jenkins: %: real-% -# Create missing __init__.py files -awx/lib/site-packages/%/__init__.py: - touch $@ - # Install third-party requirements needed for development environment. # NOTE: # * --target is only supported on newer versions of pip @@ -502,5 +507,11 @@ virtualbox-centos-7: packaging/packer/output-virtualbox-iso/centos-7.ovf docker-dev: docker build --no-cache=true --rm=true -t ansible/tower_devel:latest tools/docker +# TODO - figure out how to build the front-end and python requirements with +# 'build' +build: + $(PYTHON) setup.py build + +# TODO - only use --install-layout=deb on Debian install: - $(PYTHON) setup.py install egg_info -b "" + $(PYTHON) setup.py install $(SETUP_INSTALL_ARGS)