Overview
Various macros (CreateUser, InstallService, etc.) exhibit inconsistent behaviors between builders. This behavior should probably be standardized.
Details
When utilizing a preinst script in addition to the CreateUser setting, the Debian builder prepends a shebang and the code necessary to create the user onto the beginning of the existing script. In contrast, the RPM builder appends the code to create the user onto the end of the existing script, with no shebang.
This quickly becomes problematic for packages that need to be built for both types of Linux distributions.
My suggestion would be to add the create user code to the beginning, since other code in the script may involve assigning file/dir ownership for that user.
As for the InstallService code, I would recommend appending it to the end since it handles enabling the service. One note, though, is to begin it with a newline to avoid appending it in-line with the last line of the user's script code.
Overview
Various macros (CreateUser, InstallService, etc.) exhibit inconsistent behaviors between builders. This behavior should probably be standardized.
Details
When utilizing a preinst script in addition to the CreateUser setting, the Debian builder prepends a shebang and the code necessary to create the user onto the beginning of the existing script. In contrast, the RPM builder appends the code to create the user onto the end of the existing script, with no shebang.
This quickly becomes problematic for packages that need to be built for both types of Linux distributions.
My suggestion would be to add the create user code to the beginning, since other code in the script may involve assigning file/dir ownership for that user.
As for the InstallService code, I would recommend appending it to the end since it handles enabling the service. One note, though, is to begin it with a newline to avoid appending it in-line with the last line of the user's script code.