FreeBSD packages are binary packages (see pkg(7)). While you theoretically can create a bottom up binary package it would be very unusual. You would rather start with a ports(7) source based "port" and use this as the origin of your package. Even if you only have a binary source.
This is then very well documented in the FreeBSD Porter's Handbook.
You can create your own local packages if you want. If you have a vanilla FreeBSD system then the binary packages are installed from the default FreeBSD repositories. These packages are all made from the ports tree with the default config options.
You can use the command-line tools but an easy shortcut would be to browse Freshports. If we look at bind-tools we see the following defaults:
===> The following configuration options are available for bind-tools-9.18.24:
FIXED_RRSET=off: Enable fixed rrset ordering
IDN=on: International Domain Names support
JSON=on: JSON file/format/parser support
LARGE_FILE=off: 64-bit file support
====> GSSAPI Security API support: you have to select exactly one of them
GSSAPI_BASE=off: Using Heimdal in base (nsupdate is broken)
GSSAPI_HEIMDAL=off: Using security/heimdal (nsupdate is broken)
GSSAPI_MIT=off: Using security/krb5
GSSAPI_NONE=on: Disable
===> Use 'make config' to modify these settings
So if you build your port locally you can change these settings using make config
. If you just want to use it locally you can do a make install
. But if you want to have a binary package of this variant then simply do a make package
.
If you are doing a port/package from scratch then you can see how to setup the makefile options. Notice that they can also be grouped as radio choices (as with GSSAPI above).
Common shared dependencies are usually handled with USES Macros such as Python.
Historically you made slave ports to handle invariants. But the more modern apporach it to have flavors. This is especially common with Python but please remember to be as liberal in the version selection as possible.
The architecture is then different from Debian. There are no "recommendations" as such. You would rather make the minimal viable package and then make the optional dependencies selectable in the port using options. The "alternatives" will be handled in the port again with options. Your example would then be with a radio group to allow either curl
or wget
. To have that reflected in your binary packages you would then create flavors.
If you want to create your own repository or are doing this as part of a CI pipeline then you should have a look at Poudiere which is the same building tool used for the official repositories.