Add 'DESTDIR' - prefix to 'prefix' variable value.
Add 'INSTALL_PROGRAM' and 'INSTALL_DATA' definitions.
--- a/Makefile Fri Jan 13 23:29:39 2012 +0200
+++ b/Makefile Fri Jan 13 23:41:20 2012 +0200
@@ -14,7 +14,9 @@
#
# You can override such variables in Makefile.config:
#
-# SF_USER SourceForge user name
+# SF_USER SourceForge user name.
+# prefix Prefix to install path.
+# DESTDIR Prefix to 'prefix' variable value.
SHELL = /bin/sh
export PATH := /bin:/usr/bin:${PATH}
@@ -77,6 +79,10 @@
################################################################
# Build tools definition/switches.
+INSTALL = install
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_DATA = $(INSTALL) -m 644
+
RST_WARNING_FLAGS := --halt warning
RST_FLAGS := --strip-comments
RST_FLAGS += $(RST_WARNING_FLAGS)
@@ -97,7 +103,7 @@
prefix = $(HOME)/usr
endif
endif
-datarootdir = $(prefix)/share
+datarootdir := $(DESTDIR)$(prefix)/share
datadir = $(datarootdir)/dictd
################################################################
@@ -230,7 +236,7 @@
install: dist
mkdir -p $(datadir)
for f in $(DICTDZ_FILES) $(INDEX_FILES); do \
- install -m 644 $$f $(datadir); \
+ $(INSTALL_DATA) $$f $(datadir); \
done
.PHONY: uninstall