tapecalc (20070214-2) 00rel-path.dpatch

Summary

 add.c       |    2 +-
 makefile.in |   10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## rel-path.dpatch by Carl Fürstenberg <azatoth@gmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch to relocate add.hlp to datadir instead of bindir.

@DPATCH@
diff -urNad add-20070214~/add.c add-20070214/add.c
--- add-20070214~/add.c	2007-07-25 22:37:49.000000000 +0200
+++ add-20070214/add.c	2007-07-25 22:38:29.000000000 +0200
@@ -1935,7 +1935,7 @@
 	}
     }
 # endif				/* VMS/UNIX/MSDOS */
-    (void) strcpy(s, "add.hlp");
+    (void) strcpy(s, DATADIR "add.hlp");
     helpfile = AllocString(temp);
 #endif /* ADD_HELPFILE */
 }
diff -urNad add-20070214~/makefile.in add-20070214/makefile.in
--- add-20070214~/makefile.in	2007-07-25 22:37:49.000000000 +0200
+++ add-20070214/makefile.in	2007-07-25 22:38:29.000000000 +0200
@@ -8,6 +8,7 @@
 #### Start of system configuration section. ####
 
 srcdir = @srcdir@
+datadir	= $(DESTDIR)@datadir@/$(THIS)
 VPATH  = @srcdir@
 
 CC		= @CC@
@@ -17,7 +18,7 @@
 INSTALL_DATA	= @INSTALL_DATA@
 
 LIBS		= @LIBS@
-CPPFLAGS	= @CPPFLAGS@ -DHAVE_CONFIG_H -DRELEASE=\"$(RELEASE)\" -I. -I$(srcdir)
+CPPFLAGS	= @CPPFLAGS@ -DHAVE_CONFIG_H -DRELEASE=\"$(RELEASE)\" -DDATADIR=\"$(datadir)/\" -I. -I$(srcdir)
 CFLAGS		= @CFLAGS@ @EXTRA_CFLAGS@
 LDFLAGS		= @LDFLAGS@
 
@@ -26,6 +27,7 @@
 
 bindir		= $(DESTDIR)@bindir@
 mandir		= $(DESTDIR)@mandir@/man1
+
 manext		= 1
 
 x		= @PROG_EXT@
@@ -50,7 +52,8 @@
 
 install: all installdirs
 	$(INSTALL_PROGRAM) $(PROG) $(bindir)/$(PROG)
-	$(INSTALL_PROGRAM) $(THIS).hlp $(bindir)/$(THIS).hlp
+	mkdir -p $(datadir)
+	$(INSTALL_DATA) $(srcdir)/$(THIS).hlp $(datadir)/$(THIS).hlp
 	$(INSTALL_DATA) $(srcdir)/$(THIS).1 $(mandir)/$(THIS).$(manext)
 
 installdirs:
@@ -58,7 +61,8 @@
 
 uninstall:
 	rm -f $(bindir)/$(PROG)
-	rm -f $(bindir)/$(THIS).hlp
+	rm -f $(datadir)/$(THIS).hlp
+	rmdir $(datadir)
 	rm -f $(mandir)/$(THIS).$(manext)
 
 mostlyclean: