A simple debian packager for PHP applications

0.0.14 2017-07-18 10:07 UTC

This package is not auto-updated.

Last update: 2023-12-07 03:04:26 UTC


  • Develop: Build Status
  • Master : Build Status

A simple debian packager for PHP applications

Get composer:

curl -sS http://getcomposer.org/installer | php 

Install dependencies and autoloader

php composer.phar install

Use it:


require_once __DIR__ . '/vendor/autoload.php';

$control = new \wdm\debian\control\StandardFile();
    ->setDepends(array("php5", "php5-cli", "php5-xsl"))
    ->setMaintainer("Walter Dal Mut", "walter.dalmut@corley.it")
    ->setDescription("My software description");

$packager = new \wdm\debian\Packager();


$packager->mount("/path/to/source-conf", "/etc/my-sw");
$packager->mount("/path/to/exec", "/usr/bin/my-sw");
$packager->mount("/path/to/docs", "/usr/share/docs");

//Creates folders using mount points

//Get the Debian package command
echo $packager->build();

Create the Package

$(php pack.php)

Pre-Post scripts

Optianally you can add script for different hooks

  • pre-install
    • Run pre install
  • post-install
    • Run post install
  • pre-remove
    • Run pre package remove
  • post-remove
    • Run post package remove

Adding scripts

$packager->setPreInstallScript(__DIR__ . '/my-pre-install-script.sh');
$packager->setPostInstallScript(__DIR__ . '/my-post-install-script.sh');
$packager->setPreRemoveScript(__DIR__ . '/my-pre-remove-script.sh');
$packager->setPostRemoveScript(__DIR__ . '/my-post-remove-script.sh');

See a script example

#postinst script for upcloo

set -e

echo "Goodbye Cruel World"

exit 0

Use Yaml files instead the library directly

Just take a look to wdalmut/php-deb-describe