Best practices for config files

Ryan Schmidt ryandesign at
Mon Feb 23 17:40:49 PST 2009

On Feb 23, 2009, at 19:29, Ryan Schmidt wrote:

> I suggest you install multiple sample config files and allow the  
> user to choose which of them to copy into place.

For example, consider mysql5 which provides you with these files:

$ port contents mysql5 | grep cnf

You can copy any of those sample config files to /opt/local/etc/ 
mysql5/my.cnf to use them, and then customize them further.

apache2 does this as well:

$ port contents apache2 | grep original

Again, the user is meant to copy any desired config file from /opt/ 
local/apache2/conf/original into /opt/local/apache2/conf and then  
edit it to suit.

Both of these ports leave the sample config files exactly as upstream  
provided them (in a separate directory, not renaming the files with  
the ".sample" extension). For software that does not already do that  
out of the box, the portfile author is expected to take similar  
measures (either put sample config files in a different directory or  
give them an extension that makes it obvious they are samples and not  
the real file the software will use).

More information about the macports-users mailing list