BC Break packager - Simplifies packager maintenance
This commit is contained in:
parent
f097b8cf31
commit
0c2ba5071d
3
CHANGELOG-0.0.4.md
Normal file
3
CHANGELOG-0.0.4.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# BC Breaks
|
||||||
|
|
||||||
|
* Build will returns the dpkg command instead print it to the user
|
11
README.md
11
README.md
|
@ -30,9 +30,16 @@ $packager->mount("/path/to/docs", "/usr/share/docs");
|
||||||
//Creates folders using mount points
|
//Creates folders using mount points
|
||||||
$packager->run();
|
$packager->run();
|
||||||
|
|
||||||
//Creates the Debian package
|
//Get the Debian package command
|
||||||
$packager->build();
|
echo $packager->build();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Create the Package**
|
||||||
|
|
||||||
|
```
|
||||||
|
$(php pack.php)
|
||||||
|
```
|
||||||
|
|
||||||
## Pre-Post scripts
|
## Pre-Post scripts
|
||||||
|
|
||||||
Optianally you can add script for different hooks
|
Optianally you can add script for different hooks
|
||||||
|
|
|
@ -23,5 +23,5 @@ $packager->mount(__DIR__ . "/../../diff", "/my-differ");
|
||||||
//Creates folders using mount points
|
//Creates folders using mount points
|
||||||
$packager->run();
|
$packager->run();
|
||||||
|
|
||||||
//Creates the Debian package
|
//Get the Debian package command
|
||||||
$packager->build();
|
echo $packager->build();
|
|
@ -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>
|
|
|
@ -192,8 +192,8 @@ class Packager
|
||||||
$debPackageName = basename($this->_outputPath . ".deb");
|
$debPackageName = basename($this->_outputPath . ".deb");
|
||||||
}
|
}
|
||||||
|
|
||||||
$command = "dpkg -b {$this->_outputPath} {$debPackageName}" . PHP_EOL;
|
$command = "dpkg -b {$this->_outputPath} {$debPackageName}";
|
||||||
|
|
||||||
echo $command;
|
return $command;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
17
tests/wdm/debian/PackagerTest.php
Normal file
17
tests/wdm/debian/PackagerTest.php
Normal 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"));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue