3

How do you add new files, eg custom init script into .deb package that you're building?

Flint
  • 3,201

1 Answers1

5

Flint, the simplest way is to add the file to debian/install, or debian/binary-package-name.install. The format of the file is

source/relative/to/source/root destination/relative/to/system/root

So if you want to put contrib/scripts/admintool into /usr/bin/foo-admintool You'd do:

contrib/scripts/admintool usr/bin/foo-admintool

dh_install, which reads these, is fairly smart and will try to set permissions to the right values.

Specifically for init scripts, there is dh_installinit. You should probably read man dh_installinit to understand it fully, but basically if you have

debian/package-name.foo.init

It will be installed as /etc/init.d/foo and setup to start on installation/boot.

Subsequently, if you write an upstart job

debian/package-name.foo.upstart

Will be put in as /etc/init/foo.conf

And a symlink will be created as /etc/init.d/foo that points to an upstart wrapper for sysv compatibility.

SpamapS
  • 20,110