There are various tools around to create source and binary pakets for debian. But sometimes you just want to deploy some files in the file system, like scripts or web applications that are plattform independent. And it is also handy to run a post install script after the installation.
This post desribes how you can do this for debian packages. It copies a few files to a target location in the system and runs a post install script after the installation of the package.
The first step would be to create a sub folder "DEBIAN" in your project folder. This folder contains the specific fields that describe the debian package:
The DEBIAN folder needs at least to contain the "control" file. This control file contains meta information about the package. We also create a file "postinst" that contains a bash script that will be executed after the installation. We also need to make sure that the postinst file is executable:
For the control file (debpackage/DEBIAN/control) it is important, that the syntax is completly correct:
Beside the meta files in the DEBIAN directory we need for sure the acctual files that should be deployed. To achieve that you need to place the files into the root folder of the package as the should be deployed in the target system:
Finally, we need to build the package:
Building packages like this can only be used to deploye simple, plattform independent stuff, but in general the possibilities of the debian package system are very flexible. I