Redmine #6581: Packaging fixes

https://dev.cfengine.com/issues/6581

Best reviewed commit by commit, and there are a lot of whitespace changes, so I recommend reviewing without whitespace (add ``?w=1`` to address bar).