diff --git a/CHANGELOG-0.0.4.md b/CHANGELOG-0.0.4.md new file mode 100644 index 0000000..8b53ee2 --- /dev/null +++ b/CHANGELOG-0.0.4.md @@ -0,0 +1,3 @@ +# BC Breaks + +* Build will returns the dpkg command instead print it to the user diff --git a/README.md b/README.md index 4d0c0c7..71bab00 100644 --- a/README.md +++ b/README.md @@ -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 ``` - + diff --git a/src/example.php b/example.php similarity index 91% rename from src/example.php rename to example.php index 00cd7e6..61e952b 100644 --- a/src/example.php +++ b/example.php @@ -23,5 +23,5 @@ $packager->mount(__DIR__ . "/../../diff", "/my-differ"); //Creates folders using mount points $packager->run(); -//Creates the Debian package -$packager->build(); \ No newline at end of file +//Get the Debian package command +echo $packager->build(); diff --git a/src/package.xml b/src/package.xml deleted file mode 100644 index a701ff0..0000000 --- a/src/package.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - Corley_Deb_Packager - pear.corley.it - Corley DEB packager. - - This library provides mechanisms for generate valid .deb files useful - for software distribution for GNU/Linux Debian based systems. - - - Walter Dal Mut - wdalmut - walter.dalmut at corley.it - yes - - - Gabriele Mittica - gmittica - gabriele.mittica at corley.it - yes - - 2012-06-04 - - - 0.0.3 - 0.0.3 - - - alpha - alpha - - MIT - In this release the first proposal. - - - - - - - - - - - - - - - - - - 5.3.3 - - - 1.4.0 - - - - - diff --git a/src/wdm/debian/Packager.php b/src/wdm/debian/Packager.php index 3299e22..9f2a40b 100644 --- a/src/wdm/debian/Packager.php +++ b/src/wdm/debian/Packager.php @@ -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; } } diff --git a/tests/wdm/debian/PackagerTest.php b/tests/wdm/debian/PackagerTest.php new file mode 100644 index 0000000..8c6bb0e --- /dev/null +++ b/tests/wdm/debian/PackagerTest.php @@ -0,0 +1,17 @@ +object = new Packager(); + } + + public function testRetrieveTheBuildCommand() + { + $this->object->setOutputPath("/tmp"); + + $this->assertEquals("dpkg -b /tmp my.deb", $this->object->build("my.deb")); + } +}