forked from rhboot/nmbl-poc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (41 loc) · 1.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# SPDX-License-Identifier: GPLv3
#
# Makefile
# Copyright Peter Jones <[email protected]>
#
TOPDIR ?= $(realpath ./)
include $(TOPDIR)/utils.mk
MOCK_ROOT_NAME ?= $(OS_NAME)-$(OS_VERSION)-$(ARCH)
MOCK_ROOT_PATH ?= $(abspath $(shell mock -r "$(MOCK_ROOT_NAME)" --print-root-path)/../)
DEPLOY_HOST ?= nmbl
all:
dracut-nmbl-$(VERSION).tar.xz :
$(MAKE) -C dracut-nmbl tarball
mv -v dracut-nmbl/dracut-nmbl-$(VERSION).tar.xz .
dracut-nmbl-$(VR).src.rpm : dracut-nmbl.spec dracut-nmbl-$(VERSION).tar.xz
rpmbuild $(RPMBUILD_ARGS) -bs $<
dracut-nmbl-$(VR).noarch.rpm : dracut-nmbl-$(VR).src.rpm
mock -r "$(MOCK_ROOT_NAME)" --rebuild dracut-nmbl-$(VR).src.rpm
mv "$(MOCK_ROOT_PATH)/result/$@" .
nmbl-builder-$(VERSION).tar.xz :
$(MAKE) -C nmbl-builder tarball
mv -v nmbl-builder/nmbl-builder-$(VERSION).tar.xz .
nmbl-builder-$(VR).src.rpm : nmbl-builder.spec nmbl-builder-$(VERSION).tar.xz
rpmbuild $(RPMBUILD_ARGS) -bs $<
nmbl-$(KVRA).rpm: nmbl-builder-$(VR).src.rpm dracut-nmbl-$(VR).noarch.rpm
mock -r "$(MOCK_ROOT_NAME)" --install dracut-nmbl-$(VR).noarch.rpm --cache-alterations --no-cleanup-after
mock -r "$(MOCK_ROOT_NAME)" --installdeps nmbl-builder-$(VR).src.rpm --cache-alterations --no-clean --no-cleanup-after
mock -r "$(MOCK_ROOT_NAME)" --rebuild nmbl-builder-$(VR).src.rpm --no-clean
mv -v "$(MOCK_ROOT_PATH)/result/$@" .
rpm: nmbl-$(KVRA).rpm
deploy: nmbl-$(KVRA).rpm
scp $< "root@$(DEPLOY_HOST):"
ssh "root@$(DEPLOY_HOST)" ./deploy.sh "$<"
init-mock:
mock -r "$(MOCK_ROOT_NAME)" --init
clean-mock:
mock -r "$(MOCK_ROOT_NAME)" --clean
clean:
rm -vf $(wildcard *.tar *.tar.xz *.rpm *.spec)
.PHONY: all clean clean-mock init-mock deploy rpm
# vim:ft=make