##// END OF EJS Templates
packaging: remove references to debian jessie...
Augie Fackler -
r43908:e468ebfc default
parent child Browse files
Show More
@@ -1,257 +1,258 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 PYFILESCMD=find mercurial hgext doc -name '*.py'
13 13 PYFILES:=$(shell $(PYFILESCMD))
14 14 DOCFILES=mercurial/help/*.txt
15 15 export LANGUAGE=C
16 16 export LC_ALL=C
17 17 TESTFLAGS ?= $(shell echo $$HGTESTFLAGS)
18 18 OSXVERSIONFLAGS ?= $(shell echo $$OSXVERSIONFLAGS)
19 19 CARGO = cargo
20 20
21 21 # Set this to e.g. "mingw32" to use a non-default compiler.
22 22 COMPILER=
23 23
24 24 COMPILERFLAG_tmp_ =
25 25 COMPILERFLAG_tmp_${COMPILER} ?= -c $(COMPILER)
26 26 COMPILERFLAG=${COMPILERFLAG_tmp_${COMPILER}}
27 27
28 28 help:
29 29 @echo 'Commonly used make targets:'
30 30 @echo ' all - build program and documentation'
31 31 @echo ' install - install program and man pages to $$PREFIX ($(PREFIX))'
32 32 @echo ' install-home - install with setup.py install --home=$$HOME ($(HOME))'
33 33 @echo ' local - build for inplace usage'
34 34 @echo ' tests - run all tests in the automatic test suite'
35 35 @echo ' test-foo - run only specified tests (e.g. test-merge1.t)'
36 36 @echo ' dist - run all tests and create a source tarball in dist/'
37 37 @echo ' clean - remove files created by other targets'
38 38 @echo ' (except installed files or dist source tarball)'
39 39 @echo ' update-pot - update i18n/hg.pot'
40 40 @echo
41 41 @echo 'Example for a system-wide installation under /usr/local:'
42 42 @echo ' make all && su -c "make install" && hg version'
43 43 @echo
44 44 @echo 'Example for a local installation (usable in this directory):'
45 45 @echo ' make local && ./hg version'
46 46
47 47 all: build doc
48 48
49 49 local:
50 50 $(PYTHON) setup.py $(PURE) \
51 51 build_py -c -d . \
52 52 build_ext $(COMPILERFLAG) -i \
53 53 build_hgexe $(COMPILERFLAG) -i \
54 54 build_mo
55 55 env HGRCPATH= $(PYTHON) hg version
56 56
57 57 build:
58 58 $(PYTHON) setup.py $(PURE) build $(COMPILERFLAG)
59 59
60 60 wheel:
61 61 FORCE_SETUPTOOLS=1 $(PYTHON) setup.py $(PURE) bdist_wheel $(COMPILERFLAG)
62 62
63 63 doc:
64 64 $(MAKE) -C doc
65 65
66 66 cleanbutpackages:
67 67 -$(PYTHON) setup.py clean --all # ignore errors from this command
68 68 find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport \
69 69 \( -name '*.py[cdo]' -o -name '*.so' \) -exec rm -f '{}' ';'
70 70 rm -f MANIFEST MANIFEST.in hgext/__index__.py tests/*.err
71 71 rm -f mercurial/__modulepolicy__.py
72 72 if test -d .hg; then rm -f mercurial/__version__.py; fi
73 73 rm -rf build mercurial/locale
74 74 $(MAKE) -C doc clean
75 75 $(MAKE) -C contrib/chg distclean
76 76 rm -rf rust/target
77 77 rm -f mercurial/rustext.so
78 78
79 79 clean: cleanbutpackages
80 80 rm -rf packages
81 81
82 82 install: install-bin install-doc
83 83
84 84 install-bin: build
85 85 $(PYTHON) setup.py $(PURE) install --root="$(DESTDIR)/" --prefix="$(PREFIX)" --force
86 86
87 87 install-doc: doc
88 88 cd doc && $(MAKE) $(MFLAGS) install
89 89
90 90 install-home: install-home-bin install-home-doc
91 91
92 92 install-home-bin: build
93 93 $(PYTHON) setup.py $(PURE) install --home="$(HOME)" --prefix="" --force
94 94
95 95 install-home-doc: doc
96 96 cd doc && $(MAKE) $(MFLAGS) PREFIX="$(HOME)" install
97 97
98 98 MANIFEST-doc:
99 99 $(MAKE) -C doc MANIFEST
100 100
101 101 MANIFEST.in: MANIFEST-doc
102 102 hg manifest | sed -e 's/^/include /' > MANIFEST.in
103 103 echo include mercurial/__version__.py >> MANIFEST.in
104 104 sed -e 's/^/include /' < doc/MANIFEST >> MANIFEST.in
105 105
106 106 dist: tests dist-notests
107 107
108 108 dist-notests: doc MANIFEST.in
109 109 TAR_OPTIONS="--owner=root --group=root --mode=u+w,go-w,a+rX-s" $(PYTHON) setup.py -q sdist
110 110
111 111 check: tests
112 112
113 113 tests:
114 114 # Run Rust tests if cargo is installed
115 115 if command -v $(CARGO) >/dev/null 2>&1; then \
116 116 $(MAKE) rust-tests; \
117 117 fi
118 118 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
119 119
120 120 test-%:
121 121 cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
122 122
123 123 testpy-%:
124 124 @echo Looking for Python $* in $(HGPYTHONS)
125 125 [ -e $(HGPYTHONS)/$*/bin/python ] || ( \
126 126 cd $$(mktemp --directory --tmpdir) && \
127 127 $(MAKE) -f $(HGROOT)/contrib/Makefile.python PYTHONVER=$* PREFIX=$(HGPYTHONS)/$* python )
128 128 cd tests && $(HGPYTHONS)/$*/bin/python run-tests.py $(TESTFLAGS)
129 129
130 130 rust-tests: py_feature = $(shell $(PYTHON) -c \
131 131 'import sys; print(["python27-bin", "python3-bin"][sys.version_info[0] >= 3])')
132 132 rust-tests:
133 133 cd $(HGROOT)/rust/hg-cpython \
134 134 && $(CARGO) test --quiet --all \
135 135 --no-default-features --features "$(py_feature)"
136 136
137 137 check-code:
138 138 hg manifest | xargs python contrib/check-code.py
139 139
140 140 format-c:
141 141 clang-format --style file -i \
142 142 `hg files 'set:(**.c or **.cc or **.h) and not "listfile:contrib/clang-format-ignorelist"'`
143 143
144 144 update-pot: i18n/hg.pot
145 145
146 146 i18n/hg.pot: $(PYFILES) $(DOCFILES) i18n/posplit i18n/hggettext
147 147 $(PYTHON) i18n/hggettext mercurial/commands.py \
148 148 hgext/*.py hgext/*/__init__.py \
149 149 mercurial/fileset.py mercurial/revset.py \
150 150 mercurial/templatefilters.py \
151 151 mercurial/templatefuncs.py \
152 152 mercurial/templatekw.py \
153 153 mercurial/filemerge.py \
154 154 mercurial/hgweb/webcommands.py \
155 155 mercurial/util.py \
156 156 $(DOCFILES) > i18n/hg.pot.tmp
157 157 # All strings marked for translation in Mercurial contain
158 158 # ASCII characters only. But some files contain string
159 159 # literals like this '\037\213'. xgettext thinks it has to
160 160 # parse them even though they are not marked for translation.
161 161 # Extracting with an explicit encoding of ISO-8859-1 will make
162 162 # xgettext "parse" and ignore them.
163 163 $(PYFILESCMD) | xargs \
164 164 xgettext --package-name "Mercurial" \
165 165 --msgid-bugs-address "<mercurial-devel@mercurial-scm.org>" \
166 166 --copyright-holder "Matt Mackall <mpm@selenic.com> and others" \
167 167 --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
168 168 -d hg -p i18n -o hg.pot.tmp
169 169 $(PYTHON) i18n/posplit i18n/hg.pot.tmp
170 170 # The target file is not created before the last step. So it never is in
171 171 # an intermediate state.
172 172 mv -f i18n/hg.pot.tmp i18n/hg.pot
173 173
174 174 %.po: i18n/hg.pot
175 175 # work on a temporary copy for never having a half completed target
176 176 cp $@ $@.tmp
177 177 msgmerge --no-location --update $@.tmp $^
178 178 mv -f $@.tmp $@
179 179
180 180 # Packaging targets
181 181
182 182 packaging_targets := \
183 183 centos5 \
184 184 centos6 \
185 185 centos7 \
186 186 centos8 \
187 187 deb \
188 188 docker-centos5 \
189 189 docker-centos6 \
190 190 docker-centos7 \
191 191 docker-centos8 \
192 docker-debian-jessie \
192 docker-debian-bullseye \
193 docker-debian-buster \
193 194 docker-debian-stretch \
194 195 docker-fedora \
195 196 docker-ubuntu-trusty \
196 197 docker-ubuntu-trusty-ppa \
197 198 docker-ubuntu-xenial \
198 199 docker-ubuntu-xenial-ppa \
199 200 docker-ubuntu-artful \
200 201 docker-ubuntu-artful-ppa \
201 202 docker-ubuntu-bionic \
202 203 docker-ubuntu-bionic-ppa \
203 204 fedora \
204 205 linux-wheels \
205 206 linux-wheels-x86_64 \
206 207 linux-wheels-i686 \
207 208 ppa
208 209
209 210 # Forward packaging targets for convenience.
210 211 $(packaging_targets):
211 212 $(MAKE) -C contrib/packaging $@
212 213
213 214 osx:
214 215 rm -rf build/mercurial
215 216 /usr/bin/python2.7 setup.py install --optimize=1 \
216 217 --root=build/mercurial/ --prefix=/usr/local/ \
217 218 --install-lib=/Library/Python/2.7/site-packages/
218 219 make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
219 220 # Place a bogon .DS_Store file in the target dir so we can be
220 221 # sure it doesn't get included in the final package.
221 222 touch build/mercurial/.DS_Store
222 223 # install zsh completions - this location appears to be
223 224 # searched by default as of macOS Sierra.
224 225 install -d build/mercurial/usr/local/share/zsh/site-functions/
225 226 install -m 0644 contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/_hg
226 227 # install bash completions - there doesn't appear to be a
227 228 # place that's searched by default for bash, so we'll follow
228 229 # the lead of Apple's git install and just put it in a
229 230 # location of our own.
230 231 install -d build/mercurial/usr/local/hg/contrib/
231 232 install -m 0644 contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash
232 233 make -C contrib/chg \
233 234 HGPATH=/usr/local/bin/hg \
234 235 PYTHON=/usr/bin/python2.7 \
235 236 HGEXTDIR=/Library/Python/2.7/site-packages/hgext \
236 237 DESTDIR=../../build/mercurial \
237 238 PREFIX=/usr/local \
238 239 clean install
239 240 mkdir -p $${OUTPUTDIR:-dist}
240 241 HGVER=$$(python contrib/genosxversion.py $(OSXVERSIONFLAGS) build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py) && \
241 242 OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
242 243 pkgbuild --filter \\.DS_Store --root build/mercurial/ \
243 244 --identifier org.mercurial-scm.mercurial \
244 245 --version "$${HGVER}" \
245 246 build/mercurial.pkg && \
246 247 productbuild --distribution contrib/packaging/macosx/distribution.xml \
247 248 --package-path build/ \
248 249 --version "$${HGVER}" \
249 250 --resources contrib/packaging/macosx/ \
250 251 "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
251 252
252 253 .PHONY: help all local build doc cleanbutpackages clean install install-bin \
253 254 install-doc install-home install-home-bin install-home-doc \
254 255 dist dist-notests check tests rust-tests check-code format-c \
255 256 update-pot \
256 257 $(packaging_targets) \
257 258 osx
@@ -1,31 +1,31 b''
1 1 #require test-repo slow docker
2 2
3 3 $ . "$TESTDIR/helpers-testrepo.sh"
4 4 $ testrepohgenv
5 5
6 6 Ensure debuild doesn't run the testsuite, as that could get silly.
7 7 $ DEB_BUILD_OPTIONS=nocheck
8 8 $ export DEB_BUILD_OPTIONS
9 9 $ OUTPUTDIR=`pwd`
10 10 $ export OUTPUTDIR
11 11
12 12 $ cd "$TESTDIR"/..
13 $ make docker-debian-jessie > $OUTPUTDIR/build.log 2>&1
13 $ make docker-debian-buster > $OUTPUTDIR/build.log 2>&1
14 14 $ cd $OUTPUTDIR
15 15 $ ls *.deb
16 16 mercurial-common_*.deb (glob)
17 17 mercurial_*.deb (glob)
18 18
19 19 We check debian package contents with portable tools so that when
20 20 we're on non-debian machines we can still test the packages that are
21 21 built using docker.
22 22
23 23 main deb should have .so but no .py
24 24 $ ar x mercurial_*.deb
25 25 $ tar tf data.tar* | egrep '(localrepo|parsers)'
26 26 ./usr/lib/python2.7/dist-packages/mercurial/parsers*.so (glob)
27 27 mercurial-common should have .py but no .so or .pyc
28 28 $ ar x mercurial-common_*.deb
29 29 $ tar tf data.tar* | egrep '(localrepo|parsers)'
30 30 ./usr/lib/python2.7/dist-packages/mercurial/pure/parsers.py
31 31 ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py
General Comments 0
You need to be logged in to leave comments. Login now