44 lines
953 B
PHP
44 lines
953 B
PHP
<?php
|
|
|
|
namespace Packaging\Tasks;
|
|
|
|
class Package extends \Robo\Tasks
|
|
{
|
|
/**
|
|
* Installs the package
|
|
*
|
|
* @option prefix Location to install package to
|
|
*/
|
|
function packageInstall($opts = ['prefix' => "/usr"])
|
|
{
|
|
|
|
if(!file_exists(getcwd()."/build/krnlupdate.phar"))
|
|
{
|
|
$this->packageBuild();
|
|
}
|
|
$this->_copy(getcwd()."/build/krnlupdate.phar", $opts['prefix']."/usr/sbin/krnlupdate.phar");
|
|
}
|
|
/**
|
|
* Removes the package
|
|
*
|
|
* @option prefix Location to remove package from
|
|
*/
|
|
function packageRemove($opts = ['prefix' => "/usr"])
|
|
{
|
|
$this->_remove($opts['prefix']."/usr/sbin/krnlupdate.phar");
|
|
}
|
|
|
|
/**
|
|
* Builds the package
|
|
*/
|
|
function packageBuild()
|
|
{
|
|
|
|
|
|
$this->taskComposerInstall()
|
|
->dir(getcwd())
|
|
->run();
|
|
$this->taskExec("box compile")->run();
|
|
|
|
}
|
|
} |