On 2005-09-19 22:33 +0100, Jon Dowland wrote: > Right now I am having a bit of trouble with the packaging, in relation > to the prefix/destdir business. It seems the debian approach to things > is to pass $(DESTDIR) to the Makefile during building (the Makefile's > argument may be called PREFIX, rather than DESTDIR). Forgive me if I am > wrong (highly likely, I think - I am feeling rather fatigued right now) > but it looks like, with 4.4.902, you can only influence these variables > at the configure stage. > > The problem there is that during the building of the .deb, debian's > tools configure, make and install the tools into a temporary > sub-directory somewhere (usually $PROGRAMROOT/debian/$SOMETHING, where > $SOMETHING is not determined by the scripts I write). They then analyse > the files in this subdirectory to create the list of files to > install/uninstall when the package is installed/uninstalled. > > It seems with GNU autoconf programs, what they do is pass --prefix=/usr > to the configure script, in order to get all that FHS stuff, then later > override it as part of the Makefile. > > Right now, I think I will have to either adjust the Makefile (or > Makefile.in) to suppor overriding the BINDIR stuff that ./configure > provides; or pass a different --prefix to the configure script and fix > the FHS differences afterwards. I think the former is preferable. I don't know what your trade-offs are but I think you could prefix all occurrences of "$BINDIR" and "$MANDIR" in configure with "\$(DESTDIR)". Simple and, I think, robust. --- configure 2005-09-02 14:34:09.000000000 +0200 +++ configure-debian 2005-09-21 00:01:28.000000000 +0200 @@ -520,7 +520,7 @@ echo "# DO NOT EDIT -- generated by ./configure" echo echo "AWK = $AWK" - echo "BINDIR = $BINDIR" + echo "BINDIR = \$(DESTDIR)$BINDIR" echo "CC = $CC" echo "CFLAGS = $CFLAGS" echo "ETCDIR = $ETCDIR" | sed "s/%v/$VERSION/g" @@ -528,7 +528,7 @@ echo "HAVE_INTTYPES = $HAVE_INTTYPES" echo "HAVE_SNPRINTF = $HAVE_SNPRINTF" echo "LDFLAGS = $LDFLAGS" - echo "MANDIR = $MANDIR" + echo "MANDIR = \$(DESTDIR)$MANDIR" echo "SHAREDIR = $SHAREDIR" | sed "s/%v/$VERSION/g" echo "SHAREDIRNV = $SHAREDIRNV" echo You'll also have to modify Makefile.in to call install(1) with the -D option. Something along these lines : --- Makefile.in 2005-09-21 00:05:08.000000000 +0200 +++ Makefile.in-debian 2005-09-21 00:06:49.000000000 +0200 @@ -215,9 +215,9 @@ >$@ install: - install -p -m 0755 deutex $(BINDIR) - install -p -m 0755 deusf $(BINDIR) - install -p -m 0644 deutex.6 $(MANDIR)/man6 + install -D -p -m 0755 deutex $(BINDIR)/deutex + install -D -p -m 0755 deusf $(BINDIR)/deusf + install -D -p -m 0644 deutex.6 $(MANDIR)/man6/deutex.6 if [ -d $(MANDIR)/man6/deusf.6 ]; then rmdir $(MANDIR)/man6/deusf.6; fi ln -sf deutex.6 $(MANDIR)/man6/deusf.6 I may add the -D upstream because it's general enough, although I'm not 100% sure it's right ; are there cases where you want make install to fail if $(PREFIX) doesn't exist ? -- André Majorel <amajorel@xxxxxxxxx> http://www.teaser.fr/~amajorel/