##// END OF EJS Templates
Document how HTML documentation is built under Windows
Patrick Mezard -
r7660:ceed5f8c default
parent child Browse files
Show More
@@ -1,71 +1,85
1 The standalone Windows installer for Mercurial is built in a somewhat
1 The standalone Windows installer for Mercurial is built in a somewhat
2 jury-rigged fashion.
2 jury-rigged fashion.
3
3
4 It has the following prerequisites, at least as I build it:
4 It has the following prerequisites, at least as I build it:
5
5
6 Python for Windows
6 Python for Windows
7 http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
7 http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi
8
8
9 MinGW
9 MinGW
10 http://www.mingw.org/
10 http://www.mingw.org/
11
11
12 Python for Windows Extensions
12 Python for Windows Extensions
13 http://sourceforge.net/projects/pywin32/
13 http://sourceforge.net/projects/pywin32/
14
14
15 mfc71.dll (just download, don't install)
15 mfc71.dll (just download, don't install)
16 http://starship.python.net/crew/mhammond/win32/
16 http://starship.python.net/crew/mhammond/win32/
17
17
18 The py2exe distutils extension
18 The py2exe distutils extension
19 http://sourceforge.net/projects/py2exe/
19 http://sourceforge.net/projects/py2exe/
20
20
21 Inno Setup
21 Inno Setup
22 http://www.jrsoftware.org/isinfo.php
22 http://www.jrsoftware.org/isinfo.php
23
23
24 ISTool - optional
24 ISTool - optional
25 http://www.istool.org/default.aspx/
25 http://www.istool.org/default.aspx/
26
26
27 add_path (you need only add_path.exe in the zip file)
27 add_path (you need only add_path.exe in the zip file)
28 http://www.barisione.org/apps.html#add_path
28 http://www.barisione.org/apps.html#add_path
29
29
30 Asciidoc - optional
31 http://www.methods.co.nz/asciidoc/
32
30 And, of course, Mercurial itself.
33 And, of course, Mercurial itself.
31
34
32 Once you have all this installed and built, clone a copy of the
35 Once you have all this installed and built, clone a copy of the
33 Mercurial repository you want to package, and name the repo
36 Mercurial repository you want to package, and name the repo
34 C:\hg\hg-release.
37 C:\hg\hg-release.
35
38
36 In a shell, build a standalone copy of the hg.exe program:
39 In a shell, build a standalone copy of the hg.exe program:
37
40
38 python setup.py build -c mingw32
41 python setup.py build -c mingw32
39 python setup.py py2exe -b 1
42 python setup.py py2exe -b 1
40
43
41 Note: the previously suggested combined command of "python setup.py build -c
44 Note: the previously suggested combined command of "python setup.py build -c
42 mingw32 py2exe -b 1" doesn't work correctly anymore as it doesn't include the
45 mingw32 py2exe -b 1" doesn't work correctly anymore as it doesn't include the
43 extensions in the mercurial subdirectory.
46 extensions in the mercurial subdirectory.
44
47
45 If you want to create a file named setup.cfg with the contents:
48 If you want to create a file named setup.cfg with the contents:
46
49
47 [build]
50 [build]
48 compiler=mingw32
51 compiler=mingw32
49
52
50 you can skip the first build step.
53 you can skip the first build step.
51
54
52 Copy mfc71.dll and add_path.exe into the dist directory that just got created.
55 Copy mfc71.dll and add_path.exe into the dist directory that just got created.
53
56
57 Before building the installer, you have to build Mercurial HTML documentation
58 (or fix mercurial.iss to not reference the doc directory). Assuming you have an
59 "asciidoc.bat" batch file somewhere in your PATH:
60
61 cd doc
62 mingw32-make ASCIIDOC=asciidoc.bat html
63 cd ..
64
54 If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss
65 If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss
55 file and type Ctrl-F9 to compile the installer file.
66 file and type Ctrl-F9 to compile the installer file.
56
67
57 Otherwise you run the Inno Setup compiler. Assuming it's on the path you run:
68 Otherwise you run the Inno Setup compiler. Assuming it's on the path you run:
58
69
59 iscc contrib\win32\mercurial.iss
70 iscc contrib\win32\mercurial.iss
60
71
61 The actual installer will be in the C:\hg\hg-release\Output directory.
72 The actual installer will be in the C:\hg\hg-release\Output directory.
62
73
63 To automate the steps above you may want to create a batchfile based on the
74 To automate the steps above you may want to create a batchfile based on the
64 following:
75 following:
65
76
66 echo [build] > setup.cfg
77 echo [build] > setup.cfg
67 echo compiler=mingw32 >> setup.cfg
78 echo compiler=mingw32 >> setup.cfg
68 python setup.py py2exe -b 1
79 python setup.py py2exe -b 1
80 cd doc
81 mingw32-make ASCIIDOC=asciidoc.bat html
82 cd ..
69 iscc contrib\win32\mercurial.iss
83 iscc contrib\win32\mercurial.iss
70
84
71 and run it from the root of the hg repository (c:\hg\hg-release).
85 and run it from the root of the hg repository (c:\hg\hg-release).
@@ -1,47 +1,48
1 SOURCES=$(wildcard *.[0-9].txt)
1 SOURCES=$(wildcard *.[0-9].txt)
2 MAN=$(SOURCES:%.txt=%)
2 MAN=$(SOURCES:%.txt=%)
3 HTML=$(SOURCES:%.txt=%.html)
3 HTML=$(SOURCES:%.txt=%.html)
4 PREFIX=/usr/local
4 PREFIX=/usr/local
5 MANDIR=$(PREFIX)/share/man
5 MANDIR=$(PREFIX)/share/man
6 INSTALL=install -c
6 INSTALL=install -c
7 PYTHON=python
7 PYTHON=python
8 ASCIIDOC=asciidoc
8
9
9 all: man html
10 all: man html
10
11
11 man: $(MAN)
12 man: $(MAN)
12
13
13 html: $(HTML)
14 html: $(HTML)
14
15
15 hg.1.txt: hg.1.gendoc.txt
16 hg.1.txt: hg.1.gendoc.txt
16 touch hg.1.txt
17 touch hg.1.txt
17
18
18 hg.1.gendoc.txt: ../mercurial/commands.py ../mercurial/help.py
19 hg.1.gendoc.txt: ../mercurial/commands.py ../mercurial/help.py
19 ${PYTHON} gendoc.py > $@
20 ${PYTHON} gendoc.py > $@
20
21
21 %: %.xml
22 %: %.xml
22 xmlto man $*.xml ; \
23 xmlto man $*.xml ; \
23 sed -e 's/^\.hg/\\\&.hg/' $* > $*~ ; \
24 sed -e 's/^\.hg/\\\&.hg/' $* > $*~ ; \
24 mv $*~ $*
25 mv $*~ $*
25
26
26 %.xml: %.txt
27 %.xml: %.txt
27 asciidoc -d manpage -b docbook $*.txt
28 $(ASCIIDOC) -d manpage -b docbook $*.txt
28
29
29 %.html: %.txt
30 %.html: %.txt
30 asciidoc -b html4 $*.txt || asciidoc -b html $*.txt
31 $(ASCIIDOC) -b html4 $*.txt || $(ASCIIDOC) -b html $*.txt
31
32
32 MANIFEST: man html
33 MANIFEST: man html
33 # tracked files are already in the main MANIFEST
34 # tracked files are already in the main MANIFEST
34 $(RM) $@
35 $(RM) $@
35 for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \
36 for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \
36 echo "doc/$$i" >> $@ ; \
37 echo "doc/$$i" >> $@ ; \
37 done
38 done
38
39
39 install: man
40 install: man
40 for i in $(MAN) ; do \
41 for i in $(MAN) ; do \
41 subdir=`echo $$i | sed -n 's/..*\.\([0-9]\)$$/man\1/p'` ; \
42 subdir=`echo $$i | sed -n 's/..*\.\([0-9]\)$$/man\1/p'` ; \
42 mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \
43 mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \
43 $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \
44 $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \
44 done
45 done
45
46
46 clean:
47 clean:
47 $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST
48 $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST
General Comments 0
You need to be logged in to leave comments. Login now