forked from KonishchevDmitry/pcore
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
34 lines (24 loc) · 810 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
.PHONY: build install dist sources srpm rpm pypi clean
PYTHON ?= python
INSTALL_FLAGS ?=
NAME := pcore
RPM_NAME := python-$(NAME)
VERSION := $(shell sed -n s/[[:space:]]*Version:[[:space:]]*//p $(RPM_NAME).spec)
build:
$(PYTHON) setup.py build
install:
$(PYTHON) setup.py install --skip-build $(INSTALL_FLAGS)
dist: clean
$(PYTHON) setup.py sdist
cp dist/$(NAME)-*.tar.gz .
sources:
@git archive --format=tar --prefix="$(NAME)-$(VERSION)/" \
$(shell git rev-parse --verify HEAD) | gzip > $(NAME)-$(VERSION).tar.gz
srpm: dist
rpmbuild -bs --define "_sourcedir $(CURDIR)" $(RPM_NAME).spec
rpm: dist
rpmbuild -ba --define "_sourcedir $(CURDIR)" $(RPM_NAME).spec
pypi: clean
$(PYTHON) setup.py sdist upload
clean:
rm -rf build dist $(NAME)-*.tar.gz $(NAME).egg-info