##// END OF EJS Templates
ubuntu-trusty-ppa: add makefile rule
Sean Farley -
r29034:e5e2f1cc stable
parent child Browse files
Show More
@@ -1,252 +1,255 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 184 contrib/docker/ubuntu-%: contrib/docker/ubuntu.template
185 185 sed "s/__CODENAME__/$*/" $< > $@
186 186
187 187 docker-ubuntu-trusty: contrib/docker/ubuntu-trusty
188 188 contrib/dockerdeb ubuntu trusty
189 189
190 docker-ubuntu-trusty-ppa: contrib/docker/ubuntu-trusty
191 contrib/dockerdeb ubuntu trusty --source-only
192
190 193 docker-ubuntu-wily: contrib/docker/ubuntu-wily
191 194 contrib/dockerdeb ubuntu wily
192 195
193 196 docker-ubuntu-xenial: contrib/docker/ubuntu-xenial
194 197 contrib/dockerdeb ubuntu xenial
195 198
196 199 fedora20:
197 200 mkdir -p packages/fedora20
198 201 contrib/buildrpm
199 202 cp rpmbuild/RPMS/*/* packages/fedora20
200 203 cp rpmbuild/SRPMS/* packages/fedora20
201 204 rm -rf rpmbuild
202 205
203 206 docker-fedora20:
204 207 mkdir -p packages/fedora20
205 208 contrib/dockerrpm fedora20
206 209
207 210 fedora21:
208 211 mkdir -p packages/fedora21
209 212 contrib/buildrpm
210 213 cp rpmbuild/RPMS/*/* packages/fedora21
211 214 cp rpmbuild/SRPMS/* packages/fedora21
212 215 rm -rf rpmbuild
213 216
214 217 docker-fedora21:
215 218 mkdir -p packages/fedora21
216 219 contrib/dockerrpm fedora21
217 220
218 221 centos5:
219 222 mkdir -p packages/centos5
220 223 contrib/buildrpm --withpython
221 224 cp rpmbuild/RPMS/*/* packages/centos5
222 225 cp rpmbuild/SRPMS/* packages/centos5
223 226
224 227 docker-centos5:
225 228 mkdir -p packages/centos5
226 229 contrib/dockerrpm centos5 --withpython
227 230
228 231 centos6:
229 232 mkdir -p packages/centos6
230 233 contrib/buildrpm
231 234 cp rpmbuild/RPMS/*/* packages/centos6
232 235 cp rpmbuild/SRPMS/* packages/centos6
233 236
234 237 docker-centos6:
235 238 mkdir -p packages/centos6
236 239 contrib/dockerrpm centos6
237 240
238 241 centos7:
239 242 mkdir -p packages/centos7
240 243 contrib/buildrpm
241 244 cp rpmbuild/RPMS/*/* packages/centos7
242 245 cp rpmbuild/SRPMS/* packages/centos7
243 246
244 247 docker-centos7:
245 248 mkdir -p packages/centos7
246 249 contrib/dockerrpm centos7
247 250
248 251 .PHONY: help all local build doc clean install install-bin install-doc \
249 252 install-home install-home-bin install-home-doc \
250 253 dist dist-notests check tests check-code update-pot \
251 254 osx fedora20 docker-fedora20 fedora21 docker-fedora21 \
252 255 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
General Comments 0
You need to be logged in to leave comments. Login now