Search code examples
cmakepackagedebcpack

CMake/CPack - Generate Debian Package Maintainer Scripts (postrm specifically)


My build "superbuilds" other projects, all of which may change at any time. It is far too tedious to manually create the postrm script every time we want to build...

Is there a way to generate the postrm script when building a Debian package with CMake/CPack?


Solution

  • I have found that the common answer is to use debhelpers, with something like cmake-debhelper, although I have not tried this.

    I accomplished this by creating two custom targets, one that executes make, and another which depends on the previous make target and runs a python script to generate the maintainer scripts followed by capck.