##// END OF EJS Templates
make: add Ubuntu Zesty docker targets (.deb and ppa)...
av6 -
r33024:9b690032 stable
parent child Browse files
Show More
@@ -1,293 +1,300 b''
1 1 # If you want to change PREFIX, do not just edit it below. The changed
2 2 # value wont get passed on to recursive make calls. You should instead
3 3 # override the variable on the command like:
4 4 #
5 5 # % make PREFIX=/opt/ install
6 6
7 7 export PREFIX=/usr/local
8 8 PYTHON=python
9 9 $(eval HGROOT := $(shell pwd))
10 10 HGPYTHONS ?= $(HGROOT)/build/pythons
11 11 PURE=
12 12 PYFILES:=$(shell find mercurial hgext doc -name '*.py')
13 13 DOCFILES=mercurial/help/*.txt
14 14 export LANGUAGE=C
15 15 export LC_ALL=C
16 16 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
17 17
18 18 # Set this to e.g. "mingw32" to use a non-default compiler.
19 19 COMPILER=
20 20
21 21 COMPILERFLAG_tmp_ =
22 22 COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER)
23 23 COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}}
24 24
25 25 help:
26 26 @echo 'Commonly used make targets:'
27 27 @echo ' all - build program and documentation'
28 28 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))'
29 29 @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))'
30 30 @echo ' local - build for inplace usage'
31 31 @echo ' tests - run all tests in the automatic test suite'
32 32 @echo ' test-foo - run only specified tests (e.g. test-merge1.t)'
33 33 @echo ' dist - run all tests and create a source tarball in dist/'
34 34 @echo ' clean - remove files created by other targets'
35 35 @echo ' (except installed files or dist source tarball)'
36 36 @echo ' update-pot - update i18n/hg.pot'
37 37 @echo
38 38 @echo 'Example for a system-wide installation under /usr/local:'
39 39 @echo ' make all && su -c "make install" && hg version'
40 40 @echo
41 41 @echo 'Example for a local installation (usable in this directory):'
42 42 @echo ' make local && ./hg version'
43 43
44 44 all: build doc
45 45
46 46 local:
47 47 $(PYTHON) setup.py $(PURE) \
48 48 build_py -c -d . \
49 49 build_ext $(COMPILERFLAG) -i \
50 50 build_hgexe $(COMPILERFLAG) -i \
51 51 build_mo
52 52 env HGRCPATH= $(PYTHON) hg version
53 53
54 54 build:
55 55 $(PYTHON) setup.py $(PURE) build $(COMPILERFLAG)
56 56
57 57 wheel:
58 58 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG)
59 59
60 60 doc:
61 61 $(MAKE) -C doc
62 62
63 63 cleanbutpackages:
64 64 -$(PYTHON) setup.py clean --all # ignore errors from this command
65 65 find contrib doc hgext hgext3rd i18n mercurial tests \
66 66 \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
67 67 rm -f $(addprefix mercurial/,$(notdir $(wildcard mercurial/pure/[a-z]*.py)))
68 68 rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
69 69 rm -f mercurial/__modulepolicy__.py
70 70 if test -d .hg; then rm -f mercurial/__version__.py; fi
71 71 rm -rf build mercurial/locale
72 72 $(MAKE) -C doc clean
73 73 $(MAKE) -C contrib/chg distclean
74 74
75 75 clean: cleanbutpackages
76 76 rm -rf packages
77 77
78 78 install: install-bin install-doc
79 79
80 80 install-bin: build
81 81 $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
82 82
83 83 install-doc: doc
84 84 cd doc && $(MAKE) $(MFLAGS) install
85 85
86 86 install-home: install-home-bin install-home-doc
87 87
88 88 install-home-bin: build
89 89 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
90 90
91 91 install-home-doc: doc
92 92 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
93 93
94 94 MANIFEST-doc:
95 95 $(MAKE) -C doc MANIFEST
96 96
97 97 MANIFEST.in: MANIFEST-doc
98 98 hg manifest | sed -e 's/^/include /' > MANIFEST.in
99 99 echo include mercurial/__version__.py >> MANIFEST.in
100 100 sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
101 101
102 102 dist: tests dist-notests
103 103
104 104 dist-notests: doc MANIFEST.in
105 105 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
106 106
107 107 check: tests
108 108
109 109 tests:
110 110 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
111 111
112 112 test-%:
113 113 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
114 114
115 115 testpy-%:
116 116 @echo Looking for Python $* in $(HGPYTHONS)
117 117 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \
118 118 cd $$(mktemp --directory --tmpdir) && \
119 119 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
120 120 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
121 121
122 122 check-code:
123 123 hg manifest | xargs python contrib/check-code.py
124 124
125 125 update-pot: i18n/hg.pot
126 126
127 127 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
128 128 $(PYTHON) i18n/hggettext mercurial/commands.py \
129 129 hgext/*.py hgext/*/__init__.py \
130 130 mercurial/fileset.py mercurial/revset.py \
131 131 mercurial/templatefilters.py mercurial/templatekw.py \
132 132 mercurial/templater.py \
133 133 mercurial/filemerge.py \
134 134 mercurial/hgweb/webcommands.py \
135 135 $(DOCFILES) > i18n/hg.pot.tmp
136 136 # All strings marked for translation in Mercurial contain
137 137 # ASCII characters only. But some files contain string
138 138 # literals like this '\037\213'. xgettext thinks it has to
139 139 # parse them even though they are not marked for translation.
140 140 # Extracting with an explicit encoding of ISO-8859-1 will make
141 141 # xgettext "parse" and ignore them.
142 142 echo $(PYFILES) | xargs \
143 143 xgettext --package-name "Mercurial" \
144 144 --msgid-bugs-address "<mercurial-devel@mercurial-scm.org>" \
145 145 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
146 146 --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
147 147 -d hg -p i18n -o hg.pot.tmp
148 148 $(PYTHON) i18n/posplit i18n/hg.pot.tmp
149 149 # The target file is not created before the last step. So it never is in
150 150 # an intermediate state.
151 151 mv -f i18n/hg.pot.tmp i18n/hg.pot
152 152
153 153 %.po: i18n/hg.pot
154 154 # work on a temporary copy for never having a half completed target
155 155 cp $@ $@.tmp
156 156 msgmerge --no-location --update $@.tmp $^
157 157 mv -f $@.tmp $@
158 158
159 159 # Packaging targets
160 160
161 161 osx:
162 162 rm -rf build/mercurial
163 163 /usr/bin/python2.7 setup.py install --optimize=1 \
164 164 --root=build/mercurial/ --prefix=/usr/local/ \
165 165 --install-lib=/Library/Python/2.7/site-packages/
166 166 make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
167 167 # Place a bogon .DS_Store file in the target dir so we can be
168 168 # sure it doesn't get included in the final package.
169 169 touch build/mercurial/.DS_Store
170 170 # install zsh completions - this location appears to be
171 171 # searched by default as of macOS Sierra.
172 172 install -d build/mercurial/usr/local/share/zsh/site-functions/
173 173 install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg
174 174 # install bash completions - there doesn't appear to be a
175 175 # place that's searched by default for bash, so we'll follow
176 176 # the lead of Apple's git install and just put it in a
177 177 # location of our own.
178 178 install -d build/mercurial/usr/local/hg/contrib/
179 179 install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash
180 180 mkdir -p $${OUTPUTDIR:-dist}
181 181 HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \
182 182 OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
183 183 pkgbuild --filter \\.DS_Store --root build/mercurial/ \
184 184 --identifier org.mercurial-scm.mercurial \
185 185 --version "$${HGVER}" \
186 186 build/mercurial.pkg && \
187 187 productbuild --distribution contrib/macosx/distribution.xml \
188 188 --package-path build/ \
189 189 --version "$${HGVER}" \
190 190 --resources contrib/macosx/ \
191 191 "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
192 192
193 193 deb:
194 194 contrib/builddeb
195 195
196 196 ppa:
197 197 contrib/builddeb --source-only
198 198
199 199 docker-debian-jessie:
200 200 mkdir -p packages/debian-jessie
201 201 contrib/dockerdeb debian jessie
202 202
203 203 contrib/docker/ubuntu-%: contrib/docker/ubuntu.template
204 204 sed "s/__CODENAME__/$*/" $< > $@
205 205
206 206 docker-ubuntu-trusty: contrib/docker/ubuntu-trusty
207 207 contrib/dockerdeb ubuntu trusty
208 208
209 209 docker-ubuntu-trusty-ppa: contrib/docker/ubuntu-trusty
210 210 contrib/dockerdeb ubuntu trusty --source-only
211 211
212 212 docker-ubuntu-xenial: contrib/docker/ubuntu-xenial
213 213 contrib/dockerdeb ubuntu xenial
214 214
215 215 docker-ubuntu-xenial-ppa: contrib/docker/ubuntu-xenial
216 216 contrib/dockerdeb ubuntu xenial --source-only
217 217
218 218 docker-ubuntu-yakkety: contrib/docker/ubuntu-yakkety
219 219 contrib/dockerdeb ubuntu yakkety
220 220
221 221 docker-ubuntu-yakkety-ppa: contrib/docker/ubuntu-yakkety
222 222 contrib/dockerdeb ubuntu yakkety --source-only
223 223
224 docker-ubuntu-zesty: contrib/docker/ubuntu-zesty
225 contrib/dockerdeb ubuntu zesty
226
227 docker-ubuntu-zesty-ppa: contrib/docker/ubuntu-zesty
228 contrib/dockerdeb ubuntu zesty --source-only
229
224 230 fedora20:
225 231 mkdir -p packages/fedora20
226 232 contrib/buildrpm
227 233 cp rpmbuild/RPMS/*/* packages/fedora20
228 234 cp rpmbuild/SRPMS/* packages/fedora20
229 235 rm -rf rpmbuild
230 236
231 237 docker-fedora20:
232 238 mkdir -p packages/fedora20
233 239 contrib/dockerrpm fedora20
234 240
235 241 fedora21:
236 242 mkdir -p packages/fedora21
237 243 contrib/buildrpm
238 244 cp rpmbuild/RPMS/*/* packages/fedora21
239 245 cp rpmbuild/SRPMS/* packages/fedora21
240 246 rm -rf rpmbuild
241 247
242 248 docker-fedora21:
243 249 mkdir -p packages/fedora21
244 250 contrib/dockerrpm fedora21
245 251
246 252 centos5:
247 253 mkdir -p packages/centos5
248 254 contrib/buildrpm --withpython
249 255 cp rpmbuild/RPMS/*/* packages/centos5
250 256 cp rpmbuild/SRPMS/* packages/centos5
251 257
252 258 docker-centos5:
253 259 mkdir -p packages/centos5
254 260 contrib/dockerrpm centos5 --withpython
255 261
256 262 centos6:
257 263 mkdir -p packages/centos6
258 264 contrib/buildrpm
259 265 cp rpmbuild/RPMS/*/* packages/centos6
260 266 cp rpmbuild/SRPMS/* packages/centos6
261 267
262 268 docker-centos6:
263 269 mkdir -p packages/centos6
264 270 contrib/dockerrpm centos6
265 271
266 272 centos7:
267 273 mkdir -p packages/centos7
268 274 contrib/buildrpm
269 275 cp rpmbuild/RPMS/*/* packages/centos7
270 276 cp rpmbuild/SRPMS/* packages/centos7
271 277
272 278 docker-centos7:
273 279 mkdir -p packages/centos7
274 280 contrib/dockerrpm centos7
275 281
276 282 linux-wheels: linux-wheels-x86_64 linux-wheels-i686
277 283
278 284 linux-wheels-x86_64:
279 285 docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_x86_64 /src/contrib/build-linux-wheels.sh
280 286
281 287 linux-wheels-i686:
282 288 docker run -e "HGTEST_JOBS=$(shell nproc)" --rm -ti -v `pwd`:/src quay.io/pypa/manylinux1_i686 linux32 /src/contrib/build-linux-wheels.sh
283 289
284 290 .PHONY: help all local build doc cleanbutpackages clean install install-bin \
285 291 install-doc install-home install-home-bin install-home-doc \
286 292 dist dist-notests check tests check-code update-pot \
287 293 osx deb ppa docker-debian-jessie \
288 294 docker-ubuntu-trusty docker-ubuntu-trusty-ppa \
289 295 docker-ubuntu-xenial docker-ubuntu-xenial-ppa \
290 296 docker-ubuntu-yakkety docker-ubuntu-yakkety-ppa \
297 docker-ubuntu-zesty docker-ubuntu-zesty-ppa \
291 298 fedora20 docker-fedora20 fedora21 docker-fedora21 \
292 299 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7 \
293 300 linux-wheels
General Comments 0
You need to be logged in to leave comments. Login now