Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2002 06:35:05 -0800
From:      Cy Schubert - CITS Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>
To:        Stephen Hurd <shurd@sasktel.net>
Cc:        freebsd-ports@FreeBSD.ORG
Subject:   Re: Importance of using correct hierarchy for ports. 
Message-ID:  <200210311435.g9VEZ5KQ073409@cwsys.cwsent.com>
In-Reply-To: Your message of "Tue, 29 Oct 2002 14:11:51 CST." <20021029141151.5e803c78.shurd@sasktel.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20021029141151.5e803c78.shurd@sasktel.net>, Stephen Hurd 
writes:
> Well, I've got a popular BBS package that recently went GPL ported and runnin
> g great on FreeBSD... my question is how important is it ti use $PREFIX/bin, 
> sbin, etc, and so forth?  I'll have the port submitted by the time an actual 
> release of the software is out (most likely with the month) but it is really 
> used to having everything under one directory due to it's origin in the DOS w
> orld.  Not many places actually ASSUME that everything is in that dir, but a 
> good number of them do.  How acceptable is creating a new directory under $PR
> EFIX to contain the whole package?

I'm currently dealing with this issue in a couple of PR's. There are 
two major issues here:

1.  The application by default will install in ${PREFIX}/application. If
    the application is installed on Linux or some other platform, that's
    where you'd normally find it.

2.  The FreeBSD approach is to put layered products (and locally written
    stuff in ${PREFIX}. That's where our users expect it to be. Our
    default install configures the system to search directories in
    ${PREFIX} (default /usr/local) for PATH, LD_LIBRARY_PATH, etc. To 
put
    a port somewhere else would break POLA. Of course if a user wishes
    to put ${PREFIX} or an application somewhere else, that would be
    their business and POLA wouldn't apply.

Let's examine this issue in more depth. Let's say for example an 
application installs itself in /usr/local/application. A user 
knowledgeable in the application may expect it to reside in 
/usr/local/application because that's where it resides when installed 
on other platforms when installed by hand. Fair enough, looking at it 
from the perspective of someone familiar with the application, 
installing the application in ${PREFIX} (/usr/local) in their mind 
breaks POLA.

OTOH, let's assume that the average FreeBSD sysadmin is probably the 
same as most of of my customers, someone relatively new to UNIX, either 
with very little UNIX experience or with a fair degree of RedHat Linux 
experience.

If a person has very little UNIX experience to start with, in general 
it doesn't really matter where an application "lives", except that 
rc.conf, /etc/{profile,cshrc,csh.login}, .{profile,cshrc,login}, and 
other files may need to be changed before the application can be used 
(generally speaking -- there are always exceptions). So, for this class 
of user, it makes more sense to put applications into ${PREFIX}. It's 
just less aggrivating.

What about people with prior RedHat Linux experience. What can I say? 
RH Linux likes to put applications in /usr not /usr/local. IMO there's 
the UNIX way of doing things and the Linux way. For this class of user 
every version of UNIX is different from RH Linux. Whether we put an 
application into ${PREFIX} or ${PREFIX}/application doesn't matter much 
except that the rc.conf and the various profile scripts may need to be 
changed, meaning more fiddling around for the user.

What about people who are intimately knowledgeable about the 
application? They will expect the application to "live" in 
${PREFIX}/application. To put it anywhere else would break POLA for 
them. Unfortunately for them, there are many fewer of these people than 
average users who want to make it work as quickly as possible without 
learning too much about it.

The FreeBSD approach of putting applications into /usr/local is 
generally a wise approach. Of course there are exceptions, but 
generally we tend to follow this "rule". We can in a sense have our 
cake and eat it too. Take the following Makefile fragment as an example:

.if defined(APPLICATION_HOME)
PREFIX=		${APPLICATION_HOME}
.endif
CONFIGURE_ARGS=	--prefix=${PREFIX}

All an application purist needs to do is specify APPLICATION_HOME in 
his/her make.conf. Just a simple compromise that makes everyone happy.


--
Cheers,                          Phone:  250-387-8437
Cy Schubert                        Fax:  250-387-5231
Team Leader, Sun/Alpha Team      Email:  Cy.Schubert@osg.gov.bc.ca
Open Systems Group, CITS
Ministry of Management Services
Province of BC            
                    FreeBSD UNIX:  cy@FreeBSD.org



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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