Author: Ole Streicher <debian@liska.ath.cx>
Description: Do not depend on the starlink's automake, but use their macro
 file together with the standard automake
--- a/configure.ac
+++ b/configure.ac
@@ -13,7 +13,10 @@
 dnl   Require autoconf-2.50 at least
 AC_PREREQ([2.69])
 dnl   Require Starlink automake
-AM_INIT_AUTOMAKE([1.8.2-starlink subdir-objects])
+AM_INIT_AUTOMAKE([foreign subdir-objects])
+# Comment out predistribution sources in Makefile.am
+PREDIST='#'  # safe default
+AC_SUBST(PREDIST)
 
 dnl   Sanity-check: name a file in the source directory
 AC_CONFIG_SRCDIR([ast_link.in])
@@ -178,7 +181,7 @@
 #   satisfy these targets, so give a non-null value
 #   for the second argument, to suppress automatic generation of
 #   rules.
-STAR_LATEX_DOCUMENTATION([sun210 sun211], [sun210.pdf sun210.tex sun211.pdf sun211.tex sun210.htx_tar sun211.htx_tar])
+STAR_LATEX_DOCUMENTATION([sun211])
 STAR_PREDIST_SOURCES(sun_master.tex)
 STAR_CHECK_PROGS(star2html)
 STAR_CHECK_PROGS(prolat, sst)   # prolat is part of SST
--- a/Makefile.am
+++ b/Makefile.am
@@ -568,9 +568,13 @@
     libstarlink_ast_pgplot.la \
     libstarlink_ast_pgplot3d.la
 
-stardocs_DATA = @STAR_LATEX_DOCUMENTATION@
-dist_starnews_DATA = ast.news
-dist_pkgdata_DATA = COPYING COPYING.LESSER COPYING.LIB
+doc:  @STARDOCS@.pdf @STARDOCS@/index.html
+.tex.pdf:
+	pdflatex $^ && pdflatex $^
+
+@STARDOCS@/index.html: @STARDOCS@.tex
+	latex2html -noaddress $^
+	rm -f @STARDOCS@/@STARDOCS@.html @STARDOCS@/WARNINGS
 
 # Make all library code position independent by default. This is handy for
 # creating shareable libraries from the static ones (Java JNI libraries).
@@ -721,6 +725,7 @@
 #  Use target install-exec-hook rather than install-exec-local so that the
 #  soft links and files are created *after* the main library has been
 #  installed.
+MANIFEST=/bin/true
 install-exec-hook: libstarlink_ast.la
 	$(mkdir_p) $(DESTDIR)$(libdir)
 	cd $(DESTDIR)$(libdir); \
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1 +1,56 @@
-m4_define([OVERRIDE_PREFIX],[/usr/local])
+m4_define([OVERRIDE_PREFIX],[/usr/])
+
+AC_DEFUN([STAR_DEFAULTS],[
+
+# Create a PACKAGE_VERSION_INTEGER variable, which contains the
+# package's version number as an integer major*1e6+minor*1e3+release.
+eval [`echo $VERSION | sed -e 's/\([0-9]*\)[^0-9]*\([0-9]*\)[^0-9]*\([0-9]*\).*/PACKAGE_VERSION_MAJOR=\1; PACKAGE_VERSION_MINOR=\2; PACKAGE_VERSION_RELEASE=\3;/'`]
+test -n "$PACKAGE_VERSION_MAJOR"   || PACKAGE_VERSION_MAJOR=0
+test -n "$PACKAGE_VERSION_MINOR"   || PACKAGE_VERSION_MINOR=0
+test -n "$PACKAGE_VERSION_RELEASE" || PACKAGE_VERSION_RELEASE=0
+PACKAGE_VERSION_INTEGER=`expr $PACKAGE_VERSION_MAJOR \* 1000000 + $PACKAGE_VERSION_MINOR \* 1000 + $PACKAGE_VERSION_RELEASE`
+AC_SUBST(PACKAGE_VERSION_MAJOR)
+AC_SUBST(PACKAGE_VERSION_MINOR)
+AC_SUBST(PACKAGE_VERSION_RELEASE)
+AC_SUBST(PACKAGE_VERSION_INTEGER)
+])
+
+# Dummy declaration of starlink intedependencies
+AC_DEFUN([STAR_DECLARE_DEPENDENCIES], [])
+
+#  Perform the check that configures f77.h.in for the return type of REAL
+#  Fortran functions. On 64-bit g77 with f2c compatibility this is double
+#  not float.
+AC_DEFUN([STAR_CNF_F2C_COMPATIBLE], [
+    AC_SUBST([REAL_FUNCTION_TYPE], double)
+])
+
+# Determine the type of Fortran character string lengths.
+AC_DEFUN([STAR_CNF_TRAIL_TYPE], [
+    AC_SUBST([TRAIL_TYPE], int)
+])
+
+#   Declare the message file.
+AC_DEFUN([STAR_MESSGEN], [])
+
+#   Declare the documentation.
+# For Debian, this must be explicitely set in the patched Makefile.am
+# since we don't use Starlink's automake here.
+AC_DEFUN([STAR_LATEX_DOCUMENTATION], [
+    AC_SUBST([STARDOCS], [$1])
+])
+
+
+AC_DEFUN([STAR_PREDIST_SOURCES], [])
+
+AC_DEFUN([STAR_PLATFORM_SOURCES], [
+for _t in $1; do
+    (cd ${srcdir}; rm -f ${_t}; cp -p ${_t}default ${_t})
+done
+])
+
+# We ignor]e any starlinks programs here since we don' install the whole
+# Starlink bootstrap chain.
+AC_DEFUN([STAR_CHECK_PROGS], [])
+
+
