##// END OF EJS Templates
osx: create a modern package including manpages...
Kevin Bullock -
r29027:db5084d2 stable
parent child Browse files
Show More
@@ -0,0 +1,19 b''
1 <?xml version="1.0" encoding="utf-8" standalone="no"?>
2 <installer-gui-script minSpecVersion="1">
3 <title>Mercurial SCM</title>
4 <organization>org.mercurial-scm</organization>
5 <options customize="never" require-scripts="false" rootVolumeOnly="true" />
6 <welcome file="Welcome.html" mime-type="text/html" />
7 <license file="../../COPYING" mime-type="text/plain" />
8 <readme file="Readme.html" mime-type="text/html" />
9 <pkg-ref id="org.mercurial-scm.mercurial"
10 version="0"
11 auth="root"
12 onConclusion="none">mercurial.pkg</pkg-ref>
13 <choices-outline>
14 <line choice="org.mercurial-scm.mercurial"/>
15 </choices-outline>
16 <choice id="org.mercurial-scm.mercurial" visible="false">
17 <pkg-ref id="org.mercurial-scm.mercurial"/>
18 </choice>
19 </installer-gui-script>
@@ -1,242 +1,244 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 python -c 'import bdist_mpkg.script_bdist_mpkg' || \
160 (echo "Missing bdist_mpkg (easy_install bdist_mpkg)"; false)
161 rm -rf dist/mercurial-*.mpkg
162 python -m bdist_mpkg.script_bdist_mpkg setup.py --
163 python contrib/fixpax.py dist/mercurial-*.mpkg/Contents/Packages/*.pkg/Contents/Archive.pax.gz
164 OUTPUTDIR=$${OUTPUTDIR:=packages/osx} && \
165 mkdir -p $$OUTPUTDIR && \
166 N=`cd dist && echo mercurial-*.mpkg | sed 's,\.mpkg$$,,'` && \
167 hdiutil create -srcfolder dist/$$N.mpkg/ -scrub -volname "$$N" \
168 -ov $$OUTPUTDIR/$$N.dmg && \
169 [ -n "$$KEEPMPKG" ] && mv dist/mercurial-*.mpkg $$OUTPUTDIR || \
170 rm -rf dist/mercurial-*.mpkg
159 python setup.py install --optimize=1 \
160 --root=build/mercurial/ --prefix=/usr/local/ \
161 --install-lib=/Library/Python/2.7/site-packages/
162 make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
163 mkdir -p $${OUTPUTDIR:-dist}
164 pkgbuild --root build/mercurial/ --identifier org.mercurial-scm.mercurial \
165 build/mercurial.pkg
166 HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \
167 OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \
168 productbuild --distribution contrib/macosx/distribution.xml \
169 --package-path build/ \
170 --version "$${HGVER}" \
171 --resources contrib/macosx/ \
172 "$${OUTPUTDIR:-dist/}"/Mercurial-"$${HGVER}"-macosx"$${OSXVER}".pkg
171 173
172 174 deb:
173 175 contrib/builddeb
174 176
175 177 ppa:
176 178 contrib/builddeb --source-only
177 179
178 180 docker-debian-jessie:
179 181 mkdir -p packages/debian-jessie
180 182 contrib/dockerdeb debian jessie
181 183
182 184 docker-ubuntu-trusty:
183 185 mkdir -p packages/ubuntu-trusty
184 186 contrib/dockerdeb ubuntu trusty
185 187
186 188 fedora20:
187 189 mkdir -p packages/fedora20
188 190 contrib/buildrpm
189 191 cp rpmbuild/RPMS/*/* packages/fedora20
190 192 cp rpmbuild/SRPMS/* packages/fedora20
191 193 rm -rf rpmbuild
192 194
193 195 docker-fedora20:
194 196 mkdir -p packages/fedora20
195 197 contrib/dockerrpm fedora20
196 198
197 199 fedora21:
198 200 mkdir -p packages/fedora21
199 201 contrib/buildrpm
200 202 cp rpmbuild/RPMS/*/* packages/fedora21
201 203 cp rpmbuild/SRPMS/* packages/fedora21
202 204 rm -rf rpmbuild
203 205
204 206 docker-fedora21:
205 207 mkdir -p packages/fedora21
206 208 contrib/dockerrpm fedora21
207 209
208 210 centos5:
209 211 mkdir -p packages/centos5
210 212 contrib/buildrpm --withpython
211 213 cp rpmbuild/RPMS/*/* packages/centos5
212 214 cp rpmbuild/SRPMS/* packages/centos5
213 215
214 216 docker-centos5:
215 217 mkdir -p packages/centos5
216 218 contrib/dockerrpm centos5 --withpython
217 219
218 220 centos6:
219 221 mkdir -p packages/centos6
220 222 contrib/buildrpm
221 223 cp rpmbuild/RPMS/*/* packages/centos6
222 224 cp rpmbuild/SRPMS/* packages/centos6
223 225
224 226 docker-centos6:
225 227 mkdir -p packages/centos6
226 228 contrib/dockerrpm centos6
227 229
228 230 centos7:
229 231 mkdir -p packages/centos7
230 232 contrib/buildrpm
231 233 cp rpmbuild/RPMS/*/* packages/centos7
232 234 cp rpmbuild/SRPMS/* packages/centos7
233 235
234 236 docker-centos7:
235 237 mkdir -p packages/centos7
236 238 contrib/dockerrpm centos7
237 239
238 240 .PHONY: help all local build doc clean install install-bin install-doc \
239 241 install-home install-home-bin install-home-doc \
240 242 dist dist-notests check tests check-code update-pot \
241 243 osx fedora20 docker-fedora20 fedora21 docker-fedora21 \
242 244 centos5 docker-centos5 centos6 docker-centos6 centos7 docker-centos7
@@ -1,42 +1,44 b''
1 #require test-repo slow osx bdistmpkg
1 #require test-repo slow osx osxpackaging
2 2 $ OUTPUTDIR=`pwd`
3 3 $ export OUTPUTDIR
4 4 $ KEEPMPKG=yes
5 5 $ export KEEPMPKG
6 6
7 7 $ cd "$TESTDIR"/..
8 $ rm -rf dist
8 9 $ make osx > $OUTPUTDIR/build.log 2>&1
9 10 $ cd $OUTPUTDIR
10 $ ls -d *.dmg *.mpkg
11 mercurial-*-macosx10.*.dmg (glob)
12 mercurial-*-macosx10.*.mpkg (glob)
11 $ ls -d *.pkg
12 Mercurial-*-macosx10.*.pkg (glob)
13
14 $ xar -xf Mercurial*.pkg
13 15
14 16 Gather list of all installed files:
15 $ find *.mpkg -name Archive.bom | xargs lsbom > boms.txt
16
17 TODO: update to -f 1,2,3 when we're confident the installed owner of
18 our files is corect. Right now it looks like it's the id of the user
19 that builds the mpkg, which is probably slightly wrong.
17 $ lsbom mercurial.pkg/Bom > boms.txt
20 18
21 19 Spot-check some randomly selected files:
22 $ grep bdiff boms.txt | cut -d ' ' -f 1,2
23 ./mercurial/bdiff.so 100775
24 ./mercurial/pure/bdiff.py 100664
25 ./mercurial/pure/bdiff.pyc 100664
26 ./mercurial/pure/bdiff.pyo 100664
27 TODO: man pages don't get installed
28 $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2
29 $ grep bser boms.txt | cut -d ' ' -f 1,2
30 ./hgext/fsmonitor/pywatchman/bser.so 100775
31 ./hgext/fsmonitor/pywatchman/pybser.py 100664
32 ./hgext/fsmonitor/pywatchman/pybser.pyc 100664
33 ./hgext/fsmonitor/pywatchman/pybser.pyo 100664
34 $ grep localrepo boms.txt | cut -d ' ' -f 1,2
35 ./mercurial/localrepo.py 100664
36 ./mercurial/localrepo.pyc 100664
37 ./mercurial/localrepo.pyo 100664
38 $ grep '/hg ' boms.txt | cut -d ' ' -f 1,2
39 ./hg 100775
20 $ grep bdiff boms.txt | cut -d ' ' -f 1,2,3
21 ./Library/Python/2.7/site-packages/mercurial/bdiff.so 100755 0/0
22 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.py 100644 0/0
23 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyc 100644 0/0
24 ./Library/Python/2.7/site-packages/mercurial/pure/bdiff.pyo 100644 0/0
25 $ egrep 'man[15]' boms.txt | cut -d ' ' -f 1,2,3
26 ./usr/local/share/man/man1 40755 0/0
27 ./usr/local/share/man/man1/hg.1 100644 0/0
28 ./usr/local/share/man/man5 40755 0/0
29 ./usr/local/share/man/man5/hgignore.5 100644 0/0
30 ./usr/local/share/man/man5/hgrc.5 100644 0/0
31 $ grep bser boms.txt | cut -d ' ' -f 1,2,3
32 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/bser.so 100755 0/0
33 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.py 100644 0/0
34 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyc 100644 0/0
35 ./Library/Python/2.7/site-packages/hgext/fsmonitor/pywatchman/pybser.pyo 100644 0/0
36 $ grep localrepo boms.txt | cut -d ' ' -f 1,2,3
37 ./Library/Python/2.7/site-packages/mercurial/localrepo.py 100644 0/0
38 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyc 100644 0/0
39 ./Library/Python/2.7/site-packages/mercurial/localrepo.pyo 100644 0/0
40 $ grep '/hg ' boms.txt | cut -d ' ' -f 1,2,3
41 ./usr/local/bin/hg 100755 0/0
40 42
41 43 Note that we're not currently installing any /etc/mercurial stuff,
42 44 including merge-tool configurations.
General Comments 0
You need to be logged in to leave comments. Login now