groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 01/01: Rename mode pdf to pdf2 (using ps2pdf) and add new mode p


From: Bernd Warken
Subject: [groff] 01/01: Rename mode pdf to pdf2 (using ps2pdf) and add new mode pdf (using groff -Tpdf). Move perl/* upwards and remove perl.
Date: Tue, 25 Feb 2014 16:00:13 +0000

bwarken pushed a commit to branch master
in repository groff.

commit fabbbb0e335801bc20f5c25fb0c448e23673721d
Author: Bernd Warken <address@hidden>
Date:   Tue Feb 25 16:59:42 2014 +0100

    Rename mode pdf to pdf2 (using ps2pdf) and add new mode pdf (using groff 
-Tpdf).  Move perl/* upwards and remove perl.
---
 contrib/groffer/ChangeLog               |   12 ++
 contrib/groffer/Makefile.sub            |   74 ++-------
 contrib/groffer/README                  |   19 +--
 contrib/groffer/README_PERL             |   51 ++++++
 contrib/groffer/{perl => }/func.pl      |    0
 contrib/groffer/{perl => }/groffer.man  |   46 +++++--
 contrib/groffer/{perl => }/groffer.pl   |  138 +++++++++-------
 contrib/groffer/{perl => }/man.pl       |    0
 contrib/groffer/perl/README_PERL        |  263 -------------------------------
 contrib/groffer/{perl => }/perl_test.pl |    0
 contrib/groffer/{perl => }/roff2.pl     |    0
 contrib/groffer/{perl => }/split_env.sh |    0
 contrib/groffer/version.sh              |    8 +-
 13 files changed, 200 insertions(+), 411 deletions(-)

diff --git a/contrib/groffer/ChangeLog b/contrib/groffer/ChangeLog
index ca89699..1757355 100644
--- a/contrib/groffer/ChangeLog
+++ b/contrib/groffer/ChangeLog
@@ -1,3 +1,15 @@
+2014-02-25  Bernd Warken  <address@hidden>
+
+       * version.sh: new version groffer 2.0.2
+       * perl/: Move all files to top directory and remove this
+       directory.
+       * Makefile.sub: Handle the deletion of perl/.
+       * groffer.pl: Rename traditional pdf mode with ps2pdf into pdf2.
+       Create a new mode pdf using groff -Tpdf.  New options: --pdf2,
+       --mode=pdf2.
+       * groffer.man: Document the renamed and new options.
+       * README, README_PERL: rewrite
+
 2013-12-23  Bernd Warken  <address@hidden>
 
        New version groffer-2.0.1
diff --git a/contrib/groffer/Makefile.sub b/contrib/groffer/Makefile.sub
index e937697..cdd1894 100644
--- a/contrib/groffer/Makefile.sub
+++ b/contrib/groffer/Makefile.sub
@@ -2,18 +2,18 @@
 
 # File position: <groff-source>/contrib/groffer/Makefile.sub
 
-# Copyright (C) 2001, 2002, 2005, 2006, 2009, 2011, 2013
+# Copyright (C) 2001, 2002, 2005, 2006, 2009, 2011, 2013-14
 #   Free Software Foundation, Inc.
 # Written by Werner Lemberg <address@hidden> and
 # Bernd Warken <address@hidden>.
 
-# Last update: 23 Dec 2013
+# Last update: 25 Feb 2014
 
 # This file is part of `groffer' which is part of `groff'.
 
 # `groff' 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 3 of the License, or
+# the Free Software Foundation, either version 2 of the License, or
 # (at your option) any later version.
 
 # `groff' is distributed in the hope that it will be useful, but
@@ -47,31 +47,19 @@ RM=rm -f
 
 all: groffer
 
-GROFFER_PERL=$(srcdir)/perl/func.pl \
-             $(srcdir)/perl/man.pl \
-             $(srcdir)/perl/perl_test.pl \
-             $(srcdir)/perl/split_env.sh
-# GROFFER_SHELL=$(srcdir)/shell/groffer2.sh
+GROFFER_PERL=$(srcdir)/func.pl \
+             $(srcdir)/man.pl \
+             $(srcdir)/perl_test.pl \
+             $(srcdir)/split_env.sh
 GROFFER_REST=$(srcdir)/roff2.man \
              $(srcdir)/version.sh \
-             $(srcdir)/perl/groffer.man \
-             $(srcdir)/perl/groffer.pl \
-             $(srcdir)/perl/roff2.pl
-
-#             $(srcdir)/shell/roff2.sh \
-#             $(srcdir)/shell/groffer.man \
-#             $(srcdir)/shell/groffer.sh
-
-GROFFER_PERL_=`echo $(GROFFER_PERL) | sed 's|$(srcdir)/perl/||g'`
-
-# GROFFER_SHELL_=`echo $(GROFFER_SHELL) | sed 's|$(srcdir)/shell||g'`
-
-# TODO: Add perl check to configure script.
-# groffer: $(GROFFER_PERL) $(GROFFER_SHELL) \
+             $(srcdir)/groffer.man \
+             $(srcdir)/groffer.pl \
+             $(srcdir)/roff2.pl
 
 groffer: $(GROFFER_PERL) \
          $(GROFFER_REST) $(SH_DEPS_SED_SCRIPT)
-       if perl $(srcdir)/perl/perl_test.pl 2>&1 >/dev/null; then \
+       if perl $(srcdir)/perl_test.pl 2>&1 >/dev/null; then \
          : >HAVE_PERL; \
          echo "Using perl version of groffer."; \
          sed -f "$(SH_DEPS_SED_SCRIPT)" \
@@ -81,10 +69,9 @@ groffer: $(GROFFER_PERL) \
            -e "s|@groffer_dir@|$(DESTDIR)$(groffer_dir)|g" \
            -e "s|@VERSION@|$(version)$(revision)|g" \
            -e "$(SH_SCRIPT_SED_CMD)" \
-           $(srcdir)/perl/groffer.pl >$@; \
-         cp $(srcdir)/perl/groffer.man groffer.man; \
+           $(srcdir)/groffer.pl >$@; \
          for f in $(ROFF2PROGS); do \
-           cp $(srcdir)/perl/roff2.pl $$f; \
+           cp $(srcdir)/roff2.pl $$f; \
          done; \
        fi
        chmod +x $@
@@ -93,24 +80,6 @@ groffer: $(GROFFER_PERL) \
          | sed 's/@ROFF2MODE@/'"$$m"'/g' > roff2$${m}.man; \
        done
 
-#      else \
-#        : >HAVE_SHELL; \
-#        echo "Using shell version of groffer."; \
-#        sed -f "$(SH_DEPS_SED_SCRIPT)" \
-#            -e "s|@g@|$(g)|g" \
-#          -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
-#          -e "s|@libdir@|$(DESTDIR)$(libdir)|g" \
-#          -e "s|@groffer_dir@|$(DESTDIR)$(groffer_dir)|g" \
-#          -e "s|@VERSION@|$(version)$(revision)|g" \
-#          -e "$(SH_SCRIPT_SED_CMD)" \
-#            $(srcdir)/shell/groffer.sh >$@; \
-#        cp $(srcdir)/shell/groffer.man groffer.man; \
-#        for f in $(ROFF2PROGS); do \
-#          cp $(srcdir)/shell/roff2.sh $$f; \
-#        done; \
-
-
-
 install_data: groffer
        -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
        $(RM) $(DESTDIR)$(bindir)/groffer
@@ -124,24 +93,16 @@ install_data: groffer
        $(RM) $(DESTDIR)$(groffer_dir)/version.sh
        $(INSTALL_DATA) $(srcdir)/version.sh \
           $(DESTDIR)$(groffer_dir)/version.sh
-       for f in $(GROFFER_PERL_) $(GROFFER_SHELL_); do \
+       for f in $(GROFFER_PERL); do \
           $(RM) $(DESTDIR)$(groffer_dir)/$$f; \
         done
        if test -f HAVE_PERL; then \
-          for f in $(GROFFER_PERL_); do \
-            $(INSTALL_SCRIPT) $(srcdir)/perl/$$f \
+          for f in $(GROFFER_PERL); do \
+            $(INSTALL_SCRIPT) $(srcdir)/$$f \
               $(DESTDIR)$(groffer_dir)/$$f; \
           done; \
         fi;
 
-
-#       elif test -f HAVE_SHELL; then \
-#          for f in $(GROFFER_SHELL_); do \
-#            $(INSTALL_SCRIPT) $(srcdir)/shell/$$f \
-#              $(DESTDIR)$(groffer_dir)/$$f; \
-#          done; \
-
-
 uninstall_sub:
        $(RM) $(DESTDIR)$(bindir)/groffer
        for f in $(ROFF2PROGS); do $(RM) $(DESTDIR)$(bindir)/$$f; done
@@ -150,9 +111,6 @@ uninstall_sub:
         done
        -rmdir $(DESTDIR)$(libdir)/groff/groffer
 
-#      for f in $(GROFFER_PERL_) $(GROFFER_SHELL_) version.sh; do \
-
-
 ########################################################################
 # Emacs settings
 ########################################################################
diff --git a/contrib/groffer/README b/contrib/groffer/README
index fa24b99..80c2133 100644
--- a/contrib/groffer/README
+++ b/contrib/groffer/README
@@ -6,16 +6,6 @@ many operating systems.  All `roff' preprocessors, such as 
`chem' or
 `glilypond', are detected and executed automatically.
 
 
-Source files in this directory
-
-ChangeLog      information on all changements for groffer versions 1.*
-Makefile.sub   make file used by groff
-README         this file, general description of the program
-version.sh     information on version number and last update
-perl_test.pl   test whether perl has a suitable version
-perl/          subdirectory for the Perl version, see perl/README_PERL
-
-
 Input
 
 Input comes from either standard input or command line parameters that
@@ -59,9 +49,8 @@ The following displaying modes for the output are available:
   as by option `-V' and the `man' like `whatis' and `apropos'
   outputs.
 
-By default, the program tries to display a graphical device in X; on
-non-X text terminals, the `tty' text mode with a pager is tried by
-default.
+By default, the program creates a PDF file; on non-X text terminals,
+the `tty' text mode with a pager is tried by default.
 
 
 File access
@@ -95,7 +84,7 @@ package for more details on these mailing lists.
 
 Last update: 23 Dec 2013
 
-Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013
+Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013-14
   Free Software Foundation, Inc.
 Written by Bernd Warken <address@hidden>.
 
@@ -103,7 +92,7 @@ This file is part of `groffer', which is part of `groff'.
 
 `groff' 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 3 of the License, or
+the Free Software Foundation, either version 2 of the License, or
 (at your option) any later version.
 
 `groff' is distributed in the hope that it will be useful, but WITHOUT
diff --git a/contrib/groffer/README_PERL b/contrib/groffer/README_PERL
new file mode 100644
index 0000000..206030a
--- /dev/null
+++ b/contrib/groffer/README_PERL
@@ -0,0 +1,51 @@
+README_PERL
+
+`groffer' is written in the programming language Perl.
+
+
+Compatibility
+
+It was written in Linux, but due to Free Software under GNU it is
+available for each operating system.
+
+For testing, `groffer.pl' may be used directly without a Makefile.  By
+`make', this file will be transformed into the file `groffer' that will
+be installed.
+
+
+Temporary files
+
+The `file' and `so' temporaries are numbered and the files with .so
+request are copied.  All .so requests are handled; this is an
+extension to `man' that deals only with the first .so request.
+
+
+####### License
+
+Copyright (C) 2003, 2004, 2005, 2006, 2009, 2014
+  Free Software Foundation, Inc.
+Written by Bernd Warken <address@hidden>.
+
+This file is part of `groffer', which is part of `groff'.
+
+`groff' 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.
+
+`groff' 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, see <http://www.gnu.org/licenses/>.
+
+Last update: 25 Feb 2014
+
+
+####### Emacs settings
+
+Local Variables:
+mode: text
+End:
diff --git a/contrib/groffer/perl/func.pl b/contrib/groffer/func.pl
similarity index 100%
rename from contrib/groffer/perl/func.pl
rename to contrib/groffer/func.pl
diff --git a/contrib/groffer/perl/groffer.man b/contrib/groffer/groffer.man
similarity index 99%
rename from contrib/groffer/perl/groffer.man
rename to contrib/groffer/groffer.man
index fcef1cd..5546af7 100644
--- a/contrib/groffer/perl/groffer.man
+++ b/contrib/groffer/groffer.man
@@ -13,7 +13,7 @@ groffer \- display groff files and man\~pages on X and tty
 This file was written by Bernd Warken <address@hidden>.
 ..
 .de copyleft
-Copyright (C) 2001, 2002, 2004-2006, 2009-2012
+Copyright (C) 2001, 2002, 2004-2006, 2009-2012, 2014
   Free Software Foundation, Inc.
 .
 .P
@@ -31,7 +31,7 @@ as published by the
 .nh
 .BR "Free Software Foundation" ,
 .hy
-either version 3 of the License, or (at your option) any later version.
+either version 2 of the License, or (at your option) any later version.
 .
 .P
 You should have received a copy of the \f[CR]GNU General Public
@@ -320,6 +320,7 @@ Long options can be abbreviated in several ways.
 .OP --html\-viewer prog
 .OP --mode display_mode
 .OP --pdf
+.OP --pdf2
 .OP --pdf\-viewer prog
 .OP --ps
 .OP --ps\-viewer prog
@@ -807,10 +808,32 @@ The text html viewer is
 .
 .TP
 .Header_CB pdf
-Display formatted input in a
-.I \%PDF
-(Portable Document Format) viewer
-program.
+Transform
+.I roff input files
+into a
+.I PDF file
+by using the
+.B groff (@MAN1EXT@)
+device
+.BR -Tpdf .
+.
+This is the default
+.B PDF
+generator.
+.
+The generated
+.I PDF file
+is displayed with suitable viewer programs, such as
+.BR ocular (1).
+.
+.
+.TP
+.Header_CB pdf2
+This is the traditional
+.IR "pdf mode" .
+.
+Sometimes this mode produces more correct output than the default
+.BR "PDF mode" .
 .
 By default, the input is formatted by
 .B \%groff
@@ -819,16 +842,13 @@ format using
 .BR \%gs (1),
 or
 .BR ps2pdf (1).
+.
 If that's not possible, the
 .I Postscript mode (ps)
 is used instead.
 .
 Finally it is displayed using different viewer programs.
 .
-.I \%pdf
-has a big advantage because the text is displayed graphically and
-is searchable as well.
-.
 .
 .TP
 .Header_CB ps
@@ -952,6 +972,12 @@ Equivalent to
 .
 .
 .TP
+.B --pdf2
+Equivalent to
+.BR --mode=pdf2 .
+.
+.
+.TP
 .BI --pdf\-viewer \ prog
 Choose a viewer program for
 .IR \%pdf\~mode .
diff --git a/contrib/groffer/perl/groffer.pl b/contrib/groffer/groffer.pl
similarity index 95%
rename from contrib/groffer/perl/groffer.pl
rename to contrib/groffer/groffer.pl
index 766bc2e..540b47d 100755
--- a/contrib/groffer/perl/groffer.pl
+++ b/contrib/groffer/groffer.pl
@@ -5,18 +5,18 @@
 # Source file position: <groff-source>/contrib/groffer/perl/groffer.pl
 # Installed position: <prefix>/bin/groffer
 
-# Copyright (C) 2006, 2009, 2011, 2013
+# Copyright (C) 2006, 2009, 2011, 2013-14
 #   Free Software Foundation, Inc.
 
 # Written by Bernd Warken <address@hidden>.
 
-# Last update: 29 Mar 2013
+# Last update: 25 Feb 2014
 
 # This file is part of `groffer', which is part of `groff'.
 
 # `groff' 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 3 of the License, or
+# the Free Software Foundation, either version 2 of the License, or
 # (at your option) any later version.
 
 # `groff' is distributed in the hope that it will be useful, but
@@ -105,63 +105,59 @@ our $File_split_env_sh;
 our $File_version_sh;
 our $Groff_Version;
 
-BEGIN {
-  {
-    my $before_make;           # script before run of `make'
-    {
-      my $at = '@';
-      $before_make = 1 if '@VERSION@' eq "${at}VERSION${at}";
-    }
+my $before_make;               # script before run of `make'
+{
+  my $at = '@';
+  $before_make = 1 if '@VERSION@' eq "${at}VERSION${at}";
+}
 
-    my %at_at;
-    my $file_perl_test_pl;
-    my $groffer_libdir;
-
-    if ($before_make) {
-      my $groffer_perl_dir = $FindBin::Bin;
-      my $groffer_top_dir = File::Spec->catdir($groffer_perl_dir, '..');
-      $groffer_top_dir = Cwd::realpath($groffer_top_dir);
-      $at_at{'BINDIR'} = $groffer_perl_dir;
-      $at_at{'G'} = '';
-      $at_at{'LIBDIR'} = '';
-      $groffer_libdir = $groffer_perl_dir;
-      $file_perl_test_pl = File::Spec->catfile($groffer_perl_dir,
+my %at_at;
+my $file_perl_test_pl;
+my $groffer_libdir;
+
+if ($before_make) {
+  my $groffer_perl_dir = $FindBin::Bin;
+  my $groffer_top_dir = File::Spec->catdir($groffer_perl_dir, '..');
+  $groffer_top_dir = Cwd::realpath($groffer_top_dir);
+  $at_at{'BINDIR'} = $groffer_perl_dir;
+  $at_at{'G'} = '';
+  $at_at{'LIBDIR'} = '';
+  $groffer_libdir = $groffer_perl_dir;
+  $file_perl_test_pl = File::Spec->catfile($groffer_perl_dir,
                                               'perl_test.pl');
-      $File_version_sh = File::Spec->catfile($groffer_top_dir, 'version.sh');
-      $Groff_Version = '';
-    } else {
-      $Groff_Version = '@VERSION@';
-      $at_at{'BINDIR'} = '@BINDIR@';
-      $at_at{'G'} = '@g@';
-      $at_at{'LIBDIR'} = '@libdir@';
-      $groffer_libdir = '@groffer_dir@';
-      $file_perl_test_pl = File::Spec->catfile($groffer_libdir,
+  $File_version_sh = File::Spec->catfile($groffer_top_dir, 'version.sh');
+  $Groff_Version = '';
+} else {
+  $Groff_Version = '@VERSION@';
+  $at_at{'BINDIR'} = '@BINDIR@';
+  $at_at{'G'} = '@g@';
+  $at_at{'LIBDIR'} = '@libdir@';
+  $groffer_libdir = '@groffer_dir@';
+  $file_perl_test_pl = File::Spec->catfile($groffer_libdir,
                                               'perl_test.pl');
-      $File_version_sh = File::Spec->catfile($groffer_libdir, 'version.sh');
-    }
+  $File_version_sh = File::Spec->catfile($groffer_libdir, 'version.sh');
+}
 
-    die "$groffer_libdir is not an existing directory;"
-      unless -d $groffer_libdir;
+die "$groffer_libdir is not an existing directory;"
+  unless -d $groffer_libdir;
 
-    unshift(@INC, $groffer_libdir);
+unshift(@INC, $groffer_libdir);
 
-    $File_split_env_sh = File::Spec->catfile($groffer_libdir, 'split_env.sh');
-    die "$File_split_env_sh does not exist;" unless -f "$File_split_env_sh";
+$File_split_env_sh = File::Spec->catfile($groffer_libdir, 'split_env.sh');
+die "$File_split_env_sh does not exist;" unless -f "$File_split_env_sh";
 
-    # test perl on suitable version
-    die "$file_perl_test_pl does not exist;" unless -f "$file_perl_test_pl";
-    do "$file_perl_test_pl" or die "Perl test: $@";
+# test perl on suitable version
+die "$file_perl_test_pl does not exist;" unless -f "$file_perl_test_pl";
+do "$file_perl_test_pl" or die "Perl test: $@";
 
-    require 'func.pl';
-    require 'man.pl';
+require 'func.pl';
+require 'man.pl';
 
-    @Path = &path_uniq( File::Spec->path() );
address@hidden = &path_uniq( File::Spec->path() );
 
-    if ( &where_is_prog('gzip') ) {
-      $Has_Compression = 1;
-      $Has_bzip = 1 if &where_is_prog('bzip2');
-    }
-  }
+if ( &where_is_prog('gzip') ) {
+  $Has_Compression = 1;
+  $Has_bzip = 1 if &where_is_prog('bzip2');
 }
 
 
@@ -176,7 +172,7 @@ my @Conf_Files = (File::Spec->catfile(File::Spec->rootdir(),
                                      'groffer.conf')
                 );
 
-my @Default_Modes = ('pdf', 'html', 'ps', 'x', 'dvi', 'tty');
+my @Default_Modes = ('pdf', 'pdf2', 'html', 'ps', 'x', 'dvi', 'tty');
 my $Default_Resolution = 75;
 my $Default_tty_Device = 'latin1';
 
@@ -256,7 +252,7 @@ sub main_set_options {
   'debug-keep', 'debug-lm', 'debug-params', 'debug-stacks',
   'debug-tmpdir', 'debug-user', 'default', 'do-nothing', 'dvi',
   'groff', 'help', 'intermediate-output', 'html', 'man',
-  'no-location', 'no-man', 'no-special', 'pdf', 'ps', 'rv', 'source',
+  'no-location', 'no-man', 'no-special', 'pdf', 'pdf2', 'ps', 'rv', 'source',
   'text', 'to-stdout', 'text-device', 'tty', 'tty-device', 'version',
   'whatis', 'where', 'www', 'x', 'X');
 
@@ -838,6 +834,7 @@ sub main_parse_params {
                          'html' => 'html',
                          'lbp' => 'groff',
                          'lj4' => 'groff',
+                         'pdf' => 'pdf',
                          'ps' => 'ps',
                          'ascii' => 'tty',
                          'cp1047' => 'tty',
@@ -936,6 +933,7 @@ sub main_parse_params {
                         'www' => 'html',
                         'dvi' => 'dvi',
                         'pdf' => 'pdf',
+                        'pdf2' => 'pdf2',
                         'ps' => 'ps',
                         'text' => 'text',
                         'tty' => 'tty',
@@ -965,7 +963,8 @@ sub main_parse_params {
      '--pager' =>              # set paging program for tty mode, arg
      sub { $Opt{'PAGER'} = &_get_arg(); },
      '--pdf' => sub { $Opt{'MODE'} = 'pdf'; },
-     '--pdf-viewer' =>         # viewer program for pdf mode; arg
+     '--pdf2' => sub { $Opt{'MODE'} = 'pdf2'; },
+     '--pdf-viewer' =>         # viewer program for pdf and pdf2 mode; arg
      sub { $Opt{'VIEWER_PDF'} = &_get_arg(); },
      '--print' =>              # print argument, for argument test
      sub { my $arg = &_get_arg; print STDERR "$arg\n"; },
@@ -1212,6 +1211,8 @@ sub main_set_mode {
       $Display{'MODE'} = $m;
       return 1;
     } elsif ($m eq 'pdf') {
+      &_get_prog_args($m) ? return 1: next LOOP;
+    } elsif ($m eq 'pdf2') {
       next LOOP if $PDF_Did_Not_Work;
       $PDF_Has_gs = &where_is_prog('gs') ? 1 : 0
        unless (defined $PDF_Has_gs);
@@ -1992,6 +1993,20 @@ sub main_display {
     };
 
     /^pdf$/ and do {
+      if ($Opt{'DEVICE'} && $Opt{'DEVICE'} ne 'pdf') {
+       warn "main_display(): " .
+         "wrong device for $Display{'MODE'} mode: $Opt{'DEVICE'};"
+      }
+      $modefile .= '.pdf';
+      $groggy = `cat $tmp_cat | grog -Tpdf`;
+      die "main_display(): grog error;" if $?;
+      chomp $groggy;
+      print STDERR "grog output: $groggy\n" if $Debug{'GROG'};
+      &_do_display();
+      next SWITCH;
+    };
+
+    /^pdf2$/ and do {
       if ($Opt{'DEVICE'} && $Opt{'DEVICE'} ne 'ps') {
        warn "main_display(): " .
          "wrong device for $Display{'MODE'} mode: $Opt{'DEVICE'};"
@@ -2001,7 +2016,7 @@ sub main_display {
       die "main_display(): grog error;" if $?;
       chomp $groggy;
       print STDERR "grog output: $groggy\n" if $Debug{'GROG'};
-      &_do_display(\&_make_pdf);
+      &_do_display(\&_make_pdf2);
       next SWITCH;
     };
 
@@ -2149,17 +2164,18 @@ sub _do_opt_V {
   1;
 } # _do_opt_V() of main_display()
 
+
 ##############
-# _make_pdf ()
+# _make_pdf2 ()
 #
-# Transform to pdf format; for pdf mode in _do_display().
+# Transform to ps/pdf format; for pdf2 mode in _do_display().
 #
 # Globals: $md_modefile (from main_display())
 #
-sub _make_pdf {
-  die "_make_pdf(): pdf mode did not work;" if $PDF_Did_Not_Work;
+sub _make_pdf2 {
+  die "_make_pdf2(): pdf2 mode did not work;" if $PDF_Did_Not_Work;
   my $psfile = $modefile;
-  die "_make_pdf(): empty output;" if -z $modefile;
+  die "_make_pdf2(): empty output;" if -z $modefile;
   $modefile =~ s/\.ps$/.pdf/;
   unlink $modefile;
   my $done;
@@ -2174,7 +2190,7 @@ sub _make_pdf {
   }
   if (! $done) {
     $PDF_Did_Not_Work = 1;
-    warn '_make_pdf(): Could not transform into pdf format, ' .
+    warn '_make_pdf2(): Could not transform into pdf format, ' .
       'the Postscript mode (ps) is used instead;';
     $Opt{'MODE'} = 'ps';
     &main_set_mode();
@@ -2184,7 +2200,7 @@ sub _make_pdf {
   }
   unlink $psfile unless $Debug{'KEEP'};
   1;
-} # _make_pdf() of main_display()
+} # _make_pdf2() of main_display()
 
 
 ########################################################################
diff --git a/contrib/groffer/perl/man.pl b/contrib/groffer/man.pl
similarity index 100%
rename from contrib/groffer/perl/man.pl
rename to contrib/groffer/man.pl
diff --git a/contrib/groffer/perl/README_PERL b/contrib/groffer/perl/README_PERL
deleted file mode 100644
index 0e58f06..0000000
--- a/contrib/groffer/perl/README_PERL
+++ /dev/null
@@ -1,263 +0,0 @@
-README_PERL
-
-Special description for the Perl version of `groffer'
-
-The files related to the Perl version are
-
-perl/groffer.pl          perl main source file for groffer
-perl/func.pl     selection of functions needed for groffer.pl
-perl/man.pl      selection of man functions needed for groffer.pl
-perl/split_env.sh shell script called from groffer.pl to split a variable
-perl/groffer.man  manual file rewritten for the perl version of groffer
-perl/README_PERL  this file
-perl_test.pl     test whether perl has a suitable version
-version.sh       information on version number and last update
-
-
-Compatibility
-
-This is the Perl version of groffer.  It was written under Perl v5.8.8
-and needs an installed Perl version of at least version 5.6.1.
-
-It was written in Linux, but it seems to be independent of the
-operating system.  At least no directory slashes are used.
-
-For testing, `groffer.pl' may be used directly without a Makefile.  By
-`make' this file will be transformed into the file `groffer' that will
-be installed.
-
-The following options were removed compared to the shell version of
-groffer:
-
---shell --debug-func --debug-not_func --debug-lm --debug-shell
---debug-stacks --debug-user
-
-They can be used, but they are just ignored.
-
-Otherwise, the Perl version has the same functionality as the shell
-version.
-
-
-Temporary files
-
-The Perl version keeps more files for debug mode than the shell
-version.  The `file' and `so' temporaries are numbered and the files
-with .so request are copied.  All .so requests are handled; this is an
-extension to `man' that deals only with the first .so request.
-
-
-Comparison of variable names in both groffer versions
-
-shell                          perl
-=======================================================================
-$GROFFER_OPT                   $Env{GROFFER}
-$PATH                          @Path
-$_ADDOPTS_GROFF                        @Addopts_Groff
-$_ALL_PARAMS                   @ARGV
-$_APROPOS_PROG                 $Apropos_Prog
-$_APROPOS_SECTIONS             $Opt{APROPOS_SECTIONS}
-$_AT                           $at
-$_AT_BINDIR_AT                 $at_at{BINDIR}
-$_AT_G_AT                      $at_at{G}
-$_AT_LIBDIR_AT                 $at_at{LIBDIR}
-$_BAD                          -
-$_BEFORE_MAKE                  $before_make
-$_CONF_FILES                   @Conf_Files
-$_CONF_FILE_ETC                        @Conf_Files
-$_CONF_FILE_HOME               @Conf_Files
-$_DEBUG_FUNC_CHECK             -
-$_DEBUG_KEEP_FILES             @Debug{KEEP}
-$_DEBUG_LM                     -
-$_DEBUG_PRINT_FILENAMES                @Debug{FILENAMES}
-$_DEBUG_PRINT_PARAMS           @Debug{PARAMS}
-$_DEBUG_PRINT_SHELL            -
-$_DEBUG_PRINT_TMPDIR           @Debug{TMPDIR}
-$_DEBUG_STACKS                 -
-$_DEBUG_USER_WITH_STACK                -
-$_DEFAULT_MODES                        $Default_Modes
-$_DEFAULT_RESOLUTION           $Default_Resolution
-$_DEFAULT_TTY_DEVICE           $Default_tty_Device
-$_DISPLAY_ARGS                 $Display{ARGS}
-$_DISPLAY_MODE                 $Display{MODE}
-$_DISPLAY_PROG                 $Display{PROG}
-$_ERROR                                -
-$_FILEARGS                     @Filespecs
-$_FILESPEC_ARG                 $Filespec_Arg
-$_FILESPEC_IS_MAN              $Filespec_Is_Man
-$_FUNC_STACK                   -
-$_GOOD                         -
-$_GROFFER2_SH                  -
-$_GROFFER_LIBDIR               $groffer_libdir
-$_GROFFER_SH                   _
-$_GROFF_VERSION                        $Groff_Version
-$_GROFF_VERSION_PRESET         $groff_version_preset
-$_HAS_BZIP                     $Has_bzip
-$_HAS_COMPRESSION              $Has_Compression
-$_LAST_UPDATE                  $last_update
-$_MACRO_PACKAGES               $Macro_Packages
-$_MACRO_PKG                    $Macro_Pkg
-$_MANOPT_ALL                   -
-$_MANOPT_EXTENSION             -
-$_MANOPT_LANG                  -
-$_MANOPT_PAGER                 -
-$_MANOPT_PATH                  -
-$_MANOPT_SEC                   -
-$_MANOPT_SYS                   -
-$_MAN_ALL                      $Man{ALL}
-$_MAN_AUTO_SEC_CHARS           $Man{AUTO_SEC_CHARS}
-$_MAN_AUTO_SEC_LIST            @{$Man{AUTO_SEC}}
-$_MAN_ENABLE                   $Man{ENABLE}
-$_MAN_EXT                      $Man{EXT}
-$_MAN_FORCE                    $Man{FORCE}
-$_MAN_IS_SETUP                 $Man{IS_SETUP}
-$_MAN_LANG                     $Man{LANG}
-$_MAN_LANG2                    $Man{LANG2}
-$_MAN_PATH                     @{$Man{PATH}}
-$_MAN_SEC                      @{$Man{SEC}}
-$_MAN_SEC_CHARS                        $Man{SEC_CHARS}
-$_MAN_SEC_LIST                 -
-$_MAN_SYS                      @{$Man{SYS}}
-$_NO                           -
-$_NO_FILESPECS                 $No_Filespecs
-$_NULL_DEV                     $Dev_Null
-$_OK                           -
-$_OPTS_CMDLINE_LONG_ARG                %Opts_Cmdline_Long with value 1
-$_OPTS_CMDLINE_LONG_NA         %Opts_Cmdline_Long with value 0
-$_OPTS_CMDLINE_SHORT_ARG       %Opts_Cmdline_Short with value 1
-$_OPTS_CMDLINE_SHORT_NA                %Opts_Cmdline_Short with value 0
-$_OPTS_GROFFER_LONG_ARG                -
-$_OPTS_GROFFER_LONG_NA         -
-$_OPTS_GROFFER_SHORT_ARG       -
-$_OPTS_GROFFER_SHORT_NA                -
-$_OPTS_GROFF_LONG_ARG          -
-$_OPTS_GROFF_LONG_NA           -
-$_OPTS_GROFF_SHORT_ARG         -
-$_OPTS_GROFF_SHORT_NA          -
-$_OPTS_MANOPT_LONG_ARG         -
-$_OPTS_MANOPT_LONG_NA          -
-$_OPTS_MANOPT_SHORT_ARG                -
-$_OPTS_MANOPT_SHORT_NA         -
-$_OPTS_MAN_LONG_ARG            -
-$_OPTS_MAN_LONG_NA             -
-$_OPTS_MAN_SHORT_ARG           -
-$_OPTS_MAN_SHORT_NA            -
-$_OPTS_X_LONG_ARG              -
-$_OPTS_X_LONG_NA               -
-$_OPTS_X_SHORT_ARG             -
-$_OPTS_X_SHORT_NA              -
-$_OPT_ALL                      $Opt{ALL}
-$_OPT_APROPOS                  $Opt{APROPOS}
-$_OPT_BD                       $Opt{BD}
-$_OPT_BG                       $Opt{BG}
-$_OPT_BW                       $Opt{BW}
-$_OPT_DEFAULT_MODES            $Opt{DEFAULT_MODES}
-$_OPT_DEVICE                   $Opt{DEVICE}
-$_OPT_DISPLAY                  $Opt{DISPLAY}
-$_OPT_DO_NOTHING               $Opt{DO_NOTHING}
-$_OPT_EXTENSION                        $Opt{EXTENSION}
-$_OPT_FG                       $Opt{FG}
-$_OPT_FN                       $Opt{FN}
-$_OPT_GEOMETRY                 $Opt{GEOMETRY}
-$_OPT_ICONIC                   $Opt{ICONIC}
-$_OPT_LANG                     $Opt{LANG}
-$_OPT_MANPATH                  $Opt{MANPATH}
-$_OPT_MODE                     $Opt{MODE}
-$_OPT_PAGER                    $Opt{PAGER}
-$_OPT_RESOLUTION               $Opt{RESOLUTION}
-$_OPT_RV                       $Opt{RV}
-$_OPT_SECTIONS                 $Opt{SECTIONS}
-$_OPT_SYSTEMS                  $Opt{SYSTEMS}
-$_OPT_TEXT_DEVICE              $Opt{TEXT_DEVICE}
-$_OPT_TITLE                    $Opt{TITLE}
-$_OPT_V                                $Opt{V}
-$_OPT_VIEWER_DVI               $Opt{VIEWER_DVI}
-$_OPT_VIEWER_HTML              $Opt{VIEWER_HTML}
-$_OPT_VIEWER_PDF               $Opt{VIEWER_PDF}
-$_OPT_VIEWER_PS                        $Opt{VIEWER_PS}
-$_OPT_VIEWER_X                 $Opt{VIEWER_X}
-$_OPT_WHATIS                   $Opt{WHATIS}
-$_OPT_XRM                      @{$Opt{XRM}}
-$_OPT_Z                                $Opt{Z}
-$_OUTPUT_FILE_NAME             $Output_File_Name
-$_PDF_DID_NOT_WORK             $PDF_Did_Not_Work
-$_PDF_HAS_GS                   $PDF_Has_gs
-$_PDF_HAS_PS2PDF               $PDF_Has_ps2pdf
-$_PROCESS_ID                   -
-$_PROGRAM_VERSION              $program_version
-$_REG_TITLE_LIST               @Reg_Title
-$_SHELL                                -
-$_SP                           -
-$_SPACE_CASE                   -
-$_SPACE_SED                    -
-$_SPECIAL_FILESPEC             $Special_Filespec
-$_SPECIAL_SETUP                        $Special_Setup
-$_SQ                           -
-$_START_DIR                    $Start_Dir
-$_TAB                          -
-$_TMP_CAT                      $fh_cat, $tmp_cat
-$_TMP_DIR                      $tmpdir
-$_TMP_MAN                      -
-$_TMP_MANSPEC                  $Manspec for @{Man{MANSPEC}{$Manspec}}
-$_TMP_STDIN                    $fh_stdin, $tmp_stdin
-$_UNSET                                -
-$_VIEWER_BACKGROUND            $Viewer_Background
-$_VIEWER_DVI_TTY               $Viewer_tty{'DVI'}
-$_VIEWER_DVI_X                 $Viewer_X{'DVI'}
-$_VIEWER_HTML_TTY              $Viewer_tty{'HTML'}
-$_VIEWER_HTML_X                        $Viewer_X{'HTML'}
-$_VIEWER_PDF_TTY               $Viewer_tty{'PDF'}
-$_VIEWER_PDF_X                 $Viewer_X{'PDF'}
-$_VIEWER_PS_TTY                        $Viewer_tty{'PS'}
-$_VIEWER_PS_X                  $Viewer_X{'PS'}
-$_VIEWER_TTY_TTY               -
-$_VIEWER_TTY_X                 -
-$_VIEWER_X_TTY                 $Viewer_tty{'X'}
-$_VIEWER_X_X                   $Viewer_X{'X'}
-$_YES                          -
-$return_bad                    -
-$return_error                  -
-$return_good                   -
-$return_no                     -
-$return_ok                     -
-$return_var                    -
-$return_yes                    -
--                              @ARGV
--                              @Manopt
--                              $Opt{LOCATION}
--                              $Opt{X}
--                              $File_Split_Env
--                              @Options
--                              @StartingARGV
--                              @StartingConf
--                              $Umask
-
-
-####### License
-
-Copyright (C) 2003, 2004, 2005, 2006, 2009
-  Free Software Foundation, Inc.
-Written by Bernd Warken <address@hidden>.
-
-This file is part of `groffer', which is part of `groff'.
-
-`groff' 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 3 of the License, or
-(at your option) any later version.
-
-`groff' 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, see <http://www.gnu.org/licenses/>.
-
-Last update: 5 Jan 2009
-
-
-####### Emacs settings
-
-Local Variables:
-mode: text
-End:
diff --git a/contrib/groffer/perl/perl_test.pl b/contrib/groffer/perl_test.pl
similarity index 100%
rename from contrib/groffer/perl/perl_test.pl
rename to contrib/groffer/perl_test.pl
diff --git a/contrib/groffer/perl/roff2.pl b/contrib/groffer/roff2.pl
similarity index 100%
rename from contrib/groffer/perl/roff2.pl
rename to contrib/groffer/roff2.pl
diff --git a/contrib/groffer/perl/split_env.sh b/contrib/groffer/split_env.sh
similarity index 100%
rename from contrib/groffer/perl/split_env.sh
rename to contrib/groffer/split_env.sh
diff --git a/contrib/groffer/version.sh b/contrib/groffer/version.sh
index b5f554c..c513023 100644
--- a/contrib/groffer/version.sh
+++ b/contrib/groffer/version.sh
@@ -5,7 +5,7 @@
 # Source file position: <groff-source>/contrib/groffer/version.sh
 # Installed position: <prefix>/lib/groff/groffer/version.sh
 
-# Copyright (C) 2001-2006, 2009, 2011, 2013
+# Copyright (C) 2001-2006, 2009, 2011, 2013-14
 #   Free Software Foundation, Inc.
 # Written by Bernd Warken <address@hidden>.
 
@@ -13,7 +13,7 @@
 
 # `groff' 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 3 of the License, or
+# the Free Software Foundation, either version 2 of the License, or
 # (at your option) any later version.
 
 # `groff' is distributed in the hope that it will be useful, but
@@ -29,8 +29,8 @@
 export _PROGRAM_VERSION;
 export _LAST_UPDATE;
 
-_PROGRAM_VERSION='2.0.1';
-_LAST_UPDATE='23 Dec 2013';
+_PROGRAM_VERSION='2.0.2';
+_LAST_UPDATE='25 Feb 2014';
 
 # this setting of the groff version is only used before make is run,
 # otherwise @VERSION@ will set it, see groffer.sh.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]