Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Dec 2006 16:17:16 -0500
From:      John Nielsen <lists@jnielsen.net>
To:        freebsd-questions@freebsd.org
Cc:        Alexis Dorais-Joncas <mailinglists+freebsd-questions@g-noc.net>
Subject:   Re: How to install the same port twice but at different locations?
Message-ID:  <200612081617.16270.lists@jnielsen.net>
In-Reply-To: <4579D1A1.7020806@g-noc.net>
References:  <4579C3D8.4050307@g-noc.net> <200612081445.33618.lane@joeandlane.com> <4579D1A1.7020806@g-noc.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Friday 08 December 2006 15:57, Alexis Dorais-Joncas wrote:
> Lane a écrit :
> > On Friday 08 December 2006 13:58, 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@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.
> >>
> >
> > Read through the porters' handbook,
> > http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/.
> >
> > You are interested primarily in PREFIX and DESTDIR, but all of the text
> > up to that point is enlightening.
>
> I think you misunderstood my problem. I know how to install a port to a
> specific location using PREFIX. What I want to achieve is to have one
> port installed twice. For example, I want one whole instance of
> phpMyAdmin to be in /var/www/ and a whole other one in /home/someuser/.
> And I want both instances to be manageable with the package tools (such
> as portupgrade) in order to keep both updated easily.
>
> Or have I totally missed the point with PREFIX/DESTDIR ?

What I have done in the past is create "slave" ports. Say the port you want to 
install twice is in ports/category/foo. Make a new directory 
ports/category/bar. Inside that directory, create a Makefile similar to this:

PORTNAME=		foo
PKGNAMESUFFIX=	_bar-duplicate
COMMENT=		This is the foo port but it installs as foo_bar-duplicate
PREFIX=		/path/to/alternate/prefix
# ...you may want other options here ...

MASTERDIR=		${.CURDIR}/../foo

.include "${MASTERDIR}/Makefile"


Install once from category/foo and once from your new port's directory and 
away you go. Again, the porter's handbook has lots of useful information 
about everything above.

JN



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612081617.16270.lists>