summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristoph Junghans <ottxor@gentoo.org>2012-11-12 14:54:43 -0700
committerJoey Hess <joey@kitenet.net>2012-11-12 18:02:37 -0400
commit0aa572f1de498231683a555341841d582d813f21 (patch)
tree10c061593ebbb55f8f5a16b695ed25b82a995733 /Makefile
parent20672fd5f4f015d4aac1227af45ff73980194539 (diff)
Makefile: introduce PREFIX variable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 41e7ff3a..fcaa4fdc 100644
--- a/Makefile
+++ b/Makefile
@@ -38,6 +38,8 @@ VERSION=$(shell expr "`dpkg-parsechangelog |grep Version:`" : '.*Version: \(.*\)
PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')/Debian/Debhelper
+PREFIX=/usr
+
POD2MAN=pod2man --utf8 -c Debhelper -r "$(VERSION)"
ifneq ($(USE_NLS),no)
@@ -84,13 +86,15 @@ clean:
done;
install:
- install -d $(DESTDIR)/usr/bin \
- $(DESTDIR)/usr/share/debhelper/autoscripts \
+ install -d $(DESTDIR)$(PREFIX)/bin \
+ $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts \
$(DESTDIR)$(PERLLIBDIR)/Sequence \
$(DESTDIR)$(PERLLIBDIR)/Buildsystem
- install dh $(COMMANDS) $(DESTDIR)/usr/bin
- install -m 0644 autoscripts/* $(DESTDIR)/usr/share/debhelper/autoscripts
+ install dh $(COMMANDS) $(DESTDIR)$(PREFIX)/bin
+ install -m 0644 autoscripts/* $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts
install -m 0644 Debian/Debhelper/*.pm $(DESTDIR)$(PERLLIBDIR)
+ [ "$(PREFIX)" = /usr ] || \
+ sed -i '/$$prefix=/s@/usr@$(PREFIX)@g' $(DESTDIR)$(PERLLIBDIR)/Dh_Lib.pm
install -m 0644 Debian/Debhelper/Sequence/*.pm $(DESTDIR)$(PERLLIBDIR)/Sequence
install -m 0644 Debian/Debhelper/Buildsystem/*.pm $(DESTDIR)$(PERLLIBDIR)/Buildsystem