forked from openscanhub/openscanhub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (63 loc) · 2.57 KB
/
Copy pathMakefile
File metadata and controls
95 lines (63 loc) · 2.57 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
all: help
help:
@echo "Usage: make <target>"
@echo
@echo "Available targets are:"
@echo " help show this text"
@echo " build builds development environment without the client"
@echo " clean remove python bytecode and temp files"
@echo " clean-dev also cleans up development environment"
@echo " deploy builds and starts development environment without the client"
@echo " full-build builds development environment with the client"
@echo " full-deploy builds and starts development environment with the client"
@echo " install install program on current system"
@echo " lint run pre-commit linters on branch"
@echo " lint-all run pre-commit linters on all files"
@echo " source create source tarball"
@echo " srpm craete source RPM"
install:
@python3 setup.py install
build:
@containers/scripts/deploy.sh --no-start
full-build:
@containers/scripts/deploy.sh --no-start --full-dev
deploy:
@containers/scripts/init-db.sh --minimal
full-deploy:
@containers/scripts/init-db.sh --minimal --full-dev
clean-local-python:
@python3 setup.py clean
clean-local-files:
rm -f ./*.src.rpm
rm -rf dist
find . -\( -name "*.pyc" -o -name '*.pyo' -o -name "*~" -\) -delete
clean: clean-local-python clean-local-files
clean-dev: clean-local-files
@containers/scripts/deploy.sh --clean
source: clean
@python3 setup.py sdist --formats=gztar
# path to the distribution tarball produced by `setup.py dist`
TGZ_ORIG = $(shell echo dist/*.tar.gz)
# top-level directory in the distribution tarball used by `setup.py dist`
TGZ_DIR_ORIG = $(shell basename $(TGZ_ORIG) .tar.gz)
# version used by the RPM packaing
VERSION = $(shell scripts/get-version.sh)
# top-level directory in the distribution tarball used by the source RPM
TGZ_DIR = osh-$(VERSION)
# path to the distribution tarball used by the source RPM
TGZ = dist/$(TGZ_DIR).tar.gz
srpm: source
tar -xzf $(TGZ_ORIG) -C dist --transform 's/$(TGZ_DIR_ORIG)/$(TGZ_DIR)/'
tar -czf $(TGZ) -C dist --remove-files $(TGZ_DIR)
echo "%global version $(VERSION)" > dist/osh.spec
cat osh.spec >> dist/osh.spec
rpmbuild -bs "dist/osh.spec" \
--define "_sourcedir ./dist" \
--define "_specdir ." \
--define "_srcrpmdir ."
REMOTE ?= origin
BRANCH ?= main
lint:
pre-commit run --show-diff-on-failure --color=always --from-ref $(REMOTE)/$(BRANCH) --to-ref HEAD
lint-all:
pre-commit run --show-diff-on-failure --color=always --all-files