PHP code example of wdalmut / php-deb-packager

1. Go to this page and download the library: Download wdalmut/php-deb-packager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wdalmut / php-deb-packager example snippets




rol = new \wdm\debian\control\StandardFile();
$control
    ->setPackageName("my-package-name")
    ->setVersion("0.1.1")
    ->setDepends(array("php5", "php5-cli", "php5-xsl"))
    ->setInstalledSize(4096)
    ->setMaintainer("Walter Dal Mut", "[email protected]")
    ->setProvides("my-package-name")
    ->setDescription("My software description");
;

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

$packager->setOutputPath("/path/to/out");
$packager->setControl($control);

$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
$packager->run();

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

$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');

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

php composer.phar install

$(php pack.php)
shell
#!/bin/sh
#postinst script for upcloo

set -e

echo "Goodbye Cruel World"

exit 0