forked from NDPF/dcache-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
21 lines (15 loc) · 791 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DEFAULT: all
version:
$(eval VERSION := $(shell cd src; grep 'VERSION' dcache_exporter.py))
$(eval VERSION := $(shell python -c "$(VERSION) ; print VERSION"))
build_tar: version
mkdir -p tar/dcache_exporter-$(VERSION)
rm -f tar/dcache_exporter-$(VERSION)/*
cp src/dcache_exporter.py tar/dcache_exporter-$(VERSION)/dcache_exporter
cp redhat/dcache_exporter.default tar/dcache_exporter-$(VERSION)
cp redhat/dcache_exporter.service tar/dcache_exporter-$(VERSION)
cd tar ; tar -czvf ../dcache-exporter-$(VERSION).tar.gz dcache_exporter-$(VERSION)/*
build_rpm: build_tar version
rpmbuild -bb --define '_version $(VERSION)' --define '_source dcache-exporter-$(VERSION).tar.gz' --define "_sourcedir ${PWD}" dcache_exporter.spec
all: build_rpm
.PHONY: build_tar build_rpm version all