How do I create a ready-to-install package from a machine that already has that package installed?
Change the directory to the directory where you want to place created packages. Best way to create a package from locally installed package is:
pkg_create -v -x -b [pkg_name] -R
-v… be verbose and write what you are doing
-x… use basic regular expressions to determine the package name
-b… means create a package from locally installed package
-R… create all packages that are required by the specified package
You will most likely use this function to compile and install a port on a fast machine, then create a binary package and install it on a slower machine where compilation would take hours.
Remember to change the current directory before running the command to the directory where you want the resulting packages to be placed. This command always produces the packages in the current directory.
Example:
I used this command to produce a binary package of dvd+rw-tools built from ports on a fast machine. It produced two packages in the current directory, cdrtools-2.01_4.tgz and dvd+rw-tools-6.0_2.tgz.
pkg_create -v -x -b dvd+rw-tools -R