The files that configure and command the Debian packaging and subsequent installation all reside in a directory named DEBIAN. Here are all the files I include in my DEBIAN directory:
- DEBIAN/conffiles
- DEBIAN/control
- DEBIAN/postinst
- DEBIAN/rules
Below are the contents of the files (contents changed to protect the proprietary)
-
DEBIAN/conffiles
...blank...
-
DEBIAN/control
Package: foo-for-bar Version: 1.0.40 Section: Network Priority: optional Architecture: all Depends: Maintainer: Jane Doe jane.doe@example.com Description: Acme FooBar WWW UI User interface for Acme FooBar.
-
DEBIAN/postinst
#!/usr/bin/env bash cat $0 chmod 777 /var/lib/foobar/conf/www/* chmod 777 /var/lib/foobar/* chmod 777 /var/lib/foobar/foobaringdaemon.py chmod 777 /etc/local.d/80_figlets_with_foobar.sh echo "hello there from postinst file"
-
DEBIAN/rules
...blank...
General File Structure
Let's say I want a .deb package to install files that will reside in the /var/www and /etc/local.d directories. In my case I'll create everything in the /home/ directory. Here is the root and first layer of directories.- /home/FOOBAR/DEBIAN
- /home/FOOBAR/etc
- /home/FOOBAR/var
cd /home/
dpkg-deb --build FOOBAR
The above dpkg-deb would create a file named FOOBAR.deb
To install the FOOBAR.deb package on a machine, you would run:
dpkg -i FOOBAR.deb
A parting note. I would rename my FOOBAR.deb to FOOBAR.1.0.40.deb to make evident the version number of the package.