diff options
author | James Laska <jlaska@ansible.com> | 2014-05-08 14:46:56 -0400 |
---|---|---|
committer | James Laska <jlaska@ansible.com> | 2014-05-08 14:47:20 -0400 |
commit | eede23ab0daf1f4e5547127319104771c5eeac99 (patch) | |
tree | 42876885269daa3808896bccc480506985d727b1 /Makefile | |
parent | 2e2e5d53215196309ff1f1395f4265cdbd61be7e (diff) | |
download | ansible-eede23ab0daf1f4e5547127319104771c5eeac99.tar.gz |
Add support for rpm builds through mock
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -14,7 +14,7 @@ ######################################################## # variable section -NAME = "ansible" +NAME = ansible OS = $(shell uname -s) # Manpages are currently built with asciidoc -- would like to move to markdown @@ -55,6 +55,10 @@ ifeq ($(OFFICIAL),) endif RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)" +# MOCK build parameters +MOCK_BIN ?= mock +MOCK_CFG ?= + NOSETESTS ?= nosetests ######################################################## @@ -129,6 +133,20 @@ rpmcommon: $(MANPAGES) sdist @cp dist/*.gz rpm-build/ @sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}#' $(RPMSPEC) >rpm-build/$(NAME).spec +mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon + $(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build/ --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/ + @echo "#############################################" + @echo "Ansible SRPM is built:" + @echo rpm-build/*.src.rpm + @echo "#############################################" + +mock-rpm: mock-srpm + $(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build/ --rebuild rpm-build/$(NAME)-*.src.rpm + @echo "#############################################" + @echo "Ansible RPM is built:" + @echo rpm-build/*.noarch.rpm + @echo "#############################################" + srpm: rpmcommon @rpmbuild --define "_topdir %(pwd)/rpm-build" \ --define "_builddir %{_topdir}" \ |