https://github.com/wdalmut/php-deb-packager
A PHP library to generate `.deb` packages (Software distribution)
https://github.com/wdalmut/php-deb-packager
debian debian-packages package packer php
Last synced: 10 months ago
JSON representation
A PHP library to generate `.deb` packages (Software distribution)
- Host: GitHub
- URL: https://github.com/wdalmut/php-deb-packager
- Owner: wdalmut
- Created: 2012-06-02T12:11:40.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2021-01-09T13:23:33.000Z (over 5 years ago)
- Last Synced: 2024-12-08T05:34:50.495Z (over 1 year ago)
- Topics: debian, debian-packages, package, packer, php
- Language: PHP
- Homepage:
- Size: 56.6 KB
- Stars: 54
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Debian packager (PHP)
* Develop: [](https://travis-ci.org/wdalmut/php-deb-packager)
* Master : [](https://travis-ci.org/wdalmut/php-deb-packager)
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:
```php
setPackageName("my-package-name")
->setVersion("0.1.1")
->setDepends(array("php5", "php5-cli", "php5-xsl"))
->setInstalledSize(4096)
->setMaintainer("Walter Dal Mut", "walter.dalmut@corley.it")
->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();
```
**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
```php
$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
```shell
#!/bin/sh
#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](https://github.com/wdalmut/php-deb-describe)