forked from ansible/tower-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (43 loc) · 1.98 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
55
56
57
58
59
60
VERSION := $(shell python -c "exec(open('''tower_cli/constants.py''').read(), globals()); print VERSION")
RELEASE := $(shell python -c "exec(open('''tower_cli/constants.py''').read(), globals()); print RELEASE")
MOCK_BIN ?= mock
el6: dist/ansible-tower-cli-$(VERSION).tar.gz rpm-build/ansible-tower-cli-${VERSION}.spec
mock -r epel-6-x86_64 --buildsrpm --spec rpm-build/ansible-tower-cli-${VERSION}.spec --sources dist/ --resultdir rpm-build
mock -r epel-6-x86_64 --rebuild rpm-build/ansible-tower-cli-${VERSION}-${RELEASE}.el6.src.rpm --resultdir rpm-build
el7: dist/ansible-tower-cli-$(VERSION).tar.gz rpm-build/ansible-tower-cli-${VERSION}.spec
$(MOCK_BIN) -r epel-7-x86_64 --buildsrpm --spec rpm-build/ansible-tower-cli-${VERSION}.spec --sources dist/ --resultdir rpm-build
$(MOCK_BIN) -r epel-7-x86_64 --rebuild rpm-build/ansible-tower-cli-${VERSION}-${RELEASE}.el7.src.rpm --resultdir rpm-build
all: el6 el7
remove_complied:
find . -type d -name "__pycache__" -delete
find . -name '*.pyc' -delete
clean: remove_complied
rm -rf dist
rm -rf build
rm -rf ansible_tower_cli.egg-info
rm -rf rpm-build
dist/ansible-tower-cli-$(VERSION).tar.gz: docs/source/HISTORY.rst LICENSE MANIFEST.in README.rst requirements.txt setup.py setup.cfg
@python setup.py sdist
rpm-build/ansible-tower-cli-${VERSION}.spec: packaging/rpm/ansible-tower-cli.spec rpm-build/.exists
cat packaging/rpm/ansible-tower-cli.spec | sed 's:__VERSION__:$(VERSION):' | sed 's:__RELEASE__:$(RELEASE):' > ./rpm-build/ansible-tower-cli-${VERSION}.spec
rpm-build/.exists:
mkdir -p rpm-build
touch rpm-build/.exists
# For devel convenience
install:
python setup.py install
local_install:
python setup.py install --user
refresh: clean install
clean_v2:
rm -rf tower_cli_v2
rm -rf ansible_tower_cli_v2.egg-info
rm -rf setup_v2.py
setup_v2.py:
cp -R tower_cli tower_cli_v2/
cp setup.py setup_v2.py
python version_swap.py
prep_v2: setup_v2.py
install_v2: setup_v2.py
python setup_v2.py install
v2-refresh: clean clean_v2 install_v2