From 6f80e5b7f6c9cfa8be2e12c64df5e4e50848cf9d Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Tue, 29 Dec 2015 11:25:39 +0100
Subject: [PATCH] Install test programs correctly.

---
 Makefile.am | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

Many of the test programs have generic names like test_name which is
likely to conflict with other packages. Instead, install with names like
irman.test_func instead.

Using the regular naming scheme like irman_test_func_sw seems to reveal
a bug in recent autotools (?) Walk around using a install hook.
-
Index: libirman-0.5.2/Makefile.am
===================================================================
--- libirman-0.5.2.orig/Makefile.am
+++ libirman-0.5.2/Makefile.am
@@ -47,6 +47,7 @@ noinst_PROGRAMS = test_io test_func test
 
 if BUILD_SWTEST
 bin_PROGRAMS += workmanir_sw
+bin_PROGRAMS += test_io_sw test_func_sw test_name_sw
 lib_LTLIBRARIES += libirman_sw.la
 noinst_PROGRAMS += test_io_sw test_func_sw test_name_sw
 endif
@@ -85,3 +86,12 @@
 libirman_sw_la_CFLAGS = -DIR_SOFTWARE_TEST
 endif
 
+install-exec-hook:
+	-for p in test_func test_name test_io; do \
+	    mv $(DESTDIR)$(bindir)/$$p $(DESTDIR)$(bindir)/irman.$$p; \
+	done
+if BUILD_SWTEST
+	-for p in test_io_sw test_func_sw test_name_sw; do \
+	    mv $(DESTDIR)$(bindir)/$$p $(DESTDIR)$(bindir)/irman.$$p; \
+	done
+endif
