forked from RedHatInsights/insights-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (35 loc) · 985 Bytes
/
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
TOPDIR=$(shell bash -c "pwd -P")
RPMTOP=$(TOPDIR)/dist
PKGNAME=insights-client
SRPM=$(RPMTOP)/SRPMS/$(PKGNAME)-*.src.rpm
TARBALL=$(RPMTOP)/$(PKGNAME)-*.tar.gz
RPM=$(RPMTOP)/RPMS/noarch/$(PKGNAME)*.rpm
OS_MAJOR_VER=$(shell python insights_client/major_version.py)
PY_SDIST=python setup.py sdist
all: rpm
.PHONY: tarball
tarball: $(TARBALL)
$(TARBALL): Makefile
if [ "$(OS_MAJOR_VER)" == "6" ]; then\
cp MANIFEST.rhel6 MANIFEST.in;\
else\
cp MANIFEST.rhel7 MANIFEST.in;\
fi
$(PY_SDIST)
rm MANIFEST.in
.PHONY: srpm rpm
srpm: $(SRPM)
$(SRPM): $(TARBALL) $(SPEC_FILE_IN)
mkdir -p $(RPMTOP)/{RPMS,SPECS,SRPMS,SOURCES,BUILD,BUILDROOT}
rpmbuild -ts --define="_topdir $(RPMTOP)" --define="_sourcedir dist" $(TARBALL)
.PHONY: rpm
rpm: $(RPM)
$(RPM): $(SRPM)
rpmbuild --buildroot $(RPMTOP)/BUILDROOT --define="_topdir $(RPMTOP)" --rebuild $<
install: $(RPM)
sudo yum install -y $(RPM)
clean:
rm -rf dist
rm -f MANIFEST
rm -rf *.egg*
find . -type f -name '*.pyc' -delete