Posts tagged with "pkgsrc"


Testing pkgsrc on my MacBook Pro

Testing whether I got the NetBSD pkgsrc system installed properly on my MacBook Pro. Everything seems to be in order! Now to install Gnumeric and other free and open source goodness.

% uname -mrs
Darwin 9.7.0 i386
% figlet Rubenerd
 ____        _                             _
|  _ \ _   _| |__   ___ _ __   ___ _ __ __| |
| |_) | | | | '_ \ / _ \ '_ \ / _ \ '__/ _` |
|  _ <| |_| | |_) |  __/ | | |  __/ | | (_| |
|_| \_\\__,_|_.__/ \___|_| |_|\___|_|  \__,_|

Installing Alpine on Mac OS X

Build options available for Alpine in MacPorts
Build options available for Alpine in MacPorts

I've been asked by a few people on Twitter how I installed the lightweight Alpine console based email client on my Mac. Alpine of course is the current version of the pine email software that addressed some concerns about licencing. I love Alpine, and the logo reminds me of the classic Altavista :).

As with most free and open source software, by far the easiest way to get it running is just to install it from a package manager. You can go ahead and fetch the source tarball and do the usual ./configure, make, make install and make clean, but it does have several dependencies which in turn have several dependencies. You know what I mean.

MacPorts
For MacPorts, grab yourself the latest version and install just as you would any other Mac software that uses a setup assistant. Once you're up and running it's simply a matter of firing up your Terminal.app and entering in # port -v install alpine.

By entering # port variants alpine you can see all the custom options you can set. If you want to compile Alpine with one or more of these custom options, use the same install command above but append the options you want with plus signs. For example, if I wanted password files support I'd enter # port -v install alpine +passfile.

Fink
I haven't used Fink myself much, but according to their online package manifest it is available.
NetBSD's pkgsrc
If you use pkgsrc for Mac OS X/Darwin, Alpine can be found in the ./mail/alpine directory in your pkgsrc tree. Once you're in the right directory, it's the usual routine of # bmake install clean clean-depends. As with all pkgsrc packages on OS X, remember to use bmake NOT make otherwise it won't work.

If you're interested in trying the sophisticated and elegant pkgsrc system on your Mac, I wrote up a tutorial in a previous post you can use to get yourself up and running with it.

Happy emailing!


My HiME NetBSD desktop background whatnot

As I said in my previous post about running NetBSD's pkgsrc on Mac OS X, I hurriedly created a couple of desktop backgrounds for a fellow student and MacBook Pro user a few months ago who has since moved her entire machine over to NetBSD. It should have probably just stayed on my anime and show blog but I figure it's tech enough to put here.

ASIDE: While I dabbled in Red Hat Linux 5.x at the time, NetBSD was the first Unix-like operating system I really used. I personally have since moved over to FreeBSD on my desktops, but NetBSD still holds a special place with me. And I am still an avid user of pkgsrc!

The orange flower is a photo I took from my wildflower photoset around Mawson Lakes here in Adelaide, Mai Tokiha is the protagonist from the My-HiME anime series which I have yet to watch but he thinks is trippy, and the logo is of course from the NetBSD Project. This was one of the only combinations of orange things I could find on such short notice; had her presentation been a few weeks later I could have probably created something a bit better!

The resolution is 1440x900, but if you're a NetBSD desktop user, or a pkgsrc on Mac OS X (or Slackware, or Draco Linux, or...) user on a MacBook it would scale down just fine on 1280x800 too.


Colour version, 1.9MiB PNG


Achromatic version, 1.1MiB PNG


Notes on using NetBSD's pkgsrc on Mac OS X

pkgsrc on Mac OS X
I'm a kid in a chocolate shop! Look at all this stuff!

While there is an abundance of above average quality applications for Mac OS X, many tend to be more expensive and less feature complete than similar free and open source applications available on Linux, FreeBSD and the like. On Mac OS X we have the fantastic and easy to use MacPorts and Fink package managers, but if you're really serious about running said software you can't beat pkgsrc.

The pkgsrc system is the mature, elegant, sophisticated (can you tell I like it yet?) and cross platform package manager developed and used by the folks over at the NetBSD project. It's also used as the default package manager on DragonFly BSD and Draco GNU/Linux amongst others. I use it on my Macs, my Slackware Linux machine and even on a FreeBSD box, and I love it.

In this post I'll be describing what I've found to be the quickest and simplest way to get it up and running on Mac OS X. There are hundreds of other ways, but I've never gone wrong with this.

Case sensitivity!

The only caveat with pkgsrc is that you really need to run it on a case sensitive file system which OS X does not use by default. If reformatting isn't an option, might I suggest using Leopard's new Disk Utility to shrink your current boot volume and creating a separate, case sensitive HFS+ volume.

ASIDE: Some of the NetBSD documentation describes creating virtual disk images and running pkgsrc from them if case sensitivity is an issue. While it is technically possible, I wouldn't recommend it; from experience I've found them to be more trouble than they're worth. If you'd like to give it a go though, the Darwin platform notes on the pkgsrc user guide details the procedure.

Installing pkgsrc

Firstly, open your Terminal, navigate to /usr/ (or your new case sensitive volume you created earlier) and download a pkgsrc snapshot. This may take a while.

% cd /usr/
% sudo env CVS_RSH=ssh cvs -d \
anoncvs@anoncvs.NetBSD.org:/cvsroot checkout pkgsrc

Next, launch the bootstrap procedure which will create the required directories and install the utilities to build the packages:

% cd pkgsrc/bootstrap && sudo ./bootstrap

Congratulations, you now have pkgsrc installed on your Mac! The next step is to modify your shell's $PATH variable to point to the new binary directories, by default pkgsrc installs software in /usr/pkg. If you use the Tiger and Leopard default bash shell, your PATH line in your .profile should something like this:

export PATH=/usr/pkg/bin:/usr/pkg/sbin:$PATH

You'll also want to add these lines to make it easier to update your pkgsrc tree:

export CVS_RSH=ssh
export CVSROOT=anoncvs@anoncvs.netbsd.org:/cvsroot


Very quick background I created for a fellow MBP user who started with pkgsrc on their Mac and since moved over entirely to NetBSD, will be the subject of a future post. Mai Tokiha was the only character we could really find who wears lots of orange :).

Using pkgsrc

From this point forward, using pkgsrc is basically the same as using it on any other platform, the only difference is you use the bmake tool instead of make to build packages. If you haven't used pkgsrc before, below is a very quick crash course using Alpine as an example.

Browsing available packages
You can browse the /usr/pkgsrc/ directory, but the easiest way is to go to http://pkgsrc.se and either search for a specific piece of software, or browse the categories.
Building and installing a package

% cd /usr/pkgsrc/mail/alpine
% sudo bmake install clean clean-depends

Updating your pkgsrc tree

% cd /usr/pkgsrc
% sudo cvs update -dP

That's enough to get your started; once you've got the hang of it dive into the comprehensive and easy to follow pkgsrc guide by Alistair Crooks, Hubert Feyrer and the pkgsrc developers to learn all the cool things you can do with this package manager. I need a Rubenerd Seal of Approval or something :-)


Debian Etch for 5, then back to Slackware

For my university studies and to keep up to date with what's happening in the Linux world (given I'm a FreeBSD guy mostly) I decided to dual boot my new desktop machine with Debian GNU/Linux 4.0 Etch. In the past I'd always used Slackware to fill this role, but I figured I'd just try something new.

ASIDE: "Debian GNU/Linux 4.0 Etch" just doesn't roll off the tongue as well as "Slackware Linux 12" or "FreeBSD 7.0 Release". A ridiculously pointless observation, but one that I believe deserves recognition. And it would look just fab printed on a shirt.

Within a few minutes of starting the initial install, I got the following error:

Debian Etch failure

No common CD-ROM drive was detected? Are they serious?

Using the exact same optical drive I've been able to install the latest versions of FreeBSD, NetBSD, OpenBSD and Slackware Linux, not to mention a creaky old version of Windows 2000 and even IBM OS/2 Warp! And yet Debian GNU/Linux cannot even detect the drive after the initial boot phase?

I took it to be a sign to keep using Slackware for my Linux partitions. It's a shame, I was looking forward to seeing why people seem to love apt-get so much; I guess it's back to my FreeBSD desktop with the ports collection, and Slackware Linux with pkgsrc. Not that I'm complaining, it's still my favourite distribution!


Rzip is absolutely incredible

mikuru.jpg
Mikuru tried to compress my files too using her superpower energy. Rzip still worked better.

After reading an old post on Jeremy Zawodny's weblog and installing it myself, I have to say Rzip is my new favourite compression algorithm!

From the developer's website:

rzip is a compression program, similar in functionality to gzip or bzip2, but able to take advantage long distance redundancies in files, which can sometimes allow rzip to produce much better compression ratios than other programs. The original idea behind rzip is described in my PhD thesis.

For a bit of real world testing, I decided to try compressing the www folder in my home directory on my MacBook Pro. I thought this folder would be a useful test because it's relatively large and contains a few large files mixed in with hundreds of smaller ones. From what I understand of compression algorithms, they each tend to favour compressing certain types of files and in certain quantities so I figured this way it would show a more balanced result.

The original folder size was 436.0 MiB with 312 files. The Tape Archive is the control because it's needed for all but ZIP to archive the files before they can be compressed. For convenience the names also redirect to their associated Wikipedia pages.

Algorithm Extension File size % of original % saved
Tape Archive www.tar 423.9 MiB - -
ZIP www.tar.zip 290.9 MiB 68.62 31.38
Bzip2 www.tar.bz2 286.3 MiB 67.72 32.28
GNU zip www.tar.gz 284.8 MiB 67.54 32.46
Rzip www.tar.rz 104.7 MiB 24.70 75.30

What's curious is that Gzip was more efficient than Bzip2, in almost every other circumstance I've come across the reverse was true. I'm not sure how much that affected the results of the other formats. The final result is clear though, Rzip was able to squash like nobody else!

steamroller.jpg
Image © Jan Mehlich, from Wikimedia Commons. As with the image above, I thought it was mildly amusing given the subject matter. I hate dry weblog posts without pictures you see.

From what I can make out reading the developer's website; and with help from dadaist in real-time on Twitter; is that Rzip isn't an entirely new compression algorithm per-se, it essentially just uses larger chunks of data over much longer distances, and then uses existing algorithms to process it all.

I theorise from reading up on this that only in the last decade have computers had enough processing power, and more importantly memory, to be able to pull this off. 900MiB of looking space is great for compression, but can suck up all your resources pretty fast if you don't have much. This is why we haven't seen this level of compression until recently.

In any case, I know what I'll be using to compress all my large files and folders with now :).