diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | acinclude.m4 | 112 | ||||
-rw-r--r-- | cipher/ChangeLog | 4 | ||||
-rw-r--r-- | cipher/md.c | 13 | ||||
-rw-r--r-- | configure.in | 7 | ||||
-rw-r--r-- | doc/Makefile.am | 33 | ||||
-rw-r--r-- | doc/reference.sgml | 33 | ||||
-rw-r--r-- | doc/version.sgml.in | 1 | ||||
-rwxr-xr-x | scripts/db2html.in | 151 |
9 files changed, 337 insertions, 21 deletions
@@ -1,3 +1,7 @@ +Mon Mar 13 19:22:46 CET 2000 Werner Koch <wk@openit.de> + + * configure.in: Now uses the Docbook M$s from GPH. + Mon Jan 31 17:46:35 CET 2000 Werner Koch <wk@> * Makefile.am: Re-added tools. By Rémi. diff --git a/acinclude.m4 b/acinclude.m4 index 4a8f0a2b..20c92be5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -663,4 +663,116 @@ if test $gnupg_cv_mkdir_takes_one_arg = yes ; then fi ]) + +dnl GPH_PROG_DOCBOOK() +dnl Check whether we have the needed Docbook environment +dnl and issue a warning if this is not the case. +dnl +dnl This test defines these variables for substitution: +dnl DB2HTML - command used to convert Docbook to HTML +dnl DB2TEX - command used to convert Docbook to TeX +dnl DB2MAN - command used to convert Docbook to man pages +dnl JADE - command to invoke jade +dnl JADETEX - command to invoke jadetex +dnl DSL_FOR_HTML - the stylesheet used to for the Docbook->HTML conversion +dnl The following make conditionals are defined +dnl HAVE_DB2MAN - defined when db2man is available +dnl HAVE_DB2TEX - defined when db2tex is available +dnl HAVE_DB2HTML - defined when db2html is available +dnl HAVE_DOCBOOK - defined when the entire Docbook environment is present +dnl HAVE_JADE - defined when jade is installed +dnl HAVE_JADETEX - defined when jadetex is installed +dnl +dnl (wk 2000-02-17) +dnl +AC_DEFUN(GPH_PROG_DOCBOOK, + [ AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl + all=yes + AC_PATH_PROG(DB2MAN, docbook-to-man, no) + test "$DB2MAN" = no && all=no + AM_CONDITIONAL(HAVE_DB2MAN, test "$DB2MAN" != no ) + + AC_PATH_PROG(JADE, jade, no) + test "$JADE" = no && all=no + AM_CONDITIONAL(HAVE_JADE, test "$JADE" != no ) + + AC_PATH_PROG(JADETEX, jadetex, no) + test "$JADETEX" = no && all=no + AM_CONDITIONAL(HAVE_JADETEX, test "$JADETEX" != no ) + + stylesheet_dirs=' +/usr/local/lib/dsssl/stylesheets/docbook +/usr/local/share/dsssl/stylesheets/docbook +/usr/local/lib/sgml/stylesheet/dsssl/docbook/nwalsh +/usr/local/share/sgml/stylesheet/dsssl/docbook/nwalsh +/usr/lib/dsssl/stylesheets/docbook +/usr/share/dsssl/stylesheets/docbook +/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh +/usr/share/sgml/stylesheet/dsssl/docbook/nwalsh +' + + AC_MSG_CHECKING(for TeX stylesheet) + dsl=none + for d in ${stylesheet_dirs}; do + file=${d}/print/docbook.dsl + if test -f $file; then + dsl=$file + break + fi + done + AC_MSG_RESULT([$dsl]) + okay=no + if test $dsl = none ; then + DB2TEX="$missing_dir/missing db2tex" + all=no + else + DB2TEX="$JADE -t tex -i tex -d $dsl" + okay=yes + fi + AC_SUBST(DB2TEX) + AM_CONDITIONAL(HAVE_DB2TEX, test $okay = yes ) + + if ( $ac_aux_dir/db2html.in --version) < /dev/null > /dev/null 2>&1; then + : + else + AC_ERROR([needed $ac_aux_dir/db2html.in not found]) + fi + + AC_MSG_CHECKING(for HTML stylesheet) + DSL_FOR_HTML="none" + for d in ${stylesheet_dirs}; do + file=${d}/html/docbook.dsl + if test -f $file; then + DSL_FOR_HTML=$file + break + fi + done + AC_MSG_RESULT([$DSL_FOR_HTML]) + okay=no + if test $DSL_FOR_HTML = none ; then + DB2HTML="$missing_dir/missing db2html" + all=no + else + DB2HTML="`cd $ac_aux_dir && pwd`/db2html --copyfiles" + okay=yes + fi + AC_SUBST(DB2HTML) + AC_SUBST(DSL_FOR_HTML) + AM_CONDITIONAL(HAVE_DB2HTML, test $okay = yes ) + + AM_CONDITIONAL(HAVE_DOCBOOK, test "$all" != yes ) + if test $all = no ; then + AC_MSG_WARN([[ +*** +*** It seems that the Docbook environment is not installed as required. +*** We will try to build everything, but if you either touch some files +*** or use a bogus make tool, you may run into problems. +*** Docbook is normally only needed to build the documentation. +***]]) + fi + ]) + + + + dnl *-*wedit:notab*-* Please keep this as the last line. diff --git a/cipher/ChangeLog b/cipher/ChangeLog index c0657d72..a8118970 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 13 19:22:46 CET 2000 Werner Koch <wk@openit.de> + + * md.c (gcry_md_hash_buffer): Add support for the other algorithms. + Mon Jan 31 16:37:34 CET 2000 Werner Koch <wk@gnupg.de> * genprime.c (generate_elg_prime): Fixed returned factors which never diff --git a/cipher/md.c b/cipher/md.c index bc0a6c30..680558db 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -596,15 +596,22 @@ gcry_md_get( GCRY_MD_HD hd, int algo, byte *buffer, int buflen ) * Shortcut function to hash a buffer with a given algo. The only supported * algorithm is RIPE-MD. The supplied digest buffer must be large enough * to store the resulting hash. No error is returned, the function will - * abort on an invalite algo. DISABLED_ALGOS are ignored here. + * abort on an invalid algo. DISABLED_ALGOS are ignored here. */ void gcry_md_hash_buffer( int algo, char *digest, const char *buffer, size_t length) { if( algo == GCRY_MD_RMD160 ) rmd160_hash_buffer( digest, buffer, length ); - else - BUG(); + else { /* for the others we do not have a fast function, so + * we use the normal functions to do it */ + GCRY_MD_HD h = md_open( algo, 0 ); + if( !h ) + BUG(); /* algo not available */ + md_write( h, (byte*)buffer, length ); + md_final( h ); + memcpy( digest, md_read( h, algo ), md_digest_length( algo ) ); + } } static int diff --git a/configure.in b/configure.in index ac926d64..fddb93d2 100644 --- a/configure.in +++ b/configure.in @@ -164,8 +164,7 @@ AC_PROG_CPP AC_ISC_POSIX AC_PROG_INSTALL AC_PROG_AWK -AC_CHECK_PROG(DOCBOOK_TO_MAN, docbook-to-man, yes, no) -AM_CONDITIONAL(HAVE_DOCBOOK_TO_MAN, test "$ac_cv_prog_DOCBOOK_TO_MAN" = yes) +GPH_PROG_DOCBOOK dnl @@ -687,6 +686,7 @@ GNUPG_FIX_HDR_VERSION(gcrypt/gcrypt.h, GCRYPT_VERSION) AC_OUTPUT_COMMANDS([ +chmod +x scripts/db2html chmod +x gcrypt/gcrypt-config cat >gnupg-defs.tmp <<G10EOF /* Generated automatically by configure */ @@ -719,6 +719,7 @@ DATADIRNAME=$DATADIRNAME AC_OUTPUT([ Makefile +scripts/db2html intl/Makefile po/Makefile.in jnlib/Makefile @@ -727,7 +728,7 @@ mpi/Makefile cipher/Makefile g10/Makefile doc/Makefile -doc/gph/Makefile +doc/version.sgml tools/Makefile zlib/Makefile checks/Makefile diff --git a/doc/Makefile.am b/doc/Makefile.am index 04ad0a4c..995b0b3d 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,33 +1,40 @@ ## Process this file with automake to create Makefile.in -EXTRA_DIST = DETAILS gpg.sgml gpg.1 FAQ HACKING OpenPGP +EXTRA_DIST = DETAILS gpg.sgml gpg.1 FAQ HACKING OpenPGP \ + version.sgml.in man_MANS = gpg.1 +pkgdata_DATA = gcryptref.html gcryptref.ps -gcryptref.dvi : gcryptref.sgml +BUILT_SOURCES = version.sgml gcryptref.html gcryptref.ps -gcryptref.texi : gcryptref.sgml -gcryptref.xml : gcryptref.sgml +CLEANFILES = gcryptref.aux gcryptref.log gcryptref.tex gcryptref.dvi -%.ps: %.dvi - dvips -o $@ $< - +gcryptref.sgml : version.sgml -if MAINTAINER_MODE +if HAVE_DB2MAN %.1 : %.sgml - docbook-to-man $< >$@ + $(DB2MAN) $< >$@ +endif -%.texi : %.xml - docbook2texi $< >$@ +if HAVE_DB2TEX +%.ps : %.dvi + dvips -o $@ $< -%.xml : %.sgml - sgml2xml -x lower $< >$@ +%.tex : %.sgml + $(DB2TEX) -V generate-book-toc $< > $@ +%.dvi : %.tex + $(JADETEX) $< endif +if HAVE_DB2HTML +%.html : %.sgml + $(DB2HTML) --nosplit $< +endif diff --git a/doc/reference.sgml b/doc/reference.sgml index abc3efb2..bf9d5092 100644 --- a/doc/reference.sgml +++ b/doc/reference.sgml @@ -18,7 +18,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA --> -<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ +<!--entity genindex system "gcryptref.toc-idx"--> +<!entity packageversion system "version.sgml"> <!entity libgcrypt "Libgcrypt"> <!entity sexp "S-Exp"> <!entity cipherref system "gcryptref-cipher.sgml"> @@ -27,6 +29,33 @@ <!entity miscref system "gcryptref-misc.sgml"> ]> +<book> +<bookinfo> +<title>The &libgcrypt; Reference Manual</title> +<subtitle>Version &packageversion;</subtitle> +<date> +2000-03-13 +</date> +<copyright> +<year>2000</year> +<holder>Free Software Foundation, Inc.</holder> +</copyright> +<abstract> +<para> +Please direct questions, bug reports, or suggestions concerning +this manual to the mailing list <email>gnupg-doc@gnupg.org</email>. +</para> + +<para> +This manual may be redistributed under the terms of the +<ulink url="http://www.gnu.org/copyleft/gpl.html"><phrase>GNU +General Public License</phrase></ulink>. +</para> +</abstract> +</bookinfo> + + + <reference> <title>&libgcrypt; Reference Pages</title> @@ -37,7 +66,7 @@ <!-- Hash Functions --> &digestref; -<!-- ublic Key Functions --> +<!-- Public Key Functions --> &pubkeyref; <!-- Miscellaneous Functions --> diff --git a/doc/version.sgml.in b/doc/version.sgml.in new file mode 100644 index 00000000..d78bda93 --- /dev/null +++ b/doc/version.sgml.in @@ -0,0 +1 @@ +@VERSION@ diff --git a/scripts/db2html.in b/scripts/db2html.in new file mode 100755 index 00000000..ba35afbc --- /dev/null +++ b/scripts/db2html.in @@ -0,0 +1,151 @@ +#!/bin/sh +# db2html.in - Docbook to HTML rendering (wk 2000-02-15) +# +# Copyright (C) 2000 Free Software Foundation +# +# This is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + +nosplit=no +copyfiles=no +stylesheet=@DSL_FOR_HTML@ +JADE=@JADE@ + +usage () { + echo 'usage: db2html [--nosplit] [--copyfiles] filename' >&2 + exit 1 +} + + +while test "`echo $1 | head -c1`" = "-"; do + case $1 in + --version) + cat <<EOF +db2html 0.5 +Copyright (C) 2000 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +stylesteet: $stylesheet +EOF + exit 0 + ;; + --help|-h|-help) + usage + ;; + --nosplit) + nosplit=yes + ;; + --copyfiles) + copyfiles=yes + ;; + --) + shift + break + ;; + *) + echo "invalid option $1" >&2 + exit 1 + ;; + esac + shift +done + +if test $# = 1; then + input="$1" +else + usage +fi + +# grep the document type +doctype=`grep -i '\<doctype' $input|awk 'NR==1 {print $2}'| tr '[A-Z]' '[a-z]'` +if test -z $doctype; then + doctype=book + echo "no DOCTYPE found - assuming '$doctype'" >&2 +else + echo "DOCTYPE is '$doctype'" >&2 +fi + +output="`basename $input| sed 's/\.sgml$//'`.html" + + +if test $nosplit = yes; then + echo "running jade on '$input' ..." >&2 + $JADE -d $stylesheet -t sgml -i html -V nochunks $input > $output + echo "$output created" + exit 0 +fi + +if test -d html ; then + : +else + if mkdir html; then + echo "'html' directory created" >&2 + else + echo "failed to create 'html' directory" >&2 + exit 1 + fi +fi + +outputdir="html/`basename $input| sed 's/\.sgml$//'`" + +if test -d $outputdir ; then + : +else + if mkdir $outputdir; then + echo "'$outputdir' created" >&2 + else + echo "failed to create '$outputdir'" >&2 + exit 1 + fi +fi +echo "creating html pages in '$outputdir' ..." >&2 +if test "$input" = "`basename $input`"; then + inp="../../$input" +else + inp="$input" +fi +echo "running jade on '$inp' ..." >&2 +(cd $outputdir && $JADE -t sgml -i html -d $stylesheet $inp ) +echo "html version in '$outputdir' created" >&2 + +# break out all filerefs and copy them to the outputdirectory +# fixme: handling of path components is wrong +if test $copyfiles = yes; then + echo "looking for filerefs ..." >&2 + for file in `nsgmls -i html $input \ + | awk '/^AFILEREF[ \t]+CDATA/ {print $3}'`; do + d=$outputdir/`basename $file` + if cat $file > $outputdir/`basename $file` ; then + echo " $file -> $d" >&2 + fi + done +fi + +mainfile=`ls $outputdir/${doctype}* | head -1` + +cat > $output <<EOF +<html><title>$output</title> +<body> + +<a href="$mainfile">$mainfile</a> + +</body> +</html> +EOF + +echo "$output created with link to '$mainfile'" >&2 + +exit 0 + |