Package: devscripts
Version: 2.13.4
Severity: wishlist

Some parts of the makefiles support setting the PREFIX variable and
other variables to control the installation layout, but this is not
consistently done.  Here is a patch to make that consistent.  This is
useful to allow test installations etc.
diff --git a/Makefile b/Makefile
index 2907a5a..236cfaa 100644
--- a/Makefile
+++ b/Makefile
@@ -7,10 +7,6 @@ DESTDIR =
 PERL_MODULES = Devscripts
 EXAMPLES = conf.default README.mk-build-deps
 
-PREFIX ?= /usr
-DOCDIR ?= $(PREFIX)/share/doc/devscripts
-MAN1DIR ?= $(PREFIX)/share/man/man1
-
 all: version make_scripts $(EXAMPLES) translated_manpages
 
 version:
diff --git a/Makefile.common b/Makefile.common
index 74aa252..75a0671 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -3,6 +3,11 @@ GEN_MAN1S := bts.1 build-rdeps.1 chdist.1 dcontrol.1 debcheckout.1 debcommit.1 \
 	     mk-build-deps.1 namecheck.1 rmadison.1 svnpath.1 tagpending.1 \
 	     origtargz.1 transition-check.1 who-permits-upload.1
 
-PERLMOD_DIR = /usr/share/devscripts
-EXAMPLES_DIR = /usr/share/devscripts
-
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+PKGLIBDIR = $(PREFIX)/lib/devscripts
+DOCDIR = $(PREFIX)/share/doc/devscripts
+MAN1DIR = $(PREFIX)/share/man/man1
+PERLMOD_DIR = $(PREFIX)/share/devscripts
+EXAMPLES_DIR = $(PREFIX)/share/devscripts
+SYSCONFDIR = /etc
diff --git a/scripts/Makefile b/scripts/Makefile
index d981b81..56a6a1a 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -24,10 +24,6 @@ COMPLETION = $(patsubst %.bash_completion,devscripts.%,$(COMPL_FILES))
 
 GEN_MAN1S += devscripts.1
 
-BINDIR = /usr/bin
-LIBDIR = /usr/lib/devscripts
-BIN_LIBDIR = /usr/lib/devscripts
-
 all: $(SCRIPTS) $(GEN_MAN1S) $(LIBS) $(CWRAPPERS) $(COMPLETION)
 
 $(VERSION_FILE):
@@ -93,12 +89,12 @@ test:
 
 install: all
 	python3 setup.py install --root="$(DESTDIR)" --no-compile --install-layout=deb
-	install -dD $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR)
+	install -dD $(DESTDIR)$(BINDIR) $(DESTDIR)$(PKGLIBDIR)
 	cp $(SCRIPTS) $(DESTDIR)$(BINDIR)
 	ln -sf edit-patch $(DESTDIR)$(BINDIR)/add-patch
-	cp $(LIBS) $(DESTDIR)$(LIBDIR)
-	install -dD $(DESTDIR)/etc/bash_completion.d
-	cp $(COMPLETION) $(DESTDIR)/etc/bash_completion.d
+	cp $(LIBS) $(DESTDIR)$(PKGLIBDIR)
+	install -dD $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
+	cp $(COMPLETION) $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
 	# Special treatment for debpkg
 	install -dD $(DESTDIR)$(PERLMOD_DIR)
 	mv $(DESTDIR)$(BINDIR)/debpkg $(DESTDIR)$(PERLMOD_DIR)

Reply via email to