Dmitry Marakasov writes:

[...]

>> Maybe we can introduce a hack in ports system like by adding some
>> variable like 'USES_DYNAMIC_PLIST=yes' in Makefile, which fill let the
>> port first installed with DESTDIR=/var/tmp/ports/${PORTNAME} and then a
>> packing list is generated and then finally whole tree is moved to
>> ${PREFIX}, hmm...? What do you say ?

> Current DESTDIR implementation uses chroot and obviously requires
> complete system installed in DESTDIR. Also installing a port will
> install all dependencies in the chroot as well.

The Debian package building system, also expects the package files in a
directory named ${packageroot}/debian/${packagename}/ which you can
install by doing 'make install DESTDIR=debian/${packagename}' in
${packageroot} directory (the directory where you've extracted the
package tarball, similar to the FreeBSD's ${WRKSRC} directory.

So, my idea is to specify "make -C ${WRKSRC} install 
DESTDIR=/var/tmp/${PORTNAME}"
in the "install" target of port's Makefile, not to be confused with
upstream package's Makefile. And I think you confused it with passing
'DESTDIR' variable to 'make' commandline to start port building
procedure:

Following is an example illustrating how port is going to be installed
in the way I'm thinking:

,----
| % sudo make -C /usr/ports/editors/emacs-cvs install
| ...checkout from CVS...
| ...configuring...
| ./configure --prefix=${LOCALBASE} <...and other configure options ...>
| ...configuration messages...
| ...compilation begins...
| make
| ...compiling the files...
| ...compilation over...
| make install DESTDIR=/var/tmp/emacs
| ...files being copied to /var/tmp/emacs directory...
| ...package list creation...
| ...package list finished...
| ...copying files into ${LOCALBASE}...
| ...end copying files...
| ...package installed successfully...
`----

The package list can be created via he automated package-list creation
method[1] documented in porters-handbook with a 'mtree' command executed
in 'pre-install' to prepare the '/var/tmp/${PORTNAME}' prior to
installing package. And to assure safety to this procedure, ports should
be built with a separate unprivileged user 'portbuilder' whose job is
to build ports and install them in '/var/tmp/${PORTNAME}', and create a
temporary package list. And to perform the actual installation, the port
process should switch to 'root' user.

> There was proposal of another implementation that would behave as
> you describe without chroot, but it would require too much work,
> as most ports will need hacks so they install software into
> ${DESTDIR}/${PREFIX}, but the software would think that it's installed
> into ${PREFIX}. That is not even always possible, so the idea was
> dropped.

> Thus, the only reliable way to generate plist with standart tools
> is using fat chroot.

> My idea however is monitor all filesystem writes by port's make and all
> descendant processes. That may be done with monitoring or replacing
> syscalls and may be done with LD_PRELOAD or some *trace kernel
> facilities. The former is what I'm currently experimenting with.

This is also a cool way if something like this can be hacked ? How about
using truss or other syscall tracing facilities, hmm..?

Thanks for the links and replies.

References:
[1] - http://www.freebsd.org/doc/en/books/porters-handbook/plist-autoplist.html

-- 
Ashish Shukla

Attachment: pgphIObrzBn48.pgp
Description: PGP signature

Reply via email to