Make a copy of the current port:

cp -R <port-name> <port-name>.orig

Update crates if required by using:

make cargo-crates

Work on the port:

make makesum
make checksum
make stage
make check-orphans
make package
make install
make deinstall
make clean

Crete the diff, first change one level up:

diff -u port-name.orig port-name > port-name.diff

Submit the patch.


Test port with poudriere, for example:

poudriere testport -p default -j 14amd64 net/s3m