summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Debhelper/Dh_Lib.pm7
-rw-r--r--Makefile12
2 files changed, 12 insertions, 7 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 7b550b0..0a73b0f 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -21,6 +21,7 @@ use vars qw(@ISA @EXPORT %dh);
&cross_command &set_buildflags &get_buildoption);
my $max_compat=10;
+my $prefix="/usr";
sub init {
my %params=@_;
@@ -522,11 +523,11 @@ sub autoscript {
$infile="$ENV{DH_AUTOSCRIPTDIR}/$filename";
}
else {
- if (-e "/usr/share/debhelper/autoscripts/$filename") {
- $infile="/usr/share/debhelper/autoscripts/$filename";
+ if (-e "$prefix/share/debhelper/autoscripts/$filename") {
+ $infile="$prefix/share/debhelper/autoscripts/$filename";
}
else {
- error("/usr/share/debhelper/autoscripts/$filename does not exist");
+ error("$prefix/share/debhelper/autoscripts/$filename does not exist");
}
}
diff --git a/Makefile b/Makefile
index 41e7ff3..fcaa4fd 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