www portfiles - inconsistent settings

Ryan Schmidt ryandesign at macports.org
Wed May 30 09:37:31 PDT 2012


On May 30, 2012, at 11:17, Bjarne D Mathiesen wrote:

> Ryan Schmidt wrote:
>> 
>> On May 30, 2012, at 10:44, Jeremy Lavergne wrote:
>> 
>>>> 3) we've got:
>>>>     /www/${name}
>>>>     /www/${name}/html
>>>>     /www/data/${name}
>>>>     /www/${name}/htdocs
>>>> these ought to brought in line.
>>>> My suggestion is : /www/${name}/html
>>> 
>>> Sounds good to me: all ports' files are contained in their own directories, making it easy to alias them into Apache (or nginx or what have you).
>> 
>> I tried to have this discussion some years ago and we did not reach an agreement. Some ports got modified to install into ${prefix}/www/${name} at that time because that seemed to make sense to me. I don't see what purpose adding an additional "html" directory serves. 
> 
> having the additional /html/ makes it possible to have additional
> directories in a consistent way eg :
>    www
>        postfixadmin
>            html
>            php-sessions
>            php-includes
>            php-tmp
>            mysql55
> 

You're proposing that "html" would be the document root? Many web apps are simply installed by copying their entire distribution into such a location; in fact, that's what we do for every web app port we have, as far as I know. Other web apps might be distributed with other files that don't belong in the document root. These apps will have already chosen a name for their document root directory, which might not be "html", and it might not be simple to change what they call it. Do we want to sign up for that effort?

Would the port be creating the php-* directories? I've not seen any port do that so far, so that would be new. How would PHP be configured to use those directories instead of the defaults? What if the web app is not PHP but some other language?

I've also not seen any port try to put its databases in its own directory. Ports like phpmyadmin might create databases, but they'll go wherever mysql databases usually go. I don't think it's proper for the port to decide to put the databases somewhere other than where the sysadmin wanted them to go.

Mysql allows you to upgrade to a newer version. So you might begin by using mysql51 but later upgrade to mysql55. Your databases can still be used. Should the directory name then really contain the mysql version number?

Not all web apps use mysql; some might use postgresql.


> 
>> 
>> If standardization is a goal, creating a portgroup might be useful.
>> 
> 
> Creating a PortGroup is at present _possibly_ a little beyond me ;-)
> But I can see the advantages as a lot of definitions and tests are the
> same for all www websites.

A portgroup is quite simple: it's an include file. Anytime you find yourself repeating code in several portfiles, it's time to think about making that a portgroup.





More information about the macports-dev mailing list