0

I need to create a deb file from cmake that needs to build a directory in ${USER} on the target machine "{user}/some_directory". The problem is that the deb file on creation already resolve the ${user} and it does not use the ${user} on the target machine. What have I tried:

install(FILES ${APP_ROOT}/Configuration/${PROJECT_NAME}.xml

DESTINATION ${USER}/Run/${PROJECT_NAME}/Configuration)

Also, I tried to play DESTDIR make DESTDIR=/home/john install but this does not working on deb files on the target machine.

Thanks

Salma Elshahawy
  • 1,112
  • 2
  • 11
  • 21
Sahar
  • 1
  • In general, it is a wrong approach. a deb is designed for system installation, which should not touch user files. Ev install a system program and it will create files in user home (then run), or install a system script which create/copy files. But it is a bad idea. Refactor your thinking, to make uses happier and getting less problem later. In any case, do not change DESTDIR. This is a internal directory to build packages, not about destination on target system. – Giacomo Catenazzi Dec 07 '20 at 13:20
  • Thanks for your answer, yes you are right, I guess I need to refactor my solution, but just for the challenge is there a way to do it? – Sahar Dec 07 '20 at 17:54
  • I I wrote, DESTDIR is not the thing you think. It is about packing (so you should not change it): check https://stackoverflow.com/questions/11307465/destdir-and-prefix-of-make. So use prefix or just one of the `dh_` files to move files to a specific target. You will pay very high price if you install dpkg in user space. Trust me. When you break boundary of responsibility, you will have hard time (and also your users) to find the root of problems. [Maybe not tomorrow, but in few years]. There are many other tools for such tasks. – Giacomo Catenazzi Dec 08 '20 at 07:58

0 Answers0