What's needed to add a FreeBSD port as a package
I was recently asked to get Apple's Airplay/Airprint working on a pfSense-routed network where the iDevices were on a Wifi NIC and the printers/storage/iMac on wired NIC. Apparently multicast discovery can't traverse interfaces and if there's a simple pfSense rule option that would enable it, I couldn't find it on this forum (Apple uses mdns in the form of Bonjour, news to me, but probably well-known to others).
Judging by online posts, this is an issue for many people on many systems, and on pfSense Ahavi is one common approach. But digging deeper I found a stable and active FreeBSD port called "mdns-repeater" which is custom made for this issue. It's a fairly tiny daemon that takes a list of interfaces as its only params, and all it does is listen for incoming mdns on the stated interfaces and repeat them out on the other interfaces, allowing discovery. I tested it on my pfSense platform in debug/logging mode (which is the only other option it has!) and it worked well. Once mdns communication/discovery exists, other TCP/UDP ports would have to be opened for the actual data traffic but that's easy to do and could be made automatic I think.
As iProblematicDiscovery is a common issue (eg "bring your own" in the enterprise as well as in the home) and often raised online as an issue, and mdns-repeater is almost option-free "set and forget", I wonder if a package for Airplay/Airprint/mdns across IF's/networks would be useful to add. It looks simple enough to do and I can check how other packages work. As I haven't packaged a port before, what would be required to be done in github?
There is some info here: https://gist.github.com/jdillard/3f44d06ba616fec60890488abfd7e5f5
Also check the various pullrequests that are pending on the https://github.com/pfsense/FreeBSD-ports/pulls list.. In general a makefile and a small xml are needed and ofcourse the files needed for the gui/logic part of package itself.. Binaries generally come from a dependency on another port. :D
And last but no least, some patience while waiting for the package to get pulled :-\ .. No clue why some take so damn long..
The pfSense-specific files (xml, inc, php) and anything specific to pfSense's system is fine. But what about the original package from the FreeBSD ports repo. Will any changes be needed there, such as to the Makefile? Or are they straight copies of the original files, for the most part, provided that you aren't planning to modify the original pkg's functionality but just to use it "as-is" (as a pfSense package)?
To trigger a build of a FreeBSD port to be included in our package repo, it only needs its section/portname added to tools/conf/pfPorts/poudriere_bulk in the pfSense repo. For example, "sysutils/flashrom".
The other files and such all go in the freebsd-ports repo as has been mentioned.
Thanks - perfect answer. (Maybe add the info in the last 2 answers to dev package documentation?)