]> granicus.if.org Git - fcron/commitdiff
more portable way to generate the man pages from docbook files
authorthib <thib>
Thu, 3 Jan 2002 22:37:18 +0000 (22:37 +0000)
committerthib <thib>
Thu, 3 Jan 2002 22:37:18 +0000 (22:37 +0000)
configure.in
doc/Makefile.in

index 31bf20b9c96f5db1017c8083d2e95da585511fa5..94e95d23028651d5d156feda04caf87fd7c613ee 100644 (file)
@@ -1,5 +1,10 @@
 nl Process this file with autoconf to produce a configure script.
 
+
+dnl ---------------------------------------------------------------------
+dnl Initial settings
+dnl ---------------------------------------------------------------------
+
 AC_INIT(allow.c)
 if test \( "$prefix" = "NONE" \) -o \( -z "$prefix" \); then
   prefix="/usr"
@@ -15,6 +20,11 @@ AC_DEFINE_UNQUOTED(VERSION_QUOTED, $vers_quoted)
 VERSION="$vers"
 AC_SUBST(VERSION)
 
+
+dnl ---------------------------------------------------------------------
+dnl Check for programs, header files, types, etc (autoconf builtins)
+dnl ---------------------------------------------------------------------
+
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
@@ -73,7 +83,14 @@ AC_CHECK_FUNCS(flock lockf)
 AC_CHECK_FUNCS(seteuid, [seteuid=1], [seteuid=0])
 AC_CHECK_FUNCS(setegid, [setegid=1], [setegid=0])
 
-dnl Checks for programs.
+
+dnl ---------------------------------------------------------------------
+dnl Check for fcron more specific stuffs (paths, progs, ...)
+dnl ---------------------------------------------------------------------
+
+
+dnl ---------------------------------------------------------------------
+dnl Programs ...
 
 AC_ARG_WITH(sendmail,
 [  --with-sendmail=PATH        Path to sendmail.],
@@ -186,6 +203,10 @@ Cannot determine path to vi: try option --with-editor=PATH])
   fi ]
 )
 
+
+dnl ---------------------------------------------------------------------
+dnl Paths ...
+
 AC_MSG_CHECKING(location of etc directory)
 AC_ARG_WITH(etcdir,
 [  --with-etcdir=PATH  Directory containing permission files (default /etc).],
@@ -354,47 +375,6 @@ AC_DEFINE_UNQUOTED(PROC, "$proc")
 AC_SUBST(PROC)
 fi
 
-AC_ARG_WITH(debug,
-[  --with-debug=CFLAGS Use default debug flags or CFLAGS if given to compile fcron in debug mode.],
-[ case "$withval" in
-  no)
-    cflags="-O2 -Wall"
-    debug="0"
-    ;;
-  yes)
-    cflags="-DDEBUG -g -Wall -DFOREGROUND -DMALLOC_CHECK_=2 -Wpointer-arith -Wstrict-prototypes"
-    debug="1"
-    ;;
-  *)
-    cflags="$withval"
-    debug="1"
-    ;;
-  esac ],
-    cflags="-O2 -Wall"
-    debug="0"
-)
-DEBUG=$debug
-AC_SUBST(DEBUG)
-
-
-AC_ARG_WITH(cflags,
-[  --with-cflags=CFLAGS        Use CFLAGS flags to compile fcron.],
-[ case "$withval" in
-  no)
-    AC_MSG_ERROR(Need an explicit value for --with-cflags.)
-    ;;
-  yes)
-    AC_MSG_ERROR(Need an explicit value for --with-cflags.)
-    ;;
-  *)
-    cflags="$withval"
-    ;;
-  esac ],
-)
-CFLAGS=$cflags
-AC_DEFINE_UNQUOTED(CFLAGS, "$cflags")
-
-
 AC_MSG_CHECKING(location of doc directory)
 AC_ARG_WITH(docdir,
 [  --with-docdir=PATH  Directory containing documentation.],
@@ -449,6 +429,51 @@ if test "$mandir" = "\${prefix}/man"; then
   AC_DEFINE_UNQUOTED(mandir, "$mandir")
 fi
 
+
+dnl ---------------------------------------------------------------------
+dnl Misc ...
+
+AC_ARG_WITH(debug,
+[  --with-debug=CFLAGS Use default debug flags or CFLAGS if given to compile fcron in debug mode.],
+[ case "$withval" in
+  no)
+    cflags="-O2 -Wall"
+    debug="0"
+    ;;
+  yes)
+    cflags="-DDEBUG -g -Wall -DFOREGROUND -DMALLOC_CHECK_=2 -Wpointer-arith -Wstrict-prototypes"
+    debug="1"
+    ;;
+  *)
+    cflags="$withval"
+    debug="1"
+    ;;
+  esac ],
+    cflags="-O2 -Wall"
+    debug="0"
+)
+DEBUG=$debug
+AC_SUBST(DEBUG)
+
+
+AC_ARG_WITH(cflags,
+[  --with-cflags=CFLAGS        Use CFLAGS flags to compile fcron.],
+[ case "$withval" in
+  no)
+    AC_MSG_ERROR(Need an explicit value for --with-cflags.)
+    ;;
+  yes)
+    AC_MSG_ERROR(Need an explicit value for --with-cflags.)
+    ;;
+  *)
+    cflags="$withval"
+    ;;
+  esac ],
+)
+CFLAGS=$cflags
+AC_DEFINE_UNQUOTED(CFLAGS, "$cflags")
+
+
 AC_MSG_CHECKING(automatic answer to make install's questions)
 AC_ARG_WITH(answer-all,
 [  --with-answer-all=[yes|no]  Answer the argument to every make install's questions.],
@@ -473,6 +498,37 @@ AC_DEFINE_UNQUOTED(ANSWERALL, "$answerall")
 AC_SUBST(ANSWERALL)
 
 
+AC_MSG_CHECKING(if pam should be used if available)
+AC_ARG_WITH(pam,
+[ --with-pam=[yes|no]  Use (or not) PAM if available (default: yes).],
+[ case "$withval" in
+  no)
+    usepam=0
+    AC_MSG_RESULT(no)
+    ;;
+  yes)
+    AC_MSG_RESULT(yes)
+    AC_CHECK_LIB(pam, pam_acct_mgmt)
+    ;;
+  *)
+    AC_MSG_ERROR(Must be set to either "yes" or "no".)
+    ;;
+  esac ],
+  AC_MSG_RESULT(yes)
+  AC_CHECK_LIB(pam, pam_acct_mgmt)
+)
+if echo "$LIBS" | grep -e "-lpam" > /dev/null ; then
+  usepam=1
+else
+  usepam=0
+fi
+USEPAM="$usepam"
+AC_SUBST(USEPAM)
+
+
+dnl ---------------------------------------------------------------------
+dnl Users and groups ...
+
 AC_MSG_CHECKING(root's username)
 AC_ARG_WITH(rootname,
 [ --with-rootname=USERNAME     Root's username (default root) ],
@@ -652,41 +708,43 @@ if test \( $seteuid -eq 1 \) -a \( $setegid -eq 1 \) ; then
 fi
 
 
-AC_MSG_CHECKING(if pam should be used if available)
-AC_ARG_WITH(pam,
-[ --with-pam=[yes|no]  Use (or not) PAM if available (default: yes).],
+dnl ---------------------------------------------------------------------
+dnl DocBook
+
+AC_PATH_PROG(JADE,openjade)
+if test -z "$JADE"; then
+       AC_PATH_PROG(JADE,jade)
+fi
+
+AC_PATH_PROG(NSGMLS, nsgmls)
+AC_PATH_PROG(SGMLSPL, sgmlspl)
+
+
+DB2MAN_SPEC="/usr/share/sgml/docbook/utils-0.6.9/helpers/docbook2man-spec.pl"
+
+AC_MSG_CHECKING(Looking for docbook2man-spec file)
+AC_ARG_WITH(db2man-spec,
+[ --with-db2man-spec=PATH      set the PATH to docbook2man-spec file.],
 [ case "$withval" in
-  no)
-    usepam=0
-    AC_MSG_RESULT(no)
+  no) 
+    DB2MAN_SPEC=""
+    AC_MSG_RESULT(none)
     ;;
   yes)
-    AC_MSG_RESULT(yes)
-    AC_CHECK_LIB(pam, pam_acct_mgmt)
+    AC_MSG_ERROR(Must be set to PATH or "no".)
     ;;
   *)
-    AC_MSG_ERROR(Must be set to either "yes" or "no".)
+    if ! test -f "$withval"; then
+      AC_MSG_ERROR($withval is not a file.)
+    fi
+    DB2MAN_SPEC="$withval"
+    AC_MSG_RESULT($withval)
     ;;
   esac ],
-  AC_MSG_RESULT(yes)
-  AC_CHECK_LIB(pam, pam_acct_mgmt)
+  AC_MSG_RESULT(default)
 )
-if echo "$LIBS" | grep -e "-lpam" > /dev/null ; then
-  usepam=1
-else
-  usepam=0
-fi
-USEPAM="$usepam"
-AC_SUBST(USEPAM)
-
+AC_SUBST(DB2MAN_SPEC)
 
-dnl DocBook
-
-AC_PATH_PROG(JADE,openjade)
-
-if test -z "$JADE"; then
-       AC_PATH_PROG(JADE,jade)
-fi
 
 DSSSL_DIR="/usr/share/sgml/docbook/dsssl-stylesheets-1.72/"
 
@@ -696,18 +754,29 @@ AC_ARG_WITH(dsssl-dir,
 [ case "$withval" in
   no) 
     DSSSL_DIR=""
+    AC_MSG_RESULT(none)
     ;;
   yes)
     AC_MSG_ERROR(Must be set to DIR or "no".)
     ;;
   *)
+    if ! test -f "$withval/html/docbook.dsl"; then
+      AC_MSG_ERROR($withval/html/docbook.dsl does not exist.)
+    fi
     DSSSL_DIR="$withval"
+    AC_MSG_RESULT($withval)
     ;;
   esac ],
+  AC_MSG_RESULT(default)
 )
 AC_SUBST(DSSSL_DIR)
 
 
+dnl ---------------------------------------------------------------------
+dnl Final settings
+dnl ---------------------------------------------------------------------
+
+
 dnl We set exec_prefix to $prefix (also done in Makefile)
 exec_prefix=$prefix
 BINDIREX=`eval echo $bindir`
@@ -718,5 +787,3 @@ AC_SUBST(BINDIREX)
 AC_SUBST(SBINDIREX)
 
 AC_OUTPUT(Makefile doc/Makefile doc/stylesheets/fcron-doc.dsl)
-
-
index cbe2dde5324f8ea08164ffbcea3511dea2511a69..4b080cd751430d8d97045d8d5b1a13f514db38bf 100644 (file)
@@ -4,7 +4,7 @@
 
 # @configure_input@
 
-# $Id: Makefile.in,v 1.3 2002-01-03 14:44:36 thib Exp $
+# $Id: Makefile.in,v 1.4 2002-01-03 22:39:50 thib Exp $
 
 # The following should not be edited manually (use configure options)
 # If you must do it, BEWARE : some of the following is also defined
@@ -20,8 +20,13 @@ DESTDOC              = @DOCDIR@
 
 INSTALL                = @INSTALL@
 JADE           = @JADE@
+NSGMLS         = @NSGMLS@
+SGMLSPL                = @SGMLSPL@
+DB2MAN_SPEC    = @DB2MAN_SPEC@
+
 ROOTNAME       = @ROOTNAME@
 ROOTGROUP      = @ROOTGROUP@
+
 ANSWERALL      = @ANSWERALL@
 
 ####################################
@@ -43,6 +48,12 @@ all: doc
 doc: HTML/index.html
 
 mandoc: HTML/index.html
+       @(if test \( ! -f $(DB2MAN_SPEC) \) -o \( ! -x $(NSGMLS) \) -o \( ! -x $(SGMLSPL) \); then \
+          echo "ERROR: cannot generate man pages." ; \
+          echo "       Please check if nsgmls, sgmlspl are installed, and " ; \
+          echo "       if configure's option --with-db2man-spec is correctly set." ; \
+          exit 1 ; \
+       fi)
        @(echo ; echo "Building man pages ..."; echo )
        cp -f bitstring.3 man/
        @(for i in $(MANPAGES); do \
@@ -51,10 +62,11 @@ mandoc: HTML/index.html
                   <!ENTITY % decl SYSTEM "fcron-doc.mod"> \
                   %decl;]>' > _tmp_ ; \
           echo "&$$i;" >> _tmp_ ; \
-          jw -f docbook -b man -o man _tmp_ 2> /dev/null; \
+          $(NSGMLS) _tmp_ 2> /dev/null | $(SGMLSPL) $(DB2MAN_SPEC) 2>&1 > /dev/null ; \
          rm -f _tmp_ ; \
+         mv `basename $$i .sgml` man/ ; \
           done)
-       rm -f man/manpage.links man/manpage.refs
+       rm -f manpage.links manpage.refs
 
 
 txtdoc: HTML/index.html