1
AUTOMAKE_OPTIONS = 1.4 foreign
2
AUTOTOOL_VERSION=autoconf-2.52 automake-1.5 libtool-1.4.2
4
doc_FILES = README.MSVC6 README.SDL COPYING.MPL COPYING.LIB COPYING.ZLIB \
6
htm_FILES = zzip-index.htm zzip-zip.htm zzip-file.htm zzip-sdl-rwops.htm \
7
zzip-extio.htm zzip-xor.htm zzip-crypt.htm zzip-cryptoid.htm \
8
zzip-api.htm zzip-basics.htm zzip-extras.htm zzip-parse.htm \
9
64on32.htm future.htm fseeko.htm mmapped.htm memdisk.htm \
10
configs.htm sfx-make.htm developer.htm download.htm \
11
history.htm referentials.htm faq.htm copying.htm
12
SDL = @top_srcdir@/SDL
13
SDL_RWOPS = $(SDL)/SDL_rwops_zzcat.c \
14
$(SDL)/SDL_rwops_zzip.c $(SDL)/SDL_rwops_zzip.h
15
changelog = @top_srcdir@/ChangeLog
17
EXTRA_DIST = make-doc.py $(doc_FILES) $(htm_FILES) $(SDL_RWOPS) \
18
make-doc.pl make-dbk.pl mksite.sh mksite.pl body.htm \
19
manpages.ar zziplib-master.dbk
20
CLEANFILES = *.pc *.omf
21
DISTCLEANFILES = zziplib.spec manpages.ar htmpages.ar *.html *.xml
23
html_FILES = $(htm_FILES:.htm=.html) \
24
$(htm_FILES:.htm=.print.html) \
25
site.html site.print.html
28
clean-doc clean-docs : clean-unpack
29
- rm $(DISTCLEANFILES)
30
- rm $(MAINTAINERCLEANFILES)
32
# -------------------------------------------------------------------
33
zziplib.spec : @top_srcdir@/$(PACKAGE).spec
34
@ $(LN_S) $? $@ # the two zzip-doc.* will grep thru zziplib.spec
35
doc : $(doc_FILES) site.html
36
docs : doc manpages.ar htmpages.ar
38
zziplib0.html : zziplib0.xml
39
zziplib0.xml : zziplib.spec @srcdir@/Makefile.am @srcdir@/make-doc.pl \
40
$(srcdir)/make-doc.pl @top_srcdir@/zzip/*.c
41
- @PERL@ $(srcdir)/make-doc.pl @top_srcdir@/zzip/*.c \
42
"suffix=0" "package=$(PACKAGE)" "version=$(VERSION)" \
43
"mainheader=zzip/zzip.h" "exported=<zzip/zzip.h> // or <zziplib.h>" \
46
zziplib1.html : zziplib1.xml
47
zziplib1.xml : zziplib.spec @srcdir@/Makefile.am @srcdir@/make-doc.py \
48
$(srcdir)/make-doc.py @top_srcdir@/zzip/*.c
49
- @PYTHON@ $(srcdir)/make-doc.py @top_srcdir@/zzip/*.c suffix=1
50
- test -f zziplib1.docbook && mv zziplib1.docbook $@ ; test -s $@
51
zziplib.html : zziplib1.html zziplib0.html
52
- test -s zziplib0.html && cp zziplib0.html zziplib.html
53
- test -s zziplib1.html && cp zziplib1.html zziplib.html
55
zziplib.xml : zziplib1.xml zziplib0.xml
56
- test -s zziplib0.xml && cp zziplib0.xml zziplib.xml
57
- test -s zziplib1.xml && cp zziplib1.xml zziplib.xml
61
pkgomfdir=${omfdir}/${PACKAGE}
62
SFNETDIR=/groups/z/zz/zziplib/htdocs
63
SFNETDOC=${datadir}${SFNETDIR}
64
pkgdocdir=${datadir}${SFNETDIR}
65
bins = @top_srcdir@/bins
66
DOCEXAMPLES = $(bins)/zzdir.c $(bins)/zzcat.c \
67
$(bins)/zzobfuscated.c $(bins)/zziptest.c \
68
$(bins)/zzxordir.c $(bins)/zzxorcat.c \
69
$(bins)/zzxorcopy.c $(SDL_RWOPS)
71
install-docu: $(doc_FILES) $(man_FILES) site.html $(PACKAGE)-doc.omf
72
$(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
73
for i in $(html_FILES) ; do cat $$i \
74
| sed -e 's:--START-->:-- :' -e 's:<!--ENDS--: --:' \
75
-e "s:\\(href=\"[^/\"]*\\)[.]html\":\\1.htm\":" \
76
-e "s:\\(href=\"[^/\"]*\\)[.]html\#:\\1.htm\#:" \
77
> $(DESTDIR)$(pkgdocdir)/$$i ; done
78
@ for i in $(doc_FILES) $(DOCEXAMPLES) $(srcdir)/README.* \
79
; do $(INSTALL_DATA) `test -f $$i || echo $(srcdir)/`$$i \
80
$(DESTDIR)$(pkgdocdir) ; done
81
(cd $(DESTDIR)$(pkgdocdir) && ln -sf zziplib.html zziplib.htm)
82
$(mkinstalldirs) $(DESTDIR)$(pkgomfdir)
83
$(INSTALL_DATA) $(PACKAGE)-doc.omf $(DESTDIR)$(pkgomfdir)/
84
- test ".$(DESTDIR)" != "." || scrollkeeper-update
86
install-sfnet: $(doc_FILES) $(man_FILES) site.html htmpages.ar
87
$(mkinstalldirs) $(DESTDIR)$(SFNETDOC)
88
$(INSTALL_DATA) $(html_FILES) $(DESTDIR)$(SFNETDOC)
89
for i in $(doc_FILES) $(DOCEXAMPLES) $(changelog) $(srcdir)/README.* \
90
; do $(INSTALL_DATA) `test -f $$i || echo $(srcdir)/`$$i \
91
$(DESTDIR)$(SFNETDOC) ; done
92
(cd $(DESTDIR)$(SFNETDOC) && ln -sf zzip-index.html index.html)
93
$(mkinstalldirs) $(DESTDIR)$(SFNETDOC)/man
94
(test -f htmpages.ar || cd "$srcdir" ; P=`pwd` \
95
; cd $(DESTDIR)$(SFNETDOC)/man && ar x $$P/htmpages.ar)
97
install-doc : install-docu install-sfnet
99
# --------------------------------------------------------------------
100
man manpages : manpages.ar
101
htm htmpages : htmpages.ar
103
manpages.ar : zziplib.xml
104
@ if test "$(XMLTO)" = ":" \
105
; then echo no xmlto found - could not regenerate "$@" - skipped \
106
; echo just touching the output file "$@" ; touch "$@" \
107
; else echo going to regenerate "$@" in subdir "'"man"'" \
108
; echo 'test ! -d man || rm man/* ; test -d man || mkdir man' \
109
; test ! -d man || rm man/* ; test -d man || mkdir man \
110
; echo '(cd man && xmlto man ../zziplib.xml)' \
111
; (cd man && xmlto man ../zziplib.xml) \
112
; echo 'test ! -f $@ || mv $@ $@.old' \
113
; test ! -f $@ || mv $@ $@.old \
114
; echo '(cd man && ar qc ../$@ *.3)' \
115
; (cd man && ar qc ../$@ *.3) \
116
; echo '(rm man/*.3 ; rmdir man)' \
117
; (rm man/*.3 ; rmdir man) \
118
; fi ; test -s $@ || mv $@.old $@ \
119
|| mv $(srcdir)/$@.old $@ || test -s $@.old >$@
121
htmpages.ar : zziplib.xml
122
@ if test "$(XMLTO)" = ":" \
123
; then echo no xmlto found - could not regenerate "$@" - skipped \
124
; echo just touching the output file "$@" ; touch "$@" \
125
; else echo going to regenerate "$@" in subdir "'"man"'" \
126
; echo 'test ! -d man || rm /* ; test -d man || mkdir man' \
127
; test ! -d man || rm man/* ; test -d man || mkdir man \
128
; echo '(cd man && xmlto html ../zziplib.xml | tee written.lst)' \
129
; (cd man && xmlto html ../zziplib.xml | tee written.lst) \
130
; echo 'test ! -f $@ || mv $@ $@.old' \
131
; test ! -f $@ || mv $@ $@.old \
132
; echo '(cd man && ar qc ../$@ *.*)' \
133
; (cd man && ar qc ../$@ *.*) \
134
; echo '(rm man/*.* ; rmdir man)' \
135
; (rm man/*.* ; rmdir man) \
136
; fi ; test -s $@ || mv $@.old $@ \
137
|| mv $(srcdir)/$@.old $@ || test -s $@.old >$@
139
install-man3 : manpages.ar
140
$(mkinstalldirs) $(DESTDIR)$(mandir)/man3
141
P=`pwd` ; cd $(DESTDIR)$(mandir)/man3 \
142
&& ar x $$P/manpages.ar && chmod 664 *
144
unpack : manpages.ar htmpages.ar
145
(rm -rf _htm && mkdir _htm && cd _htm && ar x ../htmpages.ar)
146
(rm -rf _man && mkdir _man && cd _man && ar x ../manpages.ar)
151
# -------------------------------------------------------------------
152
spec_file=$(top_srcdir)/$(PACKAGE).spec
153
DOCSERIES= 775fb73e-1874-11d7-93e9-e18cd7ea3c2e
154
FROMSPEC= $(spec_file) | head -1 | sed -e 's,<,\<,g' -e 's,>,\>,g'
155
DATESPEC= `date +%Y-%m-%d`
157
$(PACKAGE)-doc.omf : $(spec_file) Makefile
158
echo '<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>' >$@
159
echo '<omf><resource><creator> Guido Draheim </creator>' >>$@
160
grep Packager $(FROMSPEC) | sed -e 's,Packager *: *, <maintainer>,' \
161
-e '/<maintainer>/s,$$,</maintainer>,' >>$@
162
grep Summary $(FROMSPEC) | sed -e 's,Summary *: *, <title>,' \
163
-e '/<title>/s,$$,</title>,' >>$@
164
echo ' <date>'$(DATESPEC)'</date>' >>$@
165
echo ' <version identifier="$(VERSION)" date="'$(DATESPEC)'"/>' >>$@
166
grep Group $(FROMSPEC) | sed -e 's,Group *: *, <subject category=",' \
167
-e 's,/,|,g' -e '/<subject/s,$$," />,' >>$@
168
echo ' <format mime="text/html"/>' >>$@
169
echo ' <identifier url="file:$(pkgdocdir)/zzip-index.htm"/>' >>$@
170
echo ' <language code="C"/>' >>$@
171
echo ' <relation seriesid="$(DOCSERIES)"/>' >>$@
172
echo ' <rights type="GNU LGPL" holder="Guido Draheim"' >>$@
173
echo ' license="$(pkgdocdir)/COPYING.LIB"/>' >>$@
174
echo '</resource></omf>' >>$@
176
DOCBOOKDTD= -//OASIS/DTD Docbook V4.1.2//EN
177
MANSERIES= a302c642-1888-11d7-86f6-ba4b52ef847d
178
$(PACKAGE)-man.omf : $(PACKAGE)-doc.omf $(PACKAGE).xml
179
sed -e 's,"text/html","text/xml" dtd="$(DOCBOOKDTD)",' \
180
-e 's,</title>, (Function Reference)</title>,' \
181
-e 's,/index.html,/manpages.xml,' \
182
-e 's,$(DOCSERIES),$(MANSERIES),' $(PACKAGE)-doc.omf > $@
185
omf : $(PACKAGE)-doc.omf $(PACKAGE)-man.omf $(PACKAGE).xml
186
install-omf : $(PACKAGE)-doc.omf $(PACKAGE)-man.omf $(PACKAGE).xml
187
$(mkinstalldirs) $(DESTDIR)$(pkgomfdir)
188
$(INSTALL_DATA) $(PACKAGE)-doc.omf $(DESTDIR)$(pkgomfdir)/
189
$(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
190
$(INSTALL_DATA) $(PACKAGE).xml $(DESTDIR)$(pkgdocdir)/manpages.xml
191
$(INSTALL_DATA) $(PACKAGE)-man.omf $(DESTDIR)$(pkgomfdir)/
192
- test ".$(DESTDIR)" != "." || scrollkeeper-update -v
194
# -------------------------------------------------------------------
195
datehead = <hr><table border="0" width="100%"><tr><td> \
196
<a href="mailto:guidod@gmx.de?subject=$(PACKAGE):">guidod@gmx.de</a> \
197
</td><td align="right">
198
datetail = </td></tr></table>
199
borderhead = <table cellpadding="10"><tr><td>
200
bordertail = </td></tr></table>
203
cp $(srcdir)/body.htm site.htm
204
mksite_sh_args = --VERSION=$(VERSION) --xml --src-dir=$(srcdir)
205
site.html : site.htm mksite.sh $(htm_FILES)
206
perl $(srcdir)/mksite.pl $(mksite_sh_args) site.htm || \
207
$(SHELL) $(srcdir)/mksite.sh $(mksite_sh_args) site.htm
209
x : $(htm_FILES:.htm=.htmls)
210
$(htm_FILES:.htm=.htmls) : body.htm
212
@ title=`grep '<h2>' $< | sed -e 's:</h2>.*::' -e 's:<[^<>]*>::g'` \
213
; D=$(DATESPEC) ; cat $(srcdir)/body.htm \
214
| sed -e "s/<!--VERSION-->/$(VERSION)/" \
215
| sed -e "s/<!--DATE-->/$$D/" \
216
| sed -e "s:</title>: - $$title</title>:" \
217
| sed -e "/$@.>/s:\\([^<>]*\\)</a>:<b>\\1</b></a>:" \
219
@ echo $< '>>' $@; cat $< | sed -e "s/<!--VERSION-->/$(VERSION)/" \
220
-e "s:</h2>\\(.*\\):</h2></td><td><i>\\1</i></td></tr></table>:" \
221
-e 's:<h2>:<table width="100%"><tr valign="bottom"><td><h2>:' \
222
-e 's:<td><i>:<td align="right"><br> <i>:' \
223
-e 's:<P>:<p class="justify"><span class="justify">:g' \
224
-e 's:</P>:</span></p>:g' \
225
-e 's,<date>,<!--DATE: ,' -e 's,</date>, -->,' \
226
-e 's,<!--border-->,$(borderhead)<!--BORDER-->,' >>$@
227
@ if grep '<!--BORDER-->' $@ >/dev/null ; then : \
228
; echo "$(bordertail)<!--/BORDER-->" >>$@ ; fi
229
@ D=`grep '<!--DATE:' $@ | sed -e 's,.*<!--DATE: *,,' -e 's, *-->,,'` \
230
; if test ".$$D" != "." ; then echo '$(datehead)' >>$@ \
231
; echo "$$D" >> $@ ; echo "$(datetail)" >> $@ ; fi
232
@ echo "</td></tr></table></body></html>" >>$@
234
# ----------------------------------------------- create pdf via docbook xml
235
zzip.xml : $(htm_FILES) zziplib.xml make-dbk.pl
236
@PERL@ make-dbk.pl $(htm_FILES) zziplib.xml >$@
237
test -s "$@" || rm "$@"
240
xmlto html-nochunks zzip.xml
244
zziplib.pdf : $(htm_FILES) $(srcdir)/zziplib-master.dbk mksite.pl
245
cp $(srcdir)/zziplib-master.dbk zziplib.docbook
246
xmlto pdf zziplib.docbook ; rm zziplib.docbook