##// END OF EJS Templates
make: turn ubuntu docker into template...
Sean Farley -
r29031:e63dfbbd stable
parent child Browse files
Show More
@@ -0,0 +1,11 b''
1 FROM ubuntu:__CODENAME__
2 RUN apt-get update && apt-get install -y \
3 build-essential \
4 debhelper \
5 dh-python \
6 devscripts \
7 python \
8 python-all-dev \
9 python-docutils \
10 zip \
11 unzip
@@ -1,69 +1,70 b''
1 1 syntax: glob
2 2
3 3 *.elc
4 4 *.tmp
5 5 *.orig
6 6 *.rej
7 7 *~
8 8 *.mergebackup
9 9 *.o
10 10 *.so
11 11 *.dll
12 12 *.exe
13 13 *.pyd
14 14 *.pyc
15 15 *.pyo
16 16 *$py.class
17 17 *.swp
18 18 *.prof
19 19 *.zip
20 20 \#*\#
21 21 .\#*
22 22 tests/.coverage*
23 23 tests/.testtimes*
24 24 tests/.hypothesis
25 25 tests/hypothesis-generated
26 26 tests/annotated
27 27 tests/*.err
28 28 tests/htmlcov
29 29 build
30 30 contrib/chg/chg
31 31 contrib/hgsh/hgsh
32 32 contrib/vagrant/.vagrant
33 contrib/docker/ubuntu-*
33 34 dist
34 35 packages
35 36 doc/common.txt
36 37 doc/*.[0-9]
37 38 doc/*.[0-9].txt
38 39 doc/*.[0-9].gendoc.txt
39 40 doc/*.[0-9].{x,ht}ml
40 41 MANIFEST
41 42 MANIFEST.in
42 43 patches
43 44 mercurial/__modulepolicy__.py
44 45 mercurial/__version__.py
45 46 mercurial/hgpythonlib.h
46 47 mercurial.egg-info
47 48 .DS_Store
48 49 tags
49 50 cscope.*
50 51 .idea/*
51 52 i18n/hg.pot
52 53 locale/*/LC_MESSAGES/hg.mo
53 54 hgext/__index__.py
54 55
55 56 # files installed with a local --pure build
56 57 mercurial/base85.py
57 58 mercurial/bdiff.py
58 59 mercurial/diffhelpers.py
59 60 mercurial/mpatch.py
60 61 mercurial/osutil.py
61 62 mercurial/parsers.py
62 63
63 64 syntax: regexp
64 65 ^\.pc/
65 66 ^\.(pydev)?project
66 67
67 68 # hackable windows distribution additions
68 69 ^hg-python
69 70 ^hg.py$
@@ -1,244 +1,246 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 clean:
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 packages mercurial/locale
72 72 $(MAKE) -C doc clean
73 73 $(MAKE) -C contrib/chg distclean
74 74
75 75 install: install-bin install-doc
76 76
77 77 install-bin: build
78 78 $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
79 79
80 80 install-doc: doc
81 81 cd doc && $(MAKE) $(MFLAGS) install
82 82
83 83 install-home: install-home-bin install-home-doc
84 84
85 85 install-home-bin: build
86 86 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
87 87
88 88 install-home-doc: doc
89 89 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
90 90
91 91 MANIFEST-doc:
92 92 $(MAKE) -C doc MANIFEST
93 93
94 94 MANIFEST.in: MANIFEST-doc
95 95 hg manifest | sed -e 's/^/include /' > MANIFEST.in
96 96 echo include mercurial/__version__.py >> MANIFEST.in
97 97 sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
98 98
99 99 dist: tests dist-notests
100 100
101 101 dist-notests: doc MANIFEST.in
102 102 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
103 103
104 104 check: tests
105 105
106 106 tests:
107 107 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
108 108
109 109 test-%:
110 110 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
111 111
112 112 testpy-%:
113 113 @echo Looking for Python $* in $(HGPYTHONS)
114 114 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \
115 115 cd $$(mktemp --directory --tmpdir) && \
116 116 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
117 117 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
118 118
119 119 check-code:
120 120 hg manifest | xargs python contrib/check-code.py
121 121
122 122 update-pot: i18n/hg.pot
123 123
124 124 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
125 125 $(PYTHON) i18n/hggettext mercurial/commands.py \
126 126 hgext/*.py hgext/*/__init__.py \
127 127 mercurial/fileset.py mercurial/revset.py \
128 128 mercurial/templatefilters.py mercurial/templatekw.py \
129 129 mercurial/templater.py \
130 130 mercurial/filemerge.py \
131 131 mercurial/hgweb/webcommands.py \
132 132 $(DOCFILES) > i18n/hg.pot.tmp
133 133 # All strings marked for translation in Mercurial contain
134 134 # ASCII characters only. But some files contain string
135 135 # literals like this '\037\213'. xgettext thinks it has to
136 136 # parse them even though they are not marked for translation.
137 137 # Extracting with an explicit encoding of ISO-8859-1 will make
138 138 # xgettext "parse" and ignore them.
139 139 echo $(PYFILES) | xargs \
140 140 xgettext --package-name "Mercurial" \
141 141 --msgid-bugs-address "<mercurial-devel@selenic.com>" \
142 142 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
143 143 --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
144 144 -d hg -p i18n -o hg.pot.tmp
145 145 $(PYTHON) i18n/posplit i18n/hg.pot.tmp
146 146 # The target file is not created before the last step. So it never is in
147 147 # an intermediate state.
148 148 mv -f i18n/hg.pot.tmp i18n/hg.pot
149 149
150 150 %.po: i18n/hg.pot
151 151 # work on a temporary copy for never having a half completed target
152 152 cp $@ $@.tmp
153 153 msgmerge --no-location --update $@.tmp $^
154 154 mv -f $@.tmp $@
155 155
156 156 # Packaging targets
157 157
158 158 osx:
159 159 python setup.py install --optimize=1 \
160 160 --root=build/mercurial/ --prefix=/usr/local/ \
161 161 --install-lib=/Library/Python/2.7/site-packages/
162 162 make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
163 163 mkdir -p $${OUTPUTDIR:-dist}
164 164 pkgbuild --root build/mercurial/ --identifier org.mercurial-scm.mercurial \
165 165 build/mercurial.pkg
166 166 HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \
167 167 OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
168 168 productbuild --distribution contrib/macosx/distribution.xml \
169 169 --package-path build/ \
170 170 --version "$${HGVER}" \
171 171 --resources contrib/macosx/ \
172 172 "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
173 173
174 174 deb:
175 175 contrib/builddeb
176 176
177 177 ppa:
178 178 contrib/builddeb --source-only
179 179
180 180 docker-debian-jessie:
181 181 mkdir -p packages/debian-jessie
182 182 contrib/dockerdeb debian jessie
183 183
184 docker-ubuntu-trusty:
185 mkdir -p packages/ubuntu-trusty
184 contrib/docker/ubuntu-%: contrib/docker/ubuntu.template
185 sed "s/__CODENAME__/$*/" $< > $@
186
187 docker-ubuntu-trusty: contrib/docker/ubuntu-trusty
186 188 contrib/dockerdeb ubuntu trusty
187 189
188 190 fedora20:
189 191 mkdir -p packages/fedora20
190 192 contrib/buildrpm
191 193 cp rpmbuild/RPMS/*/* packages/fedora20
192 194 cp rpmbuild/SRPMS/* packages/fedora20
193 195 rm -rf rpmbuild
194 196
195 197 docker-fedora20:
196 198 mkdir -p packages/fedora20
197 199 contrib/dockerrpm fedora20
198 200
199 201 fedora21:
200 202 mkdir -p packages/fedora21
201 203 contrib/buildrpm
202 204 cp rpmbuild/RPMS/*/* packages/fedora21
203 205 cp rpmbuild/SRPMS/* packages/fedora21
204 206 rm -rf rpmbuild
205 207
206 208 docker-fedora21:
207 209 mkdir -p packages/fedora21
208 210 contrib/dockerrpm fedora21
209 211
210 212 centos5:
211 213 mkdir -p packages/centos5
212 214 contrib/buildrpm --withpython
213 215 cp rpmbuild/RPMS/*/* packages/centos5
214 216 cp rpmbuild/SRPMS/* packages/centos5
215 217
216 218 docker-centos5:
217 219 mkdir -p packages/centos5
218 220 contrib/dockerrpm centos5 --withpython
219 221
220 222 centos6:
221 223 mkdir -p packages/centos6
222 224 contrib/buildrpm
223 225 cp rpmbuild/RPMS/*/* packages/centos6
224 226 cp rpmbuild/SRPMS/* packages/centos6
225 227
226 228 docker-centos6:
227 229 mkdir -p packages/centos6
228 230 contrib/dockerrpm centos6
229 231
230 232 centos7:
231 233 mkdir -p packages/centos7
232 234 contrib/buildrpm
233 235 cp rpmbuild/RPMS/*/* packages/centos7
234 236 cp rpmbuild/SRPMS/* packages/centos7
235 237
236 238 docker-centos7:
237 239 mkdir -p packages/centos7
238 240 contrib/dockerrpm centos7
239 241
240 242 .PHONY: help all local build doc clean install install-bin install-doc \
241 243 install-home install-home-bin install-home-doc \
242 244 dist dist-notests check tests check-code update-pot \
243 245 osx fedora20 docker-fedora20 fedora21 docker-fedora21 \
244 246 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now