forked from pykickstart/pykickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
155 lines (127 loc) · 6.12 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
PKGNAME=pykickstart
SPECFILE=$(PKGNAME).spec
VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE) | sed -e 's|%.*$$||g')
RC_RELEASE ?= $(shell date -u +0.1.%Y%m%d%H%M%S)
TAG=r$(VERSION)-$(RELEASE)
ZANATA_PULL_ARGS = --transdir ./po/
ZANATA_PUSH_ARGS = --srcdir ./po/ --push-type source --force
MANDIR=/usr/share/man
PREFIX=/usr
tests := $(wildcard tests/*py tests/commands/*py tests/tools/*py)
NOSEARGS=-s -v -I __init__.py -I baseclass.py
PYTHON?=python3
ifeq ($(PYTHON),python3)
COVERAGE=coverage3
# Coverage + multiprocessing does not work under python2. Oh well, just don't use multiprocessing there.
# We default to python3 now so everyone else can just deal with the slowness.
NOSEARGS+=--processes=-1 $(tests)
else
COVERAGE?=coverage
NOSEARGS+=$(filter-out tests/attrs.py,$(tests))
endif
MOCKCHROOT ?= fedora-rawhide-$(shell uname -m)
all:
$(MAKE) -C po
po-pull:
rpm -q zanata-python-client &>/dev/null || ( echo "need to run: dnf install zanata-python-client"; exit 1 )
zanata pull $(ZANATA_PULL_ARGS)
po-empty:
for lingua in $$(gawk 'match($$0, /locale>(.*)<\/locale/, ary) {print ary[1]}' ./zanata.xml) ; do \
[ -f ./po/$$lingua.po ] || \
msginit -i ./po/$(PKGNAME).pot -o ./po/$$lingua.po --no-translator || \
exit 1 ; \
done
# Try to fetch the real .po files, but if that fails use the empty ones
po-fallback:
$(MAKE) po-pull || $(MAKE) po-empty
docs:
curl -A "programmers-guide" -o docs/programmers-guide "https://fedoraproject.org/w/index.php?title