Subject: Binary packages (was: DEC uses NetBSD)
To: None <current-users@NetBSD.ORG>
From: Jesus M. Gonzalez <jgb@gsyc.inf.uc3m.es>
List: current-users
Date: 03/20/1997 18:56:17
	One of the greater problems of binary packages is that they
use to be `fascists' with respect to where they are installed.
The subject has arisen several times in this list, and I think
people will never agree on any convention. And probably that's
a good thing... And there is a way of keeping everybody happy:
use some `customary' scripts for `postconfiguring' binaries.
For executable programs, this is just a script that sets up the
environment as you want, and then launches the applciation. For
a man page, it could be a script that installs the man page in the 
desired directory and then runs the correct version of `makewhatis'.
It isn't hard to do, ineficiency due to using scripts for launching 
apps is not that great, and the task can be easily automated.
The installation tool (pkg_add, for instance) could provide this
interaction:

% pkg_add --install_dir /mix/netbsd-1.2-i386/install \
	--bin_dir /mix/netbsd-1.2-i386/bin \
	--man_dir /mix/share/man \
	my_pretty_app-0.0.tar.gz

	The program will install the app under 
/mix/netbsd-1.2-i386/install/my_pretty_app-0.0, with a script called
/mix/netbsd-1.2-i386/bin/my_pretty_app and a man page linked from
/mix/share/man. The script (generated on the fly by pkg_add from the
application postconfiguration file) could be something as:

#!/bin/csh -f
setenv MY_PRETTY_APP_LIBS /mix/netbsd-1.2-i386/install/my_pretty_app-0.0/lib
setenv MY_PRETTY_APP_DOC /mix/netbsd-1.2-i386/install/my_pretty_app-0.0/doc
/mix/netbsd-1.2-i386/install/my_pretty_app-0.0/bin/my_pretty_app $*

	(if we suppose MY_PRETTY_APP_LIBS and MY_PRETTY_APP_DOC env
variable have some meaning for the app).

	In most cases, this is enough for installing wherever you
want, without recompiling anything.

		Jesus.

-- 
Jesus M. Gonzalez Barahona         | addr.:  c/ Butarque, 15
Grupo de Sistemas y Comunicaciones |         28911 Leganes, Spain
Departamento de Informatica        | tel: +34 1 624 94 58
Universidad Carlos III de Madrid   | fax: +34 1 624 94 30
e-mail: jgb@gsyc.inf.uc3m.es       | www: http://www.gsyc.inf.uc3m.es/~jgb