]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: 471377
authorAndrew G. Morgan <morgan@kernel.org>
Wed, 29 May 2002 04:14:10 +0000 (04:14 +0000)
committerAndrew G. Morgan <morgan@kernel.org>
Wed, 29 May 2002 04:14:10 +0000 (04:14 +0000)
Purpose of commit: new feature

Commit summary:
---------------
build pdf files when you type 'make pdf' in the doc/ directory.

CHANGELOG
Make.Rules.in
configure
configure.in
doc/Makefile
doc/pdf/.cvsignore [new file with mode: 0644]
doc/pdf/README [new file with mode: 0644]

index 3180a7dc22881740ac86fdf61dde2cbb3860ba1a..c3c2a406ccc3c88f5666327d7357c27348b98291 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -55,6 +55,8 @@ bug report - outstanding bugs are listed here:
 0.76: please submit patches for this section with actual code/doc
       patches!
 
+* add support for building pdf files from the documentation - request
+  from 'lolive' (Bug 471377 - agmorgan).
 * documented the equivalent '[..]' expressions for "required"
   etc. Request from Ross Patterson (Bug 529078 - agmorgan).
 * '[...]' parsing: document it and also fix it to support '\]' escape
index b36f36c4f80fa27ea40eac7f8635a5d9f28b73f0..894ea4acf54a03b59bf8b7d20d1da509eef7f077 100644 (file)
@@ -55,6 +55,7 @@ HAVE_LIBPWDB=@HAVE_LIBPWDB@
 # documentation support
 HAVE_SGML2TXT=@HAVE_SGML2TXT@
 HAVE_SGML2HTML=@HAVE_SGML2HTML@
+HAVE_PS2PDF=@HAVE_PS2PDF@
 PSER=@PSER@
 DOCDIR=@DOCDIR@
 MANDIR=@MANDIR@
index 19ef1c2094bdb58145cdce21c893dba7e0633d6d..776fe27c6e4d641768d4d65923101ee039ee9cb7 100755 (executable)
--- a/configure
+++ b/configure
@@ -3305,11 +3305,41 @@ if test $HAVE_SGML2LATEX = "yes" ; then
   else
     PSER="sgml2latex -p"
   fi
+  # Extract the first word of "ps2pdf", so it can be a program name with args.
+set dummy ps2pdf; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3312: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_HAVE_PS2PDF'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$HAVE_PS2PDF"; then
+  ac_cv_prog_HAVE_PS2PDF="$HAVE_PS2PDF" # Let the user override the test.
+else
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_HAVE_PS2PDF="yes"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_HAVE_PS2PDF" && ac_cv_prog_HAVE_PS2PDF="no"
+fi
+fi
+HAVE_PS2PDF="$ac_cv_prog_HAVE_PS2PDF"
+if test -n "$HAVE_PS2PDF"; then
+  echo "$ac_t""$HAVE_PS2PDF" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
 else
   # Extract the first word of "sgml2ps", so it can be a program name with args.
 set dummy sgml2ps; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3313: checking for $ac_word" >&5
+echo "configure:3343: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_HAVE_SGML2PS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3342,6 +3372,7 @@ fi
 fi
 
 
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -3537,8 +3568,10 @@ s%@LIBOBJS@%$LIBOBJS%g
 s%@HAVE_SGML2TXT@%$HAVE_SGML2TXT%g
 s%@HAVE_SGML2HTML@%$HAVE_SGML2HTML%g
 s%@HAVE_SGML2LATEX@%$HAVE_SGML2LATEX%g
+s%@HAVE_PS2PDF@%$HAVE_PS2PDF%g
 s%@HAVE_SGML2PS@%$HAVE_SGML2PS%g
 s%@PSER@%$PSER%g
+s%@PS2PDF@%$PS2PDF%g
 
 CEOF
 EOF
index 543d975c7fa73f47c801d68da470c474770fb17b..f4048fef5b158d632e346ed5d3229cfba3a57da8 100644 (file)
@@ -412,6 +412,7 @@ if test $HAVE_SGML2LATEX = "yes" ; then
   else
     PSER="sgml2latex -p"
   fi
+  AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, yes, no)
 else
   AC_CHECK_PROG(HAVE_SGML2PS, sgml2ps, yes, no)
   if test $HAVE_SGML2PS = yes ; then
@@ -419,6 +420,7 @@ else
   fi
 fi
 AC_SUBST(PSER)
+AC_SUBST(PS2PDF)
 
 dnl Files to be created from when we run configure
 AC_OUTPUT(Make.Rules)
index e817f6806e11ec6e19aab68a75e89ada07127b5a..0d9adfa64cafb70f4cd2ff4a5a09d2574c22b792 100644 (file)
@@ -11,6 +11,7 @@ FSRCS=pam.sgml pam_appl.sgml pam_modules.sgml
 TEXTS=txts/pam.txt txts/pam_appl.txt txts/pam_modules.txt
 HTMLS=html/pam.html html/pam_appl.html html/pam_modules.html
 PSFILES=ps/pam.ps ps/pam_appl.ps ps/pam_modules.ps
+PDFFILES=pdf/pam.pdf ps/pam_appl.pdf ps/pam_modules.pdf
 
 MODULES=$(shell ls modules/*.sgml)
 
@@ -20,6 +21,10 @@ dummy:
        @echo "Making the documentation..."
        @$(MAKE) all
 
+# note, at this time we don't include pdf files by default, but you
+# can type make pdf in this directory and see what happens in the pdf
+# subdirectory.
+
 all: htmls texts postscript
 
 htmls: $(HTMLS)
@@ -65,6 +70,19 @@ else
        @echo XXX - neither sgml2ps nor sgml2latex binaries are installed
 endif
 
+pdf: $(PDFFILES)
+
+$(PDFFILES) : $(PSFILES)
+ifeq ($(HAVE_PS2PDF),yes)
+       @for i in $(FILES) ; do \
+       if [ ! -f "pdf/$$i.pdf" ] || [ "ps/$$i.ps" -nt "ps/$$i.pdf" ]; then \
+               ps2pdf ps/$$i.ps pdf/$$i.pdf ; \
+       fi ; \
+       done
+else
+       @echo XXX - ps2pdf is not installed
+endif
+
 pam.sgml: pam_source.sgml MODULES-SGML CREDITS
        @sed -e '/^<!\-\- insert\-file MODULES\-SGML \-\->/r MODULES-SGML' pam_source.sgml | sed -e '/^<!\-\- insert\-file CREDITS \-\->/r CREDITS' > pam.sgml
 
@@ -107,6 +125,12 @@ ifneq ($(PSER),)
        for file in ps/*.ps; do \
          install -m 644 $$file $(FAKEROOT)$(DOCDIR)/ps  ; \
        done
+       ifeq ($(HAVE_PS2PDF),yes)
+               mkdir -p $(FAKEROOT)$(DOCDIR)/pdf
+               for file in pdf/*.pdf; do \
+                 install -m 644 $$file $(FAKEROOT)$(DOCDIR)/pdf  ; \
+               done
+       endif
 endif
 ifeq ($(HAVE_SGML2HTML),yes)
        mkdir -p $(FAKEROOT)$(DOCDIR)/html
@@ -135,6 +159,7 @@ clean:
        rm -f man/*~
        rm -f $(TEXTS)
        rm -f $(PSFILES) ps/missfont.log
+       rm -f pdf/*.pdf
        rm -f MODULES-SGML pam.sgml
        rm -f specs/draft-morgan-pam-current.txt
        $(MAKE) -C specs/formatter clean
diff --git a/doc/pdf/.cvsignore b/doc/pdf/.cvsignore
new file mode 100644 (file)
index 0000000..a136337
--- /dev/null
@@ -0,0 +1 @@
+*.pdf
diff --git a/doc/pdf/README b/doc/pdf/README
new file mode 100644 (file)
index 0000000..82efcd4
--- /dev/null
@@ -0,0 +1,3 @@
+$Id$
+
+a directory for PDF versions of the documentation