Submitted by Karl Janmar <karlj@mdstud.chalmers.se> in PR 22139, with several changes by myself. Original package from FreeBSD.