forked from Aiven-Open/journalpump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (38 loc) · 1.37 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
short_ver = 2.0.0
long_ver = $(shell git describe --long 2>/dev/null || echo $(short_ver)-0-unknown-g`git describe --always`)
all: py-egg
PYTHON ?= python3
PYLINT_DIRS = journalpump/ test/
test: pylint unittest flake8
unittest:
$(PYTHON) -m pytest -vv test/
pylint:
$(PYTHON) -m pylint.lint --rcfile .pylintrc $(PYLINT_DIRS)
flake8:
$(PYTHON) -m flake8 --max-line-length=125 $(PYLINT_DIRS)
coverage:
$(PYTHON) -m pytest $(PYTEST_ARG) --cov-report term-missing --cov journalpump test/
clean:
$(RM) -r *.egg-info/ build/ dist/
$(RM) ../journalpump_* test-*.xml
deb:
cp debian/changelog.in debian/changelog
dch -v $(long_ver) "Automatically built package"
dpkg-buildpackage -A -uc -us
rpm:
git archive --output=journalpump-rpm-src.tar.gz --prefix=journalpump/ HEAD
rpmbuild -bb journalpump.spec \
--define '_sourcedir $(shell pwd)' \
--define '_topdir $(shell pwd)/rpm' \
--define 'major_version $(shell git describe --tags --abbrev=0 | cut -f1-)' \
--define 'minor_version $(subst -,.,$(shell git describe --tags --long | cut -f2- -d-))'
$(RM) journalpump-rpm-src.tar.gz
build-dep-fed:
sudo dnf -y install \
python3-flake8 python3-kafka python3-pytest python3-pylint \
python3-requests systemd-python3
build-dep-deb:
sudo apt-get install \
build-essential devscripts dh-systemd \
python-all python-setuptools python3-systemd python3-kafka
.PHONY: rpm