comparison Makefile @ 29027:db5084d27df5 stable

osx: create a modern package including manpages Instead of using bdist_mpkg, we use the modern Apple-provided tools to build an OS X Installer package directly. This has several advantages: * Avoids bdist_mpkg which seems to be barely maintained and is hard to use. * Creates a single unified .pkg instead of a .mpkg. * The package we produce is in the modern, single-file format instead of a directory bundle that we have to zip up for download. In addition, this way of building the package now correctly: * Installs the manpages, bringing the `make osx`-generated package in line with the official Mac packages we publish on the website. * Installs files with the correct permissions instead of encoding the UID of the user who happened to build the package. Thanks to Augie for updating the test expectations.
author Kevin Bullock <kbullock+mercurial@ringworld.org>
date Wed, 27 Apr 2016 10:20:36 -0500
parents fe364d8797c3
children e63dfbbdbd07
comparison
equal deleted inserted replaced
29026:80f15aa32edd 29027:db5084d27df5
154 mv -f $@.tmp $@ 154 mv -f $@.tmp $@
155 155
156 # Packaging targets 156 # Packaging targets
157 157
158 osx: 158 osx:
159 python -c 'import bdist_mpkg.script_bdist_mpkg' || \ 159 python setup.py install --optimize=1 \
160 (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false) 160 --root=build/mercurial/ --prefix=/usr/local/ \
161 rm -rf dist/mercurial-*.mpkg 161 --install-lib=/Library/Python/2.7/site-packages/
162 python -m bdist_mpkg.script_bdist_mpkg setup.py -- 162 make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
163 python contrib/fixpax.py dist/mercurial-*.mpkg/Contents/Packages/*.pkg/Contents/Archive.pax.gz 163 mkdir -p $${OUTPUTDIR:-dist}
164 OUTPUTDIR=$${OUTPUTDIR:=packages/osx} && \ 164 pkgbuild --root build/mercurial/ --identifier org.mercurial-scm.mercurial \
165 mkdir -p $$OUTPUTDIR && \ 165 build/mercurial.pkg
166 N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && \ 166 HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \
167 hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" \ 167 OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
168 -ov $$OUTPUTDIR/$$N.dmg && \ 168 productbuild --distribution contrib/macosx/distribution.xml \
169 [ -n "$$KEEPMPKG" ] && mv dist/mercurial-*.mpkg $$OUTPUTDIR || \ 169 --package-path build/ \
170 rm -rf dist/mercurial-*.mpkg 170 --version "$${HGVER}" \
171 --resources contrib/macosx/ \
172 "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
171 173
172 deb: 174 deb:
173 contrib/builddeb 175 contrib/builddeb
174 176
175 ppa: 177 ppa: