Update packaging scripts

These haven't been tested - people keep on reintroducing gnuisms into the packaging scripts, which breaks them for BSD userlands :(