1

To complete an install on Ubuntu necessitates adding postinst and prerm scripts to the package built with CMAKE. Adding the script files using SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA... was the easy part, however, when an install is attempted, Lintian complains about the quality of the package, specifically, the file permissions for postinst and prerm are not set properly to 755. After a considerable amount of searching for an answer one was found using FILE(COPY and setting the FILE_PERMISSIONS to OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE (755) before setting CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA. Now Lintian is still complaining about the package quality only this time the file permissions are set to 775 which includes GROUP_WRITE but that is not in the FILE_PERMISSIONS list. It is unclear how this is possible. The relevant snippet of CMAKE is posted below:

FILE(COPY ${installation_add_ins}/linux/postinst_in DESTINATION ${installation_add_ins}/linux/postinst 
    FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
) 

FILE(COPY ${installation_add_ins}/linux/prerm_in DESTINATION ${installation_add_ins}/linux/prerm
    FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
) 

SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${installation_add_ins}/linux/postinst;${installation_add_ins}/linux/prerm;")

What's even more interesting is that if "Ingnore and install" is selected, the package works as expected. Ubuntu's package manager appears to fixup the file permissions and both install and uninstall work properly. But this fact is not relevant to the question.

Why is GROUP_WRITE being set on the resultant file when it is not specified in the permissions?

ledlak
  • 11
  • 3

0 Answers0