Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 9c9fff5

Browse files
author
Steph Fox
committed
That should be everything.
Hopefully.
1 parent 8311a7e commit 9c9fff5

15 files changed

+355
-1121
lines changed

Makefile.in

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# +----------------------------------------------------------------------+
2+
# | PHP Version 5.1 |
3+
# +----------------------------------------------------------------------+
4+
# | Copyright (c) 1999-2006 The PHP Group |
5+
# +----------------------------------------------------------------------+
6+
# | This source file is subject to version 3.0.1 of the PHP license, |
7+
# | that is bundled with this package in the file LICENSE and is |
8+
# | available online at http://www.php.net/license/3_0_1.txt. |
9+
# | If you did not receive a copy of the PHP license and are unable to |
10+
# | obtain it through the world wide web, please send a note to |
11+
# | [email protected] so we can mail you a copy immediately |
12+
# +----------------------------------------------------------------------+
13+
# | Authors: James Moore <[email protected]>, Steph Fox <[email protected]> |
14+
# +----------------------------------------------------------------------+
15+
16+
#
17+
# $Id$
18+
#
19+
20+
#
21+
# Paths
22+
#
23+
STYLESHEET_DIR = @STYLESHEET_DIR@
24+
SCRIPT_DIR = @SCRIPT_DIR@
25+
MANUAL = @MANUAL@
26+
LANG = @LANG@
27+
BUILD = build/@LANG@
28+
BUILD_TEST = testbuild
29+
HISTORY = @HISTORY@
30+
31+
#
32+
# Programs and scripts
33+
#
34+
XSLTPROC = @XSLTPROC@
35+
PHP = @PHP@
36+
HIGHLIGHT = $(SCRIPT_DIR)/highlight.php
37+
SPLIT = $(SCRIPT_DIR)/distribute_html.php
38+
IMAGES = $(SCRIPT_DIR)/copy_images.php
39+
TMP = $(BUILD_TEST)/temp.php
40+
TS = @TS@
41+
42+
#
43+
# Default Rule
44+
#
45+
all: html
46+
47+
#
48+
# Build Aliases
49+
#
50+
bigmanual.html: $(BUILD)/bigmanual.html
51+
html: $(BUILD)/html/index.html
52+
phpweb: $(BUILD)/php/index.php
53+
mtoc: $(BUILD_TEST)/mtoc.xml
54+
test: $(BUILD_TEST)/index.html
55+
updates: $(BUILD_TEST)/updates-$(LANG).php
56+
57+
mirror-files: $(BUILD)/bigmanual.html.gz \
58+
$(BUILD)/php_gtk_manual_$(LANG).tar.bz2 \
59+
$(BUILD)/php_gtk_manual_$(LANG).tar.gz \
60+
$(BUILD)/php_gtk_manual_$(LANG).zip
61+
62+
#
63+
# Dependency Aliases
64+
#
65+
html = $(STYLESHEET_DIR)/html.xsl
66+
chunk = $(STYLESHEET_DIR)/chunk.xsl
67+
phpweb = $(STYLESHEET_DIR)/phpweb.xsl
68+
docbook = $(STYLESHEET_DIR)/docbook.xsl
69+
updates = $(STYLESHEET_DIR)/updates.xsl
70+
71+
#
72+
# Make Rules
73+
#
74+
$(BUILD)/bigmanual.html: $(SCRIPT_DIR)/manual.xml
75+
@mkdir -p $(BUILD)
76+
$(XSLTPROC) --xinclude $(docbook) $(SCRIPT_DIR)/manual.xml > $(BUILD)/bigmanual.html
77+
78+
$(BUILD)/html/index.html: scripts/manual.xml
79+
@mkdir -p $(BUILD)/html
80+
$(XSLTPROC) --param base.dir "'$(BUILD)/html/'" --xinclude $(chunk) $(SCRIPT_DIR)/manual.xml
81+
$(PHP) $(SPLIT) $(BUILD)/html
82+
$(PHP) $(IMAGES) $(BUILD)/html
83+
84+
$(BUILD)/php/index.php: scripts/manual.xml
85+
@mkdir -p $(BUILD)/php
86+
$(XSLTPROC) --param base.dir "'$(BUILD)/php/'" --xinclude $(phpweb) $(SCRIPT_DIR)/manual.xml
87+
$(PHP) $(HIGHLIGHT) php $(BUILD)/php
88+
$(PHP) $(IMAGES) $(BUILD)/php
89+
90+
$(BUILD)/bigmanual.html.gz: $(BUILD)/bigmanual.html
91+
@mkdir -p $(BUILD)
92+
gzip -c -9 $< > $@
93+
94+
$(BUILD)/php_gtk_manual_$(LANG).tar.bz2: $(BUILD)/html/index.html
95+
(cd $(BUILD); tar -cf - html) | bzip2 -9 > $@
96+
97+
$(BUILD)/php_gtk_manual_$(LANG).tar.gz: $(BUILD)/html/index.html
98+
(cd $(BUILD); tar -c html) | gzip -9 > $@
99+
100+
$(BUILD)/php_gtk_manual_$(LANG).zip: $(BUILD)/html/index.html
101+
(cd $(BUILD); zip -q -r -9 - html) > $@
102+
103+
$(BUILD_TEST)/index.html: $(SCRIPT_DIR)/testmanual.xml
104+
@mkdir -p $(BUILD_TEST)
105+
$(XSLTPROC) --param base.dir --xinclude "'$(BUILD_TEST)/'" $(chunk) $(SCRIPT_DIR)/testmanual.xml
106+
107+
$(BUILD_TEST)/mtoc.xml: $(SCRIPT_DIR)/mtoc.xml
108+
@mkdir -p $(BUILD_TEST)
109+
$(XSLTPROC) --param base.dir --xinclude "'$(BUILD_TEST)/'" $(chunk) $(SCRIPT_DIR)/mtoc.xml
110+
111+
$(BUILD_TEST)/updates-$(LANG).php: $(SCRIPT_DIR)/testclasses.xml
112+
@mkdir -p $(BUILD_TEST)
113+
$(XSLTPROC) $(updates) $(SCRIPT_DIR)/testmanual.xml > $(TMP)
114+
@cat $(TMP) | sed -e 's/ \[en\]//;s/\"\"/"$(TS)"/;/php/!d;s/^ *//' > $(BUILD_TEST)/updates-new.php
115+
@if test -f $(HISTORY)/updates-$(LANG).php; then \
116+
cp $(HISTORY)/updates-$(LANG).php $@; \
117+
$(PHP) $(SCRIPT_DIR)/merge_updates.php $(BUILD_TEST)/updates-new.php $@; \
118+
else \
119+
mv $(BUILD_TEST)/updates-new.php $@; \
120+
fi
121+
@rm -f $(TMP)
122+
123+
#
124+
# Clean Rules
125+
#
126+
clean:
127+
rm -rf $(BUILD)
128+
rm -rf autom4te.cache
129+
rm -f config.status config.log configure Makefile
130+
rm -f $(MANUAL)/chapters.ent
131+
rm -f $(SCRIPT_DIR)/manual.xml $(SCRIPT_DIR)/genchapterents.php $(SCRIPT_DIR)/update.xsl
132+
133+
distclean: clean
134+
rm -f Makefile $(SCRIPT_DIR)/manual.xml configure
135+
rm -f config.cache config.log config.status version.ent
136+
cd $(SCRIPT_DIR); rm -f genchapterents.php
137+
cd $(STYLESHEET_DIR); rm -f phpweb.xsl
138+
rm -rf $(BUILD_TEST)
139+
140+
cvsclean:
141+
@for i in `find . -name .cvsignore`; do \
142+
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` || true); \
143+
done

check_chapterusage.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

cleanup.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

configure.in

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# +----------------------------------------------------------------------+
2+
# | PHP Version 4.0 |
3+
# +----------------------------------------------------------------------+
4+
# | Copyright (c) 1999-2006 The PHP Group |
5+
# +----------------------------------------------------------------------+
6+
# | This source file is subject to version 3.0.1 of the PHP license, |
7+
# | that is bundled with this package in the file LICENSE and is |
8+
# | available online at http://www.php.net/license/3_0_1.txt. |
9+
# | If you did not receive a copy of the PHP license and are unable to |
10+
# | obtain it through the world wide web, please send a note to |
11+
# | [email protected] so we can mail you a copy immediately |
12+
# +----------------------------------------------------------------------+
13+
# | Authors: James Moore <[email protected]>, Steph Fox <[email protected]> |
14+
# +----------------------------------------------------------------------+
15+
16+
#
17+
# $Id$
18+
19+
AC_INIT
20+
AC_CONFIG_SRCDIR([manual/global.ent])
21+
22+
AC_PATH_PROG(XSLTPROC, xsltproc, no)
23+
AC_PATH_PROG(PHP, php, no)
24+
25+
if test "$XSLTPROC" = "no";
26+
then
27+
AC_MSG_ERROR(cannot find xsltproc)
28+
fi
29+
30+
if test "$PHP" = "no";
31+
then
32+
AC_MSG_ERROR(unable to locate php executable)
33+
fi
34+
35+
DOCBOOK_DOCTYPE="-//PHP Group//DTD DocBk XML V3.1.7-Based Extension//EN"
36+
AC_SUBST(DOCBOOK_DOCTYPE)
37+
38+
SCRIPT_DIR="./scripts"
39+
AC_SUBST(SCRIPT_DIR)
40+
41+
STYLESHEET_DIR="./stylesheets/html"
42+
AC_SUBST(STYLESHEET_DIR)
43+
44+
MANUAL="manual"
45+
AC_SUBST(MANUAL)
46+
47+
PHP_GTK2_DOC_BUILD_DATE=`date`
48+
AC_SUBST(PHP_GTK2_DOC_BUILD_DATE)
49+
50+
AC_MSG_CHECKING(for language)
51+
AC_ARG_WITH(lang,
52+
[ --with-lang=LANG choose a language to work with],
53+
[
54+
if test "$withval"
55+
then
56+
if test ! -d "$MANUAL/$withval";
57+
then
58+
AC_MSG_RESULT()
59+
AC_MSG_ERROR(Language "$withval" not supported!)
60+
fi
61+
LANG=$withval
62+
LANGDIR=$MANUAL/$withval
63+
AC_MSG_RESULT($withval)
64+
fi
65+
],[
66+
LANG=en
67+
LANGDIR=$MANUAL/en
68+
AC_MSG_RESULT([en (default)])
69+
])
70+
71+
AC_SUBST(LANG)
72+
AC_SUBST(LANGDIR)
73+
74+
TS=`date -u +%Y%m%d`
75+
AC_SUBST(TS)
76+
77+
# need an old copy of the source to check against for updates
78+
AC_ARG_WITH(history,
79+
[ --with-history=HISTORY path to archived module copy (for updates) ],
80+
[
81+
if test "$withval"
82+
then
83+
AC_MSG_CHECKING(for path to archived module copy (for updates))
84+
HISTORY=$withval
85+
AC_MSG_RESULT($withval)
86+
AC_SUBST(HISTORY)
87+
fi
88+
])
89+
90+
AC_SUBST(HISTORY)
91+
92+
if [ test -d $HISTORY/manual/$LANG ]; then
93+
for xmlfile in `find $LANGDIR -name "*.xml" | sed -e"s%^$LANGDIR\/%%g" | sort`
94+
do
95+
if test -f $LANGDIR/$xmlfile
96+
then
97+
newfilepath=$LANGDIR/$xmlfile
98+
oldfilepath=$HISTORY/manual/$LANG/$xmlfile
99+
if test $newfilepath -nt $oldfilepath
100+
then
101+
echo Updating "$xmlfile"...
102+
updates="$updates $newfilepath"
103+
fi
104+
fi
105+
done;
106+
fi
107+
108+
AC_CONFIG_FILES([\
109+
Makefile \
110+
$SCRIPT_DIR/manual.xml \
111+
$SCRIPT_DIR/mtoc.xml \
112+
$SCRIPT_DIR/testmanual.xml \
113+
$STYLESHEET_DIR/phpweb.xsl \
114+
$STYLESHEET_DIR/updates.xsl \
115+
$SCRIPT_DIR/genchapterents.php ])
116+
AC_OUTPUT
117+
118+
echo creating chapters.ent
119+
$PHP -q $SCRIPT_DIR/genchapterents.php > $MANUAL/chapters.ent
120+
echo creating name_to_id.xsl
121+
$XSLTPROC $SCRIPT_DIR/gen_name_to_id.xsl $SCRIPT_DIR/manual.xml > $STYLESHEET_DIR/name_to_id.xsl
122+
123+
#now add the list of updated files to the testclasses.xml
124+
# this has to be done after chapters.ent is created
125+
126+
if test -n "$updates" ; then
127+
echo creating $SCRIPT_DIR/testclasses.xml
128+
for updatedfile in $updates
129+
do
130+
# need to remove 'manual/' from the search path since the dir structure changed
131+
updatedfile=`echo $updatedfile | sed -e "s/$MANUAL\///g"`
132+
ref=`grep -e "$updatedfile" $MANUAL/chapters.ent | sed "s/^<!ENTITY //" | sed "s/ .*//"`
133+
if test -n "$ref"; then
134+
refs="$refs \&$ref;"
135+
fi
136+
done
137+
138+
sed "s/@TEST_REFERENCES@/$refs/g" $SCRIPT_DIR/testclasses.xml.in > $SCRIPT_DIR/testclasses.xml
139+
fi
140+
141+
chmod +x $SCRIPT_DIR/genchapterents.php

0 commit comments

Comments
 (0)