Hi gang, a quick update on my little PortsBuild project. I'm working on it during my spare time, but a lot has been done in terms of system design & documentation (more on that below).
I've noticed the latest CustomBuild supports pkgng, although I am not quite sure how much of the code is fully ported over. Regardless, I've converted 3 production servers (8.4, 9.1, soon 9.3) over from pkg_tools to pkgng for over 3 weeks now without issues. I recently used CustomBuild to update my systems to PHP 5.4.34 and MySQL 5.5.40, only to come across compiler troubles (
had to use gcc48, as pointed out by @smtalk). Exim and Dovecot updated without hiccups.
Last month, while I was stuck on a plane going to Japan for 13 hours (and another 11 hours coming back) so I started writing PortsBuild by studying CustomBuild 2.0-RC7 and replacing its functions with one-liner portmaster commands. CB's 15,000 lines of code ended up getting reduced by 50%, with a lot of Linux-specific checks removed. That's when I realized @smtalk was in the middle of adding pkgng support to a few applications, and how much blood and sweat he puts into something thousands of DirectAdmin sysadmins use everyday. Furthermore, I went on to study setup.sh by DirectAdmin, used once for the installation of DA on a fresh system. This is where I plan PB to shine.
Two weeks ago, I realized PortsBuild is only really needed in two distinct situations: 1) first time DirectAdmin installation (hijack setup.sh calls to CustomBuild) and, 2) guide the sysadmin on updating Ports correctly. Of course, the third situation is when an admin decides to swap applications, e.g. Apache to nginx, which is quite involving to say the least (and something PB won't do initially, if at all). Now, regarding #2, an administrator can simply use
portmaster to update their system if they wish to do so (which is what I do when updating ClamAV, SpamAssassin, libraries, PureFTPd, etc.) and only reference PortsBuild's documentation for special cases. PortsBuild does not necessarily need to handle your packages: 'portmaster' already does an excellent job in terms of package management in my opinion, so there is no need to reinvent the wheel.
Since I started PortsBuild for over a year ago, I've been documenting and learning what DirectAdmin and CustomBuild does when installed on a system. I've frequently scoured
http://help.directadmin.com, and have religiously read every single DA changelog since I started using the software.

I know where most configuration files end up and how applications need to be compiled, and have had tons of experience when things go wrong (and how to fix them). This brings us to PortsBuild's true purpose and design goal: to bridge the gap between DirectAdmin and FreeBSD+Ports. Essentially, I've written down the necessary steps involved to convert a system to Ports. An example I gave to a fellow DA user via PM was with Exim+ClamAV+SpamAssassin (off the top of my head, shortened):
- Do not follow these steps. Not tested for production use!
- # portmaster -d mail/exim mail/spamassassin security/clamav mail/sa-utils
- Enable certain features via config dialog, e.g. pyzor, razor-agents, etc.
- Symlink /etc/exim.conf to /usr/local/etc/exim.conf (for increased compatibility with DA, in case a future upgrade looks for the file there)
- Symlink SA binaries in /usr/bin/* to /usr/local/bin/*
- Symlink /etc/mail/spamassassin to /usr/local/etc/mail/spamassassin/
- Change path of sa-learn in SpamBlocker's exim.conf (/usr/bin/spamc => /usr/local/bin/spamc)
- Installation of p5 Perl modules for SpamAssassin runtime (e.g. p5-Net-Patricia, not auto-installed)
- Modify /usr/local/etc/clamd.conf as needed
- Modify /usr/local/etc/mail/spamassassin/local.cf
- Modify /etc/rc.conf and add:
Code:
exim_enable="YES"
clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"
spamd_enable="YES"
spamd_flags="-c -m 15"
- ... and so forth.
From what I can tell, DirectAdmin is ready to take on FreeBSD 10.x with nothing but Ports (my opinion). I've been running large Magento installs on FreeBSD 9.x/10.x machines with Apache (or nginx) with PHP-FPM and MariaDB 5.5 for years (without any control panels) so I am pretty confident interfacing DA is just a matter of having it access the configuration files in the right places by modifying 'directadmin.conf' and/or symlink as required. I am going to test a fresh new install of this type of setup (DirectAdmin, Apache, PHP-FPM, MariaDB, Exim, SpamAssassin, ClamAV and PureFTPd) in 2-3 weeks with a spare DA license I have, once I finalize hardware upgrades on a ESXi host. I'm hoping to have some good news soon.