BC Break packager - Simplifies packager maintenance

This commit is contained in:
Walter Dal Mut 2014-12-03 23:24:42 +01:00
parent f097b8cf31
commit 0c2ba5071d
6 changed files with 35 additions and 70 deletions

3
CHANGELOG-0.0.4.md Normal file
View file

@ -0,0 +1,3 @@
# BC Breaks
* Build will returns the dpkg command instead print it to the user

View file

@ -30,9 +30,16 @@ $packager->mount("/path/to/docs", "/usr/share/docs");
//Creates folders using mount points
$packager->run();
//Creates the Debian package
$packager->build();
//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
@ -45,7 +52,7 @@ Optianally you can add script for different hooks
* Run pre package remove
* post-remove
* Run post package remove
Adding scripts
```php
@ -67,4 +74,4 @@ echo "Goodbye Cruel World"
exit 0
```

View file

@ -23,5 +23,5 @@ $packager->mount(__DIR__ . "/../../diff", "/my-differ");
//Creates folders using mount points
$packager->run();
//Creates the Debian package
$packager->build();
//Get the Debian package command
echo $packager->build();

View file

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<package packagerversion="1.8.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd
http://pear.php.net/dtd/package-2.0
http://pear.php.net/dtd/package-2.0.xsd">
<name>Corley_Deb_Packager</name>
<channel>pear.corley.it</channel>
<summary>Corley DEB packager.</summary>
<description>
This library provides mechanisms for generate valid .deb files useful
for software distribution for GNU/Linux Debian based systems.
</description>
<lead>
<name>Walter Dal Mut</name>
<user>wdalmut</user>
<email>walter.dalmut at corley.it</email>
<active>yes</active>
</lead>
<contributor>
<name>Gabriele Mittica</name>
<user>gmittica</user>
<email>gabriele.mittica at corley.it</email>
<active>yes</active>
</contributor>
<date>2012-06-04</date>
<time>12:46:12</time>
<version>
<release>0.0.3</release>
<api>0.0.3</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<license uri="http://www.opensource.org/licenses/mit-license.php">MIT</license>
<notes>In this release the first proposal.</notes>
<contents>
<dir name="" baseinstalldir="/">
<dir name="wdm">
<dir name="debian">
<dir name="control">
<file role="php" name="StandardFile.php" />
</dir>
<file role="php" name="Autoloader.php" />
<file role="php" name="IPackager.php" />
<file role="php" name="Packager.php" />
</dir>
</dir>
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.3.3</min>
</php>
<pearinstaller>
<min>1.4.0</min>
</pearinstaller>
</required>
</dependencies>
<phprelease />
</package>

View file

@ -192,8 +192,8 @@ class Packager
$debPackageName = basename($this->_outputPath . ".deb");
}
$command = "dpkg -b {$this->_outputPath} {$debPackageName}" . PHP_EOL;
$command = "dpkg -b {$this->_outputPath} {$debPackageName}";
echo $command;
return $command;
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace wdm\debian;
class PackagerTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$this->object = new Packager();
}
public function testRetrieveTheBuildCommand()
{
$this->object->setOutputPath("/tmp");
$this->assertEquals("dpkg -b /tmp my.deb", $this->object->build("my.deb"));
}
}