提交 3a1a8f70 编写于 作者: C Cleber Rosa

Makefile: add explicit config to all mock commands

When generating RPM packages for different distros, it makes sense
to override the chosen mock config (the target distro) in the command
line, such as:

 $ make MOCK_CONFIG=epel-6-x86_64 rpm

So let's add the default value ("default" itself) to every mock command
and let the user running make to override it.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 83d43034
...@@ -21,6 +21,7 @@ RELEASE_COMMIT=$(shell git log --pretty=format:'%H' -n 1 $(VERSION)) ...@@ -21,6 +21,7 @@ RELEASE_COMMIT=$(shell git log --pretty=format:'%H' -n 1 $(VERSION))
RELEASE_SHORT_COMMIT=$(shell git log --pretty=format:'%h' -n 1 $(VERSION)) RELEASE_SHORT_COMMIT=$(shell git log --pretty=format:'%h' -n 1 $(VERSION))
COMMIT=$(shell git log --pretty=format:'%H' -n 1) COMMIT=$(shell git log --pretty=format:'%H' -n 1)
SHORT_COMMIT=$(shell git log --pretty=format:'%h' -n 1) SHORT_COMMIT=$(shell git log --pretty=format:'%h' -n 1)
MOCK_CONFIG=default
all: all:
@echo @echo
...@@ -78,19 +79,19 @@ install: ...@@ -78,19 +79,19 @@ install:
srpm: source srpm: source
if test ! -d BUILD/SRPM; then mkdir -p BUILD/SRPM; fi if test ! -d BUILD/SRPM; then mkdir -p BUILD/SRPM; fi
mock --resultdir BUILD/SRPM -D "commit $(COMMIT)" --buildsrpm --spec avocado.spec --sources SOURCES mock -r $(MOCK_CONFIG) --resultdir BUILD/SRPM -D "commit $(COMMIT)" --buildsrpm --spec avocado.spec --sources SOURCES
rpm: srpm rpm: srpm
if test ! -d BUILD/RPM; then mkdir -p BUILD/RPM; fi if test ! -d BUILD/RPM; then mkdir -p BUILD/RPM; fi
mock --resultdir BUILD/RPM -D "commit $(COMMIT)" --rebuild BUILD/SRPM/avocado-$(VERSION)-*.src.rpm mock -r $(MOCK_CONFIG) --resultdir BUILD/RPM -D "commit $(COMMIT)" --rebuild BUILD/SRPM/avocado-$(VERSION)-*.src.rpm
srpm-release: source-release srpm-release: source-release
if test ! -d BUILD/SRPM; then mkdir -p BUILD/SRPM; fi if test ! -d BUILD/SRPM; then mkdir -p BUILD/SRPM; fi
mock --resultdir BUILD/SRPM -D "commit $(RELEASE_COMMIT)" --buildsrpm --spec avocado.spec --sources SOURCES mock -r $(MOCK_CONFIG) --resultdir BUILD/SRPM -D "commit $(RELEASE_COMMIT)" --buildsrpm --spec avocado.spec --sources SOURCES
rpm-release: srpm-release rpm-release: srpm-release
if test ! -d BUILD/RPM; then mkdir -p BUILD/RPM; fi if test ! -d BUILD/RPM; then mkdir -p BUILD/RPM; fi
mock --resultdir BUILD/RPM -D "commit $(RELEASE_COMMIT)" --rebuild BUILD/SRPM/avocado-$(VERSION)-*.src.rpm mock -r $(MOCK_CONFIG) --resultdir BUILD/RPM -D "commit $(RELEASE_COMMIT)" --rebuild BUILD/SRPM/avocado-$(VERSION)-*.src.rpm
clean: clean:
$(PYTHON) setup.py clean $(PYTHON) setup.py clean
...@@ -169,6 +170,7 @@ variables: ...@@ -169,6 +170,7 @@ variables:
@echo "RELEASE_SHORT_COMMIT: $(RELEASE_SHORT_COMMIT)" @echo "RELEASE_SHORT_COMMIT: $(RELEASE_SHORT_COMMIT)"
@echo "COMMIT: $(COMMIT)" @echo "COMMIT: $(COMMIT)"
@echo "SHORT_COMMIT: $(SHORT_COMMIT)" @echo "SHORT_COMMIT: $(SHORT_COMMIT)"
@echo "MOCK_CONFIG: $(MOCK_CONFIG)"
.PHONY: source install clean check link variables .PHONY: source install clean check link variables
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册