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