By popular demand I have been requested a tutorial about how to maintain your own pkgng repositories.
Currently the best solution for that is to use poudriere (ports-mgmt/poudriere).
Let say you want to maintain 2 repositories: 8.2-RELEASE i386 and 9.0-RELEASE amd64.
For that you will need an amd64 (to support both amd64 and i386 box with 9.0 binary support and 8.2 binary support, a default 9.0-RELEASE amd64 should be enough :)
poudriere only depends on zfs and sh, so you won't need much, just a zfs pool available.
First: install poudriere:
$ make -C /usr/ports/ports-mgmt/poudriere install clean
To be able to build the repository the host would also need to have pkgng installed (no need to convert it to pkgng anyway.)
$ make -C /usr/ports/ports-mgmt/pkg install clean
Now configure your poudriere, defining some configuration to /usr/local/etc/poudriere.conf:
BASEFS=/poudriere
ZPOOL=myzpool
FTPHOST=ftp.freebsd.org
POUDRIERE_DATA=/poudriere_data
RESOLV_CONF=/etc/resolv.conf
DISTFILES_CACHE=/usr/ports/distfiles
This should be enough (see poudriere.conf.sample for more informations)
Create the default ports tree:
$ poudriere ports -c
Create the two jails (in fact it will be chroot :))
$ poudriere jails -c -j 82i386 -v 8.2-RELEASE -a i386
$ poudriere jails -c -j 90amd64 -v 9.0-RELEASE -a amd64
Make them pkgng aware
$ mkdir /usr/local/etc/poudriere.d
$ echo "WITH_PKGNG=yes" > /usr/local/etc/poudriere.d/82i386-make.conf
$ echo "WITH_PKGNG=yes" > /usr/local/etc/poudriere.d/90amd64-make.conf
Add the list of packages you want to build:
$ cat ~/mylist1
editors/vim
www/nginx
$ cat ~/mylist2
www/firefox
editors/libreoffice
If you want special options just add them to you different make.conf in poudriere.d
to share options between all the jails managed by poudriere, add them to /usr/local/etc/poudriere.d/make.conf
You can now create your packages:
$ poudriere bulk -f ~/mylist1 -j 82i386
$ poudriere bulk -f ~/mylist2 -j 90amd64
When finished you will get 2 pkgng repositories in /poudrieredata/packages/82i386-default and /poudrieredata/packages/90amd64-default
You can now provide them through your webserver.
On you client boxes just:
$ echo "packagesite: http://yoururl/82i386-default" >> /usr/local/etc/pkg.conf
or
$ echo "packagesite: http://yoururl/90amd64-default" >> /usr/local/etc/pkg.conf
If your client box already has packages from an old installation, first convert it to pkgng
$ fetch http://yoururl/90amd64-default/Latest/pkg.txz
$ tar xf ./pkg.txz -s ",/.*/,,g" "*/pkg-static"
$ ./pkg-static add ./pkg.txz
$ pkg2ng
Now you can forget about pkg_install and pkg2ng
Just use pkgng (for example):
$ pkg update
$ pkg upgrade
$ pkg install firefox
To update your repository:
$ poudriere ports -u # this update your default ports tree
$ poudriere bulk -f ~/mylist1 -j 82i386 -k
$ poudriere bulk -f ~/mylist2 -j 90amd64 -k
bonus poudriere will rebuild only what has changed and what is impacted by this change.
Once it is done simply upgrade your client box:
$ pkg update
$ pkg upgrade
More informations on poudriere here