Sure. Extract the contents of the Debian package (using dpkg -x
), then create a file named preinst
in the DEBIAN directory. This has to be an executable (or a shell script) with proper permissions; usualluy 0755 is good enough. The contents may be as follows:
#!/bin/bash
mkdir -p /path/to/folder
Then re-create the package using dpkg-deb --build
, and it should be fine now.