-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
54 lines (41 loc) · 1.32 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
.PHONY: env changelog sources srpm rpm clean
DIST ?= epel-6-x86_64
VENV ?= .venv
PIP ?= $(VENV)/bin/pip
PYTHON ?= $(VENV)/bin/python
PYVER ?= python2.7
PROGRAM := pyscaleio
PACKAGE := python-scaleio
VERSION := $(shell rpm -q --qf "%{version}\n" --specfile $(PACKAGE).spec | head -1)
RELEASE := $(shell rpm -q --qf "%{release}\n" --specfile $(PACKAGE).spec | head -1)
all: env
env:
ifeq ($(wildcard $(PIP)),)
virtualenv $(VENV) --python=$(PYVER)
endif
$(PIP) uninstall $(PROGRAM) -q -y ||:
$(PYTHON) setup.py develop
ifneq ($(wildcard $(PIP)),)
changelog:
$(PYTHON) setup.py install
endif
sources: clean
@git archive --format=tar --prefix="$(PROGRAM)-$(VERSION)/" \
$(shell git rev-parse --verify HEAD) | gzip > "$(PROGRAM)-$(VERSION).tar.gz"
srpm: sources
@mkdir -p srpms/
rpmbuild -bs --define "_sourcedir $(CURDIR)" \
--define "_srcrpmdir $(CURDIR)/srpms" $(PACKAGE).spec
rpm:
@mkdir -p rpms/$(DIST)
/usr/bin/mock -r $(DIST) \
--rebuild srpms/$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm \
--resultdir rpms/$(DIST) --no-cleanup-after
copr: srpm
@copr-cli build --nowait miushanov/pyscaleio \
srpms/$(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm
pypi:
@python setup.py sdist bdist_wheel upload
clean:
@rm -rf .coverage .coverage-report .venv/ build/ dist/ \
.tox/ *.egg* .eggs/ rpms/ srpms/ *.tar.gz *.rpm