I looked at doing a proper dh-autoreconf for this packages, as is now
recommended practice, but ran into problems because the package uses
ACLOCAL_BINRELOC and something about this causes the autoreconf to
barf due to mssing m4 macros. This would need a bit of investigation
and understanding to fix so I've wimped out for now and just used
autotools-dev which fixes the actual issue at hand of outdated
config.{sub,guess}.

This is what goes wrong if you dh_autoreconf:
configure.in:43: error: possibly undefined macro: AM_BINRELOC
      If this token and others are legitimate, please use
m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
dh_autoreconf: autoreconf -f -i returned exit code 1

Which is fixed by adding -I ac-helpers to ACLOCAL_AMFLAGS in Makefile.am
ACLOCAL_AMFLAGS = -I m4 -I ac-helpers
currently acinclude.m4 is used, which is now deprecated. Simply moving
ac-helpers/binreloc.m4 into m4 seems to be best current practice.

The package needs various updates to modern autoconf: moving from
deprecated 2-param AM_INIT_AUTOMAKE to AC_INIT
(https://www.gnu.org/software/automake/manual/html_node/Public-Macros.html#index-AC_005fINIT),
setting foreign strictness, renaming INCLUDES->AM_CPPFLAGS in
*/Makefile.am

However, swapping 2-param AM_INIT_AUTOMAKE to AC_INIT is tricky
because the former takes a variabe and the latter doesn't, and
link-grammar uses $VERSION and subcomponents in various places. This
would all need changingto m4:
http://stackoverflow.com/questions/22871340/using-a-variable-in-ac-init

That seems too intrusive for an NMU.

So attached is a patch for the minimal set of changes that allows it
to build with modern autotools. (swapping INCLUDES just reduces the
noise - it's not actually necessary).

Do you care if I upload the version with the minimal autotools-dev
fix, or this better, but by no means complete, partial update to
current autotools? This latter has a small risk of breaking something
in the build, although it's usually fine, but updating is good as it
means that the packages can actually be tested with current build
tools. 

Wookey
-- 
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/
reverted:
reverted:
diff -u link-grammar-4.7.4/autogen.err link-grammar-4.7.4/autogen.err
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
diff -u link-grammar-4.7.4/link-grammar/Makefile.am link-grammar-4.7.4/link-grammar/Makefile.am
--- link-grammar-4.7.4/link-grammar/Makefile.am
+++ link-grammar-4.7.4/link-grammar/Makefile.am
@@ -25,7 +25,7 @@
 
 DEFS = @DEFS@ -DVERSION=\"@VERSION@\" -DDICTIONARY_DIR=\"$(pkgdatadir)\"
 
-INCLUDES = -I$(top_srcdir) $(ANSI_CFLAGS) $(LINK_CFLAGS) $(HUNSPELL_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir) $(ANSI_CFLAGS) $(LINK_CFLAGS) $(HUNSPELL_CFLAGS)
 
 lib_LTLIBRARIES = liblink-grammar.la
 
reverted:
reverted:
reverted:
reverted:
diff -u link-grammar-4.7.4/debian/rules link-grammar-4.7.4/debian/rules
--- link-grammar-4.7.4/debian/rules
+++ link-grammar-4.7.4/debian/rules
@@ -5,6 +5,7 @@
 
 include /usr/share/cdbs/1/class/autotools.mk
 include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/autoreconf.mk
 
 DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS=-Wl,--as-needed
 
diff -u link-grammar-4.7.4/debian/control link-grammar-4.7.4/debian/control
--- link-grammar-4.7.4/debian/control
+++ link-grammar-4.7.4/debian/control
@@ -2,12 +2,11 @@
 Section: text
 Priority: optional
 Maintainer: Ken Bloom <kbl...@gmail.com>
-Build-Depends: debhelper (>= 7.0.0), cdbs, default-jdk [!hppa !alpha !arm], fastjar [!hppa !alpha !arm], ant [!hppa !alpha !arm], libaspell-dev, libhunspell-dev
+Build-Depends: debhelper (>= 7.0.0), cdbs, default-jdk [!hppa !alpha !arm], fastjar [!hppa !alpha !arm], ant [!hppa !alpha !arm], libaspell-dev, libhunspell-dev, dh-autoreconf
 Standards-Version: 3.9.2
 Homepage: http://www.abisource.com/projects/link-grammar/
 Vcs-Browser: http://git.debian.org/?p=collab-maint/link-grammar.git
 Vcs-Git: git://git.debian.org/git/collab-maint/link-grammar.git
-DM-Upload-Allowed: yes
 
 Package: link-grammar
 Architecture: any
diff -u link-grammar-4.7.4/debian/changelog link-grammar-4.7.4/debian/changelog
--- link-grammar-4.7.4/debian/changelog
+++ link-grammar-4.7.4/debian/changelog
@@ -1,3 +1,11 @@
+link-grammar (4.7.4-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Use dh-autoreconf to support newer architectures (Closes: 765024)
+  * Remove obsolete Dm-Upload-Allowed field
+
+ -- Wookey <woo...@asachi.debian.org>  Fri, 12 Jun 2015 01:34:47 +0000
+
 link-grammar (4.7.4-2) unstable; urgency=low
 
   * Update homepage (Closes: #618610)
reverted:
reverted:
reverted:
reverted:
reverted:
reverted:
only in patch2:
unchanged:
only in patch2:
unchanged:
--- link-grammar-4.7.4.orig/Makefile.am
+++ link-grammar-4.7.4/Makefile.am
@@ -3,7 +3,8 @@
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = link-grammar.pc
 
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 -I ac-helpers
+AUTOMAKE_OPTIONS = foreign
 
 # Build and install the jar file in $(PREFIX)/share/java ...
 # XXX FIXME configure should look to see if it can find ant
only in patch2:
unchanged:
--- link-grammar-4.7.4.orig/acinclude.m4
+++ link-grammar-4.7.4/acinclude.m4
@@ -0,0 +1 @@
+ac-helpers/binreloc.m4
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
--- link-grammar-4.7.4.orig/link-grammar/corpus/Makefile.am
+++ link-grammar-4.7.4/link-grammar/corpus/Makefile.am
@@ -5,7 +5,7 @@
 
 DEFS = @DEFS@ -DVERSION=\"@VERSION@\" -DDICTIONARY_DIR=\"$(pkgdatadir)\"
 
-INCLUDES = -I$(top_srcdir) $(ANSI_CFLAGS) $(SQLITE3_CFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir) $(ANSI_CFLAGS) $(SQLITE3_CFLAGS)
 
 if WITH_CORPUS
 lib_LTLIBRARIES = liblink-corpus.la
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
only in patch2:
unchanged:
--- link-grammar-4.7.4.orig/link-grammar/sat-solver/Makefile.am
+++ link-grammar-4.7.4/link-grammar/sat-solver/Makefile.am
@@ -5,7 +5,7 @@
 
 libsat_solver_la_LDFLAGS = -version-info $(SATSOLVER_VERSION_INFO)
 
-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/link-grammar -I$(top_srcdir)/link-grammar/minisat
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/link-grammar -I$(top_srcdir)/link-grammar/minisat
 
 libsat_solver_includedir = $(includedir)/link-grammar $(includedir)/link-grammar/minisat
 

Reply via email to