How to install the same port twice but at different locations?

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri Dec 8 14:15:39 PST 2006


Alexis Dorais-Joncas wrote:
> Hi all,
> 
> Subject says it all. I would like to install the package phpMyAdmin on
> two different locations on my server. Is this doable? If so, how?
> 
> I'm using  FreeBSD g-noc.net 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu
> Nov  3 09:36:13 UTC 2005    
> root at x64.samsco.home:/usr/obj/usr/src/sys/GENERIC  i386 with ports
> updated daily with cvsup.
> 
> Right now, after I do :
> cd  /usr/ports/databases/phpmyadmin
> sudo make PREFIX=/xxx/yyy install
> 
> I get :
> pkg_info|grep Admin
> phpMyAdmin-2.9.1.1  A set of PHP-scripts to manage MySQL over the web
> 
> And when I try to install it again but using a different PREFIX, I get
> this :
> ===>  Checking if databases/phpmyadmin already installed
> ===>   phpMyAdmin-2.9.1.1 is already installed
>      You may wish to ``make deinstall'' and install this port again
> 
> Using FORCE_PKG_REGISTER unregisters the first installation, so its no
> good for this I guess.

The problem is not so much installing the PHP code in two different
locations, which you can do quite simply by playing with the PREFIX
settings, but trying to register the same thing two times in the package
DB.

Hmmm... The only way I can see to deal with this is to use a separate
package database for the second installation.  Something like:

    setenv PREFIX /some/where/else
    setenv PKG_DBDIR /var/db/pkg-some-where-else
    mkdir -p /var/db/pkg-some-where-else
    cd /usr/ports/databases/phpMyAdmin
    make install

Note: this install will find and use all of the dependencies installed
to support the first instance of phpMyAdmin.  If you're doing multiple 
installs to support using phpMyAdmin in a jail then there are better
methods.  Probably the most conceptually simple method is to null-mount
/usr/ports under your jail directory, then log into the jail and work
inside it.  However that does require having a 'fat' jail with a complete
system environment inside it.

This is the functionality that DESTDIR was invented to support
(ie. installing in a location that is different to the way the location
will appear in use) -- unfortunately DESTDIR support is being reworked
and isn't fully available yet.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20061208/e1e83139/signature.pgp


More information about the freebsd-questions mailing list