Subject: GNU Makefile rules for debian preinst and postinst.

From: [email-masked] (Bruce Perens)
Date: Thu, 11 Jul 96 13:42 PDT

Ian Jackson & Co.,

Richard Stallman and I have been discussing how to change FSF's guidelines
so that GNU software would build Debian packages "out of the box". Given
standard targets in the GNU makefiles, it seems as if we could use the same
debian.rules file for all conforming GNU packages, and put most of the work
into the Makefile.

What we'd like to arrive at is a "preinst:" and "postinst:" target in the
makefile that would be run by "make install" when installing directly from
make, and would be run by "dpkg" when installing a Debian package. The
simplest way to do this would be to install "make" in the base system,
put the makefile in the /DEBIAN directory of the package, and have the
preinst and postinst scripts simply run "make -f package.makefile preinst"
and so on.

I also thought about generating the preinst and postinst scripts as shell
scripts by simply copying those targets out of the makefile.

Your thoughts on this would be much appreciated.

	Thanks

	Bruce
--
       Clinton isn't perfect, but I like him a lot more than Dole.

Bruce Perens AB6YM          [email-masked]            http://www.hams.com/

---

From: "Brian C. White" <[email-masked]>
Date: Fri, 12 Jul 1996 21:39:39 -0400

> preinst and postinst scripts simply run "make -f package.makefile preinst"

It's an interesting idea, but it has problems if the install scripts are
at all complex, or are written in a higher language like perl.  The gnats
install scripts, for example, are very long and are actually built during
the "debian.rules binary" phase from a collection of smaller scripts (each
written and tested independant of the others).

                                        Brian
                               ( [email-masked] )

-------------------------------------------------------------------------------
    In theory, theory and practice are the same.  In practice, they're not.

---

From: [email-masked] (Bruce Perens)
Date: Fri, 12 Jul 96 20:25 PDT

I have a proposal from RMS on this in my back mail - I'll dig it up and
forward it to you guys. At the moment I'm dealing with some home purchase
stuff.

	Bruce
--
The "Toy Story Animated Storybook" CD was the best selling software product
during the month of May, outselling the Windows '95 upgrade, Quicken, etc.
Bruce Perens AB6YM          [email-masked]            http://www.hams.com/

---

From: Ian Jackson <[email-masked]>
Date: Tue, 16 Jul 96 03:01 BST

> debian.rules file for all conforming GNU packages, and put most of the work

That sounds useful ...

> preinst and postinst scripts simply run "make -f package.makefile preinst"

That sounds rather ugly to me.

> scripts by simply copying those targets out of the makefile.

You could perhaps copy them out of the makefile and use the #!
technique to make them executable scripts, but of course dpkg will
pass all the wrong arguments.

> Your thoughts on this would be much appreciated.

How about splitting the preinst, postinst, prerm and postrm scripts
out as separate files, and having the main makefile simply call them ?

It might also be worth thinking about how this works with our new
source format ...

Ian.