This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
71 lines (53 loc) · 1.56 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
PYTHON=python
VERSION=0.8
RPMDIR_PATH=${PWD}
all: build
SUBDIRS := systemd man
$(SUBDIRS):
$(MAKE) -C $@
INSTALL_TARGETS = $(SUBDIRS:%=install-%)
$(INSTALL_TARGETS):
$(MAKE) -C $(@:install-%=%) install
CLEAN_TARGETS = $(SUBDIRS:%=clean-%)
$(CLEAN_TARGETS):
$(MAKE) -C $(@:clean-%=%) clean
build: $(SUBDIRS)
$(PYTHON) setup.py build
test:
nosetests -v --nocapture
test-all:
tox
install: all $(INSTALL_TARGETS)
$(PYTHON) setup.py install --skip-build --root $(DESTDIR)/
clean: $(CLEAN_TARGETS)
$(PYTHON) setup.py clean
rm -rf build sdist SRPMS BUILD RPMS
rm -f $(ARCHIVE)
ARCHIVE = redhat-upgrade-tool-$(VERSION).tar.xz
archive: $(ARCHIVE)
redhat-upgrade-tool-$(VERSION).tar.xz:
git archive --format=tar --prefix=redhat-upgrade-tool-$(VERSION)/ HEAD \
| xz -c > $@ || rm $@
prep:
$(PYTHON) setup.py sdist --formats=gztar
cp boom-0.8.tar.gz dist/
srpm: prep
rpmbuild -bs redhat-upgrade-tool.spec \
--define "_sourcedir $(RPMDIR_PATH)/dist" \
--define "_srcrpmdir $(RPMDIR_PATH)/SRPMS" \
--define '_builddir $(RPMDIR_PATH)/BUILD' \
--define '_rpmdir $(RPMDIR_PATH)/RPMS' \
--define "rhel 6" \
--define 'dist .el6' \
--define 'el6 1'
local_rpm_build: prep
rpmbuild -ba redhat-upgrade-tool.spec \
--define "_sourcedir $(RPMDIR_PATH)/dist" \
--define "_srcrpmdir $(RPMDIR_PATH)/SRPMS" \
--define '_builddir $(RPMDIR_PATH)/BUILD' \
--define '_rpmdir $(RPMDIR_PATH)/RPMS' \
--define "rhel 6" \
--define 'dist .el6' \
--define 'el6 1'
.PHONY: all archive install clean
.PHONY: $(SUBDIRS) $(INSTALL_TARGETS) $(CLEAN_TARGETS)