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