mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add support for rpm builds through mock
This commit is contained in:
parent
2e2e5d5321
commit
eede23ab0d
1 changed files with 19 additions and 1 deletions
20
Makefile
20
Makefile
|
@ -14,7 +14,7 @@
|
||||||
########################################################
|
########################################################
|
||||||
# variable section
|
# variable section
|
||||||
|
|
||||||
NAME = "ansible"
|
NAME = ansible
|
||||||
OS = $(shell uname -s)
|
OS = $(shell uname -s)
|
||||||
|
|
||||||
# Manpages are currently built with asciidoc -- would like to move to markdown
|
# Manpages are currently built with asciidoc -- would like to move to markdown
|
||||||
|
@ -55,6 +55,10 @@ ifeq ($(OFFICIAL),)
|
||||||
endif
|
endif
|
||||||
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"
|
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"
|
||||||
|
|
||||||
|
# MOCK build parameters
|
||||||
|
MOCK_BIN ?= mock
|
||||||
|
MOCK_CFG ?=
|
||||||
|
|
||||||
NOSETESTS ?= nosetests
|
NOSETESTS ?= nosetests
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
|
@ -129,6 +133,20 @@ rpmcommon: $(MANPAGES) sdist
|
||||||
@cp dist/*.gz rpm-build/
|
@cp dist/*.gz rpm-build/
|
||||||
@sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}#' $(RPMSPEC) >rpm-build/$(NAME).spec
|
@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
|
srpm: rpmcommon
|
||||||
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
|
@rpmbuild --define "_topdir %(pwd)/rpm-build" \
|
||||||
--define "_builddir %{_topdir}" \
|
--define "_builddir %{_topdir}" \
|
||||||
|
|
Loading…
Reference in a new issue