Adjusted for automatic generation of html and txt version with sgml2html

and sgml2txt. Should work with autoconfigure.
This commit is contained in:
Matthias Hessler 1999-09-05 22:58:12 +00:00
parent a64af1ba09
commit 223041375b
3 changed files with 94 additions and 151 deletions

View File

@ -4,8 +4,6 @@
# Generate FAQ, support FAQ development # Generate FAQ, support FAQ development
# Directories # Directories
# All Perl scripts for generation of FAQ are in BIN
BIN = ./bin
# All output files are generated in GEN_DIR # All output files are generated in GEN_DIR
GEN_DIR = ./out GEN_DIR = ./out
# After generation, install files in TARGET_DIR (if different from GEN_DIR) # After generation, install files in TARGET_DIR (if different from GEN_DIR)
@ -14,161 +12,66 @@ TARGET_DIR = @TARGET_DIR@
# Program file names # Program file names
ZIP = @C_ZIP@ ZIP = @C_ZIP@
GZIP = @C_GZIP@ GZIP = @C_GZIP@
PERL = @C_PERL@ SGML2HTML = @C_SGML2HTML@
SGML2TXT = @C_SGML2TXT@
INSTALL = @INSTALL@ INSTALL = @INSTALL@
HTML = $(PERL) $(BIN)/html.pl
7BIT = $(PERL) $(BIN)/7bit.pl
OLD = $(PERL) $(BIN)/old.pl
NEW = $(PERL) $(BIN)/new.pl
# Source file names # Source file names
SRC = de-i4l-faq SRC = i4lfaq.sgml
OLD_SRC = $(SRC).old OUT_NAME = i4lfaq
SRC_DIFF = $(SRC).diff OUT_HTML = $(OUT_NAME).html
# please note that also files like i4lfaq-1.html, i4lfaq-11.html,...
SRC_ENG = eng-i4l-faq # will be generated...
OLD_SRC_ENG = $(SRC_ENG).old OUT_TXT = $(OUT_NAME).txt
SRC_ENG_DIFF = $(SRC_ENG).diff
# Output file names
OUT_7BIT = $(SRC).asc
OUT_HTML = $(SRC).html
OUT_ENG_7BIT = $(SRC_ENG).asc
OUT_ENG_HTML = $(SRC_ENG).html
# *** Generate FAQ *** # *** Generate FAQ ***
# Generate all FAQ versions # Generate all FAQ versions
#all: Makefile $(GEN_DIR) 7bit html e7bit ehtml all: Makefile $(GEN_DIR) html txt
all: Makefile
$(GEN_DIR): $(GEN_DIR):
-mkdir -p $(GEN_DIR) -mkdir -p $(GEN_DIR)
# Generate 7bit version of German FAQ
7bit: $(GEN_DIR)/$(OUT_7BIT)
$(GEN_DIR)/$(OUT_7BIT): $(SRC) # Generate html version of FAQ
$(7BIT) $(SRC) $(GEN_DIR)/$(OUT_7BIT)
# Generate html version of German FAQ
html: $(GEN_DIR)/$(OUT_HTML) html: $(GEN_DIR)/$(OUT_HTML)
$(GEN_DIR)/$(OUT_HTML): $(SRC) $(GEN_DIR)/$(OUT_HTML):
$(HTML) $(SRC) $(GEN_DIR)/$(OUT_HTML) cp $(SRC) $(GEN_DIR); cd $(GEN_DIR); $(SGML2HTML) $(SRC); rm $(SRC)
# Generate 7bit version of English FAQ
e7bit: $(GEN_DIR)/$(OUT_ENG_7BIT)
$(GEN_DIR)/$(OUT_ENG_7BIT): $(SRC)
$(7BIT) $(SRC_ENG) $(GEN_DIR)/$(OUT_ENG_7BIT)
# Generate html version of English FAQ # Generate text version of FAQ
ehtml: $(GEN_DIR)/$(OUT_ENG_HTML) txt: $(GEN_DIR)/$(OUT_TXT)
$(GEN_DIR)/$(OUT_ENG_HTML): $(SRC) $(GEN_DIR)/$(OUT_TXT):
$(HTML) $(SRC_ENG) $(GEN_DIR)/$(OUT_ENG_HTML) cp $(SRC) $(GEN_DIR); cd $(GEN_DIR); $(SGML2TXT) $(SRC); rm $(SRC)
# *** Develop FAQ *** # Generate all zip versions
zip: $(GEN_DIR)/$(OUT_NAME)-sgml.zip $(GEN_DIR)/$(OUT_NAME)-html.zip $(GEN_DIR)/$(OUT_NAME)-txt.zip
# Generate zip-compressed versions of FAQ gz: $(GEN_DIR)/$(OUT_NAME)-sgml.gz $(GEN_DIR)/$(OUT_NAME)-html.gz $(GEN_DIR)/$(OUT_NAME)-txt.gz
zip: 7bit.zip html.zip e7bit.zip ehtml.zip
# Generate gz-compressed versions of FAQ
gz: 7bit.gz html.gz e7bit.gz ehtml.gz
# Compress 7bit version of German FAQ # Compress sgml
7bit.zip: $(GEN_DIR)/$(OUT_7BIT).zip $(GEN_DIR)/$(OUT_NAME)-sgml.zip: $(SRC)
7bit.gz: $(GEN_DIR)/$(OUT_7BIT).gz $(ZIP) -l $(GEN_DIR)/$(OUT_NAME)-sgml.zip $(SRC)
$(GEN_DIR)/$(OUT_NAME)-sgml.gz: $(SRC)
$(GZIP) -cf $(SRC) > $(GEN_DIR)/$(OUT_NAME)-sgml.gz
$(GEN_DIR)/$(OUT_7BIT).zip: $(GEN_DIR)/$(OUT_7BIT) # Compress html
$(ZIP) -l $(GEN_DIR)/$(OUT_7BIT).zip $(GEN_DIR)/$(OUT_7BIT) # Please note, that all html files will be compressed under $(GEN_DIR)
$(GEN_DIR)/$(OUT_7BIT).gz: $(GEN_DIR)/$(OUT_7BIT) $(GEN_DIR)/$(OUT_NAME)-html.zip: $(GEN_DIR)/$(OUT_NAME).html
$(GZIP) -cf $(GEN_DIR)/$(OUT_7BIT) > $(GEN_DIR)/$(OUT_7BIT).gz $(ZIP) -l $(GEN_DIR)/$(OUT_NAME)-html.zip $(GEN_DIR)/$(OUT_NAME)*.html
$(GEN_DIR)/$(OUT_NAME)-html.gz: $(GEN_DIR)/$(OUT_NAME).html
$(GZIP) -cf $(GEN_DIR)/$(OUT_NAME)*.html > $(GEN_DIR)/$(OUT_NAME)-html.gz
# Compress txt
# Compress html version of German FAQ # Please note, that txt file will be compressed under $(GEN_DIR)
html.zip: $(GEN_DIR)/$(OUT_HTML).zip $(GEN_DIR)/$(OUT_NAME)-txt.zip: $(GEN_DIR)/$(OUT_TXT)
html.gz: $(GEN_DIR)/$(OUT_HTML).gz $(ZIP) -l $(GEN_DIR)/$(OUT_NAME)-txt.zip $(GEN_DIR)/$(OUT_TXT)
$(GEN_DIR)/$(OUT_NAME)-txt.gz: $(GEN_DIR)/$(OUT_TXT)
$(GEN_DIR)/$(OUT_HTML).zip: $(GEN_DIR)/$(OUT_HTML) $(GZIP) -cf $(GEN_DIR)/$(OUT_TXT) > $(GEN_DIR)/$(OUT_NAME)-txt.gz
$(ZIP) -l $(GEN_DIR)/$(OUT_HTML).zip $(GEN_DIR)/$(OUT_HTML)
$(GEN_DIR)/$(OUT_HTML).gz: $(GEN_DIR)/$(OUT_HTML)
$(GZIP) -cf $(GEN_DIR)/$(OUT_HTML) > $(GEN_DIR)/$(OUT_HTML).gz
# Compress 7bit version of English FAQ
e7bit.zip: $(GEN_DIR)/$(OUT_ENG_7BIT).zip
e7bit.gz: $(GEN_DIR)/$(OUT_ENG_7BIT).gz
$(GEN_DIR)/$(OUT_ENG_7BIT).zip: $(GEN_DIR)/$(OUT_ENG_7BIT)
$(ZIP) -l $(GEN_DIR)/$(OUT_ENG_7BIT).zip $(GEN_DIR)/$(OUT_ENG_7BIT)
$(GEN_DIR)/$(OUT_ENG_7BIT).gz: $(GEN_DIR)/$(OUT_ENG_7BIT)
$(GZIP) -cf $(GEN_DIR)/$(OUT_ENG_7BIT) > $(GEN_DIR)/$(OUT_ENG_7BIT).gz
# Compress html version of English FAQ
ehtml.zip: $(GEN_DIR)/$(OUT_ENG_HTML).zip
ehtml.gz: $(GEN_DIR)/$(OUT_ENG_HTML).gz
$(GEN_DIR)/$(OUT_ENG_HTML).zip: $(GEN_DIR)/$(OUT_ENG_HTML)
$(ZIP) -l $(GEN_DIR)/$(OUT_ENG_HTML).zip $(GEN_DIR)/$(OUT_ENG_HTML)
$(GEN_DIR)/$(OUT_ENG_HTML).gz: $(GEN_DIR)/$(OUT_ENG_HTML)
$(GZIP) -cf $(GEN_DIR)/$(OUT_ENG_HTML) > $(GEN_DIR)/$(OUT_ENG_HTML).gz
# create German diff of German FAQ
dif:
[ ! -e $(SRC_DIFF) ] # Only create diff if there is no diff already!
diff -u $(OLD_SRC) $(SRC) > $(SRC_DIFF); echo -n
# patch German FAQ with German diff
pat:
[ -e $(SRC_DIFF) ] # Only patch if there is a diff for it!
patch $(SRC) < $(SRC_DIFF)
if [ -e $(SRC).orig ]; then mv $(SRC).orig $(OLD_SRC); fi
# Declare all questions in German FAQ as OLD (and store as OLD version)
old:
$(OLD) $(SRC); \
if [ -e $(OLD_SRC) ]; then rm $(OLD_SRC); fi; \
mv $(SRC) $(OLD_SRC); \
cp $(OLD_SRC) $(SRC)
# Declare all questions in German FAQ as NEW
new:
$(NEW) $(SRC)
# Create English diff of English FAQ
edif:
[ ! -e $(SRC_ENG_DIFF) ] # Only create diff if there is no diff already!
diff -u $(OLD_SRC_ENG) $(SRC_ENG) > $(SRC_ENG_DIFF); echo -n
# Patch English FAQ with English diff
epat:
[ -e $(SRC_ENG_DIFF) ] # Only patch if there is a diff for it!
patch $(SRC_ENG) < $(SRC_ENG_DIFF)
if [ -e $(SRC_ENG).orig ]; then mv $(SRC_ENG).orig $(OLD_SRC_ENG); fi
# Declare all questions in English FAQ as OLD (and store as OLD version)
eold:
$(OLD) $(SRC_ENG); \
if [ -e $(OLD_SRC_ENG) ]; then rm $(OLD_SRC_ENG); fi; \
mv $(SRC_ENG) $(OLD_SRC_ENG); \
cp $(OLD_SRC_ENG) $(SRC_ENG)
# Declare all questions in English FAQ as NEW
enew:
$(NEW) $(SRC_ENG)
# *** General Stuff *** # *** General Stuff ***
@ -185,9 +88,10 @@ uninstall:
set -e; \ set -e; \
if [ $(TARGET_DIR) != $(GEN_DIR) ]; then \ if [ $(TARGET_DIR) != $(GEN_DIR) ]; then \
cd $(DESTDIR)$(TARGET_DIR); \ cd $(DESTDIR)$(TARGET_DIR); \
for i in $(OUT_7BIT) $(OUT_HTML) $(OUT_ENG_7BIT) $(OUT_ENG_HTML) ; do \ for i in $(OUT_NAME)*.html ; do \
rm -f $$i $$i.zip $$i.gz ; \ rm -f $$i ; \
done; \ done ; \
rm -f $(OUT_TXT) ; \
fi fi
# Cleanup # Cleanup
@ -197,8 +101,15 @@ clean:
if [ -e *.orig ]; then rm *.orig; fi if [ -e *.orig ]; then rm *.orig; fi
set -e; \ set -e; \
cd $(GEN_DIR); \ cd $(GEN_DIR); \
for i in $(OUT_7BIT) $(OUT_HTML) $(OUT_ENG_7BIT) $(OUT_ENG_HTML) ; do \ if [ -e $(OUT_TXT) ]; then rm -f $(OUT_TXT); fi; \
rm -f $$i $$i.zip $$i.gz ; \ if [ -e $(OUT_NAME)-sgml.zip ]; then rm -f $(OUT_NAME)-sgml.zip; fi; \
if [ -e $(OUT_NAME)-sgml.gz ]; then rm -f $(OUT_NAME)-sgml.gz; fi; \
if [ -e $(OUT_NAME)-html.zip ]; then rm -f $(OUT_NAME)-html.zip; fi; \
if [ -e $(OUT_NAME)-html.gz ]; then rm -f $(OUT_NAME)-html.gz; fi; \
if [ -e $(OUT_NAME)-txt.zip ]; then rm -f $(OUT_NAME)-txt.zip; fi; \
if [ -e $(OUT_NAME)-txt.gz ]; then rm -f $(OUT_NAME)-txt.gz; fi; \
for i in $(OUT_NAME)*.html ; do \
rm -f $$i ; \
done done
config: config:

53
FAQ/configure vendored
View File

@ -447,7 +447,7 @@ echo > confdefs.h
# A filename unique to this package, relative to the directory that # A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct. # configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=de-i4l-faq ac_unique_file=i4lfaq.sgml
# Find the source files, if location was not specified. # Find the source files, if location was not specified.
if test -z "$srcdir"; then if test -z "$srcdir"; then
@ -660,22 +660,22 @@ else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
# Extract the first word of "perl", so it can be a program name with args. # Extract the first word of "sgml2html", so it can be a program name with args.
set dummy perl; ac_word=$2 set dummy sgml2html; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_path_C_PERL'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_path_C_SGML2HTML'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
case "$C_PERL" in case "$C_SGML2HTML" in
/*) /*)
ac_cv_path_C_PERL="$C_PERL" # Let the user override the test with a path. ac_cv_path_C_SGML2HTML="$C_SGML2HTML" # Let the user override the test with a path.
;; ;;
*) *)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH:/usr/sbin:/sbin:/usr/local/bin; do for ac_dir in $PATH:/usr/sbin:/sbin:/usr/local/bin; do
test -z "$ac_dir" && ac_dir=. test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then if test -f $ac_dir/$ac_word; then
ac_cv_path_C_PERL="$ac_dir/$ac_word" ac_cv_path_C_SGML2HTML="$ac_dir/$ac_word"
break break
fi fi
done done
@ -683,9 +683,39 @@ else
;; ;;
esac esac
fi fi
C_PERL="$ac_cv_path_C_PERL" C_SGML2HTML="$ac_cv_path_C_SGML2HTML"
if test -n "$C_PERL"; then if test -n "$C_SGML2HTML"; then
echo "$ac_t""$C_PERL" 1>&6 echo "$ac_t""$C_SGML2HTML" 1>&6
else
echo "$ac_t""no" 1>&6
fi
# Extract the first word of "sgml2txt", so it can be a program name with args.
set dummy sgml2txt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_path_C_SGML2TXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$C_SGML2TXT" in
/*)
ac_cv_path_C_SGML2TXT="$C_SGML2TXT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH:/usr/sbin:/sbin:/usr/local/bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_C_SGML2TXT="$ac_dir/$ac_word"
break
fi
done
IFS="$ac_save_ifs"
;;
esac
fi
C_SGML2TXT="$ac_cv_path_C_SGML2TXT"
if test -n "$C_SGML2TXT"; then
echo "$ac_t""$C_SGML2TXT" 1>&6
else else
echo "$ac_t""no" 1>&6 echo "$ac_t""no" 1>&6
fi fi
@ -833,7 +863,8 @@ s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@C_ZIP@%$C_ZIP%g s%@C_ZIP@%$C_ZIP%g
s%@C_GZIP@%$C_GZIP%g s%@C_GZIP@%$C_GZIP%g
s%@C_PERL@%$C_PERL%g s%@C_SGML2HTML@%$C_SGML2HTML%g
s%@C_SGML2TXT@%$C_SGML2TXT%g
s%@TARGET_DIR@%$TARGET_DIR%g s%@TARGET_DIR@%$TARGET_DIR%g
CEOF CEOF

View File

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(de-i4l-faq) AC_INIT(i4lfaq.sgml)
dnl Set default installation directory dnl Set default installation directory
if test -r ../.config ; then if test -r ../.config ; then
@ -13,7 +13,8 @@ dnl Checks for programs.
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PATH_PROG(C_ZIP, zip,,$PATH:/usr/sbin:/sbin:/usr/local/bin) AC_PATH_PROG(C_ZIP, zip,,$PATH:/usr/sbin:/sbin:/usr/local/bin)
AC_PATH_PROG(C_GZIP, gzip,,$PATH:/usr/sbin:/sbin:/usr/local/bin) AC_PATH_PROG(C_GZIP, gzip,,$PATH:/usr/sbin:/sbin:/usr/local/bin)
AC_PATH_PROG(C_PERL, perl,,$PATH:/usr/sbin:/sbin:/usr/local/bin) AC_PATH_PROG(C_SGML2HTML, sgml2html,,$PATH:/usr/sbin:/sbin:/usr/local/bin)
AC_PATH_PROG(C_SGML2TXT, sgml2txt,,$PATH:/usr/sbin:/sbin:/usr/local/bin)
dnl Check where to install. dnl Check where to install.
AC_ARG_WITH(dest,[ --with-dest=DIR set installation directory], \ AC_ARG_WITH(dest,[ --with-dest=DIR set installation directory], \