forked from Tendrl/gluster-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (25 loc) · 847 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
NAME=tendrl-gluster-integration
VERSION := $(shell PYTHONPATH=. python -c \
'import version; print version.__version__' \
| sed 's/\.dev[0-9]*//')
RELEASE=10
COMMIT := $(shell git rev-parse HEAD)
SHORTCOMMIT := $(shell echo $(COMMIT) | cut -c1-7)
all: srpm
clean:
rm -rf dist/
rm -rf $(NAME)-$(VERSION).tar.gz
rm -rf $(NAME)-$(VERSION)-$(RELEASE).el7.src.rpm
dist:
python setup.py sdist \
&& mv dist/$(NAME)-$(VERSION).tar.gz .
srpm: dist
fedpkg --dist epel7 srpm
rpm: dist
mock -r epel-7-x86_64 rebuild $(NAME)-$(VERSION)-*.src.rpm --resultdir=. --define "dist .el7"
gitversion:
# Set version and release to the latest values from Git
sed -i $(NAME).spec \
-e "/^Release:/cRelease: $(shell date +"%Y%m%dT%H%M%S").$(SHORTCOMMIT)"
snapshot: gitversion srpm
.PHONY: dist rpm srpm gitversion snapshot