I build a debian package with cmake/cpack.I want the deb execute a bash script after i install the deb.I install the deb use sudo dpkg -i my.deb.if I install the deb like that, the installed program's user and group is root. so I want the deb auto-execute a bash script to modify the user and group using the current logged user and group.
I search the infomations about this with Google.I find SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA, ./script/postinst) can do this.So I do like that,but there is no use with it.
I do like this:
install(PROGRAMS ${CMAKE_SOURCE_DIR}/script/postinst DESTINATION ./script)
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME "mydeb")
set(CPACK_PACKAGE_VERSION "1.0")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "George")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA, ./script/postinst)
set(CPACK_PACKAGING_INSTALL_PREFIX "usr")
include(CPACK)
the postinst is a bash scritp to modify the installed program's user and group with the current logged user and group
If some thing is wrong ? I need help