PHP code example of wapmorgan / php-rpm-packager

1. Go to this page and download the library: Download wapmorgan/php-rpm-packager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wapmorgan / php-rpm-packager example snippets




 = new \wapmorgan\rpm\Spec();
$spec
    ->setPackageName("my-package-name")
    ->setVersion("0.1.1")
    ->setDescription("My software description")
    ->setSummary('simple summary')
    ->setRelease('1')
    ->setUrl('http://...');
;

$packager = new \wapmorgan\rpm\Packager();

$packager->setOutputPath("/path/to/out");
$packager->setSpec($spec);

$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 rpmbuild command
echo $packager->build();

curl -sS http://getcomposer.org/installer | php

php composer.phar install

$(php pack.php)