magic to build package on different FreeBSD versions
Sometimes you may need to build some packages for older/newer versions of FreeBSD. That is simple if you use jail and other mechanisms.
In order to be successful, you need a “Full jail” say ordinary jail, installed with binary that is built from the target version of FreeBSD. For instance, build a 6.0 userland by sync’ing code to -HEAD.
Secondly, you need to replace two files in the jail: uname(1) and sysctl(1). What you have to do is to use sed to replace both FreeBSD version and __FreeBSDVersion (say, kern.osreldate), according to porters’ handbook.