groff/groff-grofferdir-auto.patch
2011-06-17 14:36:27 +02:00

150 lines
5.2 KiB
Diff

fix: groffer libdir is incorrect
adds --with-grofferdir= configure option
Resolves: #678572
Author: Jan Vcelak <jvcelak@redhat.com>
diff -uNPrp groff-1.21/configure groff-1.21.fixed/configure
--- groff-1.21/configure 2010-12-31 08:33:20.000000000 +0100
+++ groff-1.21.fixed/configure 2011-03-21 10:45:25.100074487 +0100
@@ -648,6 +648,7 @@ PSPRINT
LPQ
LP
LPR
+groffer_dir
appresdir
XLIBDIRS
XPROGDIRS
@@ -715,6 +716,7 @@ ac_user_opts='
enable_option_checking
with_x
with_appresdir
+with_grofferdir
with_gnu_ld
enable_rpath
with_libiconv_prefix
@@ -1362,6 +1363,7 @@ Optional Packages:
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-x use the X Window System
--with-appresdir=DIR X11 application resource files
+ --with-grofferdir=DIR groffer files location
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
--without-libiconv-prefix don't search for libiconv in includedir and libdir
@@ -5446,6 +5448,18 @@ EOF
fi
fi
+
+# Check whether --with-grofferdir was given.
+if test "${with_grofferdir+set}" = set; then :
+ withval=$with_grofferdir;
+fi
+
+if test "x$with_grofferdir" = "x"; then
+ groffer_dir=$libdir/groff/groffer
+ else
+ groffer_dir=$with_grofferdir
+ fi
+
if test -z "$PSPRINT"; then
for ac_prog in lpr
do
diff -uNPrp groff-1.21/configure.ac groff-1.21.fixed/configure.ac
--- groff-1.21/configure.ac 2010-12-31 08:33:08.000000000 +0100
+++ groff-1.21.fixed/configure.ac 2011-03-21 10:43:32.249906873 +0100
@@ -59,6 +59,8 @@ GROFF_OS390
GROFF_X11
GROFF_APPRESDIR_OPTION
GROFF_APPRESDIR_DEFAULT
+GROFF_GROFFERDIR_OPTION
+GROFF_GROFFERDIR_DEFAULT
GROFF_PRINT
AC_PROG_EGREP
AC_PATH_PROG([PERLPATH], [perl], [/usr/bin/perl])
diff -uNPrp groff-1.21/contrib/groffer/Makefile.sub groff-1.21.fixed/contrib/groffer/Makefile.sub
--- groff-1.21/contrib/groffer/Makefile.sub 2010-12-31 08:33:09.000000000 +0100
+++ groff-1.21.fixed/contrib/groffer/Makefile.sub 2011-03-21 10:56:57.142842476 +0100
@@ -63,8 +63,6 @@ GROFFER_REST=$(srcdir)/roff2.man \
GROFFER_PERL_=`echo $(GROFFER_PERL) | sed 's|$(srcdir)/perl/||g'`
GROFFER_SHELL_=`echo $(GROFFER_SHELL) | sed 's|$(srcdir)/shell||g'`
-groffer_dir=$(libdir)/groff/groffer
-
# TODO: Add perl check to configure script.
groffer: $(GROFFER_PERL) $(GROFFER_SHELL) \
$(GROFFER_REST) $(SH_DEPS_SED_SCRIPT)
@@ -75,6 +73,7 @@ groffer: $(GROFFER_PERL) $(GROFFER_SHELL
-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)/perl/groffer.pl >$@; \
@@ -89,6 +88,7 @@ groffer: $(GROFFER_PERL) $(GROFFER_SHELL
-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 >$@; \
diff -uNPrp groff-1.21/contrib/groffer/perl/groffer.pl groff-1.21.fixed/contrib/groffer/perl/groffer.pl
--- groff-1.21/contrib/groffer/perl/groffer.pl 2010-12-31 08:33:09.000000000 +0100
+++ groff-1.21.fixed/contrib/groffer/perl/groffer.pl 2011-03-21 10:20:21.865418634 +0100
@@ -132,8 +132,7 @@ BEGIN {
$at_at{'BINDIR'} = '@BINDIR@';
$at_at{'G'} = '@g@';
$at_at{'LIBDIR'} = '@libdir@';
- $groffer_libdir =
- File::Spec->catdir($at_at{'LIBDIR'}, 'groff', 'groffer');
+ $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');
diff -uNPrp groff-1.21/Makefile.in groff-1.21.fixed/Makefile.in
--- groff-1.21/Makefile.in 2010-12-31 08:33:08.000000000 +0100
+++ groff-1.21.fixed/Makefile.in 2011-03-21 10:53:51.551854122 +0100
@@ -188,6 +188,8 @@ localtmacdir=$(dataprogramdir)/site-tmac
# gxditview.
appresdir=@appresdir@
+groffer_dir=@groffer_dir@
+
# `tmacpath' says where to look for macro files.
# The current directory will be prepended in unsafe mode only; the home
# directory will be always added.
@@ -493,6 +495,7 @@ MDEFINES= \
"YACC=$(YACC)" \
"YACCFLAGS=$(YACCFLAGS)" \
"appresdir=$(appresdir)" \
+ "groffer_dir=$(groffer_dir)" \
"bindir=$(bindir)" \
"common_words_file=$(common_words_file)" \
"datadir=$(datadir)" \
diff -uNPrp groff-1.21/m4/groff.m4 groff-1.21.fixed/m4/groff.m4
--- groff-1.21/m4/groff.m4 2010-12-31 08:33:09.000000000 +0100
+++ groff-1.21.fixed/m4/groff.m4 2011-03-21 10:54:17.716429483 +0100
@@ -1193,3 +1193,19 @@ AC_DEFUN([GROFF_APPRESDIR_CHECK],
])
fi
fi])
+
+
+# Set up the `--with-grofferdir' command line option.
+
+AC_DEFUN([GROFF_GROFFERDIR_OPTION],
+ [AC_ARG_WITH([grofferdir],
+ AS_HELP_STRING([--with-grofferdir=DIR],
+ [groffer files location]))])
+
+AC_DEFUN([GROFF_GROFFERDIR_DEFAULT],
+ [if test "x$with_grofferdir" = "x"; then
+ groffer_dir=$libdir/groff/groffer
+ else
+ groffer_dir=$with_grofferdir
+ fi
+ AC_SUBST([groffer_dir])])