Macports: Some useful tricks

I have decided to jump ship from Fink over to Macports.  Out of the frying pan and into the fire perhaps, but Fink’s packages just don’t seem to be kept up to date as well as Macports.  I’m keeping a close eye on brew as well, although I too am skeptical of its dependence on Apple packaged software, especially when it comes to OS upgrades.

Anyway, here are some very handy tips that I have discovered in my travels.

Post-installation instructions

Some packages provide instructions on installation completion.  At times you may have ingored them or used tools such as Porticus to do the installation in which case the instructions are lost in the scroll from all the dependencies that went along with it.  So, there are a couple of commands that you can use to get this vital information back:

This command looks at the notes for a package (if it has any):

sudo port notes $packagename

If there are no notes, you can look at the portfile directly using:

sudo port cat $packagename

You will probably see some instructions to be printed at the end of the script

How do I start or stop daemon processes

So this always frustrates me, and each packaging system does it differently. Macports wraps some scripts around the launchd system of MacOS 10.4+. So you can use the launchctl load -w /Library/LaunchDaemons/${packagename}.plist to do it. But a more convenient way is to use the load/unload option to the port command.

sudo port load $packagename
sudo port unload $packagename

Sadly, this not only starts and stops the daemon process, but also enables or disables auto-startup at the same time. You can do things separately, or at least not without knowing the individual package’s startup scripts.

As I come up with new tips and tricks, I’ll add them to this blog post.

Damien.

One thought on “Macports: Some useful tricks

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: