2017 © Pedro Peláez
 

library php-rpm

RPM packager for PHP applications.

image

plehanov/php-rpm

RPM packager for PHP applications.

  • Friday, February 9, 2018
  • by Takamura
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

RPM packager (PHP)

Latest Stable Version Total Downloads License Code Climate Issue Count, (*1)

A simple rpm packager for PHP applications., (*2)

Get composer:, (*3)

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

Install dependencies and autoloader, (*4)

php composer.phar install
//or
composer require plehanov/php-rpm

Use it: pack.php, (*5)

<?php

require_once __DIR__ . '/vendor/autoload.php';

$spec = new \Plehanov\RPM\Spec();
$spec
    // Set many properties
    ->setProp([
        'Name', 'my-package-name',
        'Version' => '0.1.1',
        'Summary' => 'simple summary',
        'Release' => '1',
        'URL' => 'http://...',
    ])
    // Set single property
    ->setProp('Version', '0.1.2')
    // Set many options
    ->setBlock([
        'description', 'My software description',
    ])
    // Set single option
    ->setBlock('description', 'My software description')    
    // Default permission: file mode, user, group, folder mode
    ->setDefAttr(644, 'root', 'root', 755)
    ->addPerm('/etc/package1/bin/run', 644)
    ->addPerm('/etc/package1/source', 644, 'apache')
    // Custom permission: mode, user, group    
    ->addPerm('/etc/%{destroot}/lib', 644, 'apache', 'jenkins')
    // Replace all command
    ->setBlock('install', ['rm -rf %{buildroot}', 'mkdir -p %{buildroot}%{_bindir}'])
    // Append one command
    ->appendInstallCommand('ln -s %{destroot}/storage/app/ %{destroot}/public/storage');

$packager = new \Plehanov\RPM\Packager();
// Build temporary folder
$packager->setOutputPath('/path/to/out');
$packager
    ->setSpec($spec)
    // Path %{destroot} replace to /opt/project. Install command replace too.
    ->setDestinationFolder('/opt/project');

// Copy file /path-from/source-conf to /etc/package1/source/main.conf
$packager->addMount('/path-from/source-conf', '/etc/package1/source/main.conf');
// Copy file /path-from/binary to /etc/package1/bin/run
$packager->addMount('/path-from/binary', '%{destroot}/bin/run');
// Copy folder /path-from/library/ to /etc/package1/lib/
$packager->addMount('/path-from/library', '%{destroot}/lib');
// Copy folder /path-from/library2/ to /etc/package1/lib2/
$packager->addMount('/path-from/library2/', '%{destroot}/lib2/');

//Creates folders using mount points
$packager->run();

//Get the rpmbuild command
echo $packager->build();

Create the Package, (*6)

$(php pack.php)

The Versions

09/02 2018

dev-master

9999999-dev

RPM packager for PHP applications.

  Sources   Download

GPL-3.0

The Requires

  • ext-phar *
  • php >=7.1.0

 

The Development Requires

packager rpm package building

09/02 2018

v1.1.3

1.1.3.0

RPM packager for PHP applications.

  Sources   Download

GPL-3.0

The Requires

  • php >=7.1.0
  • ext-phar *

 

The Development Requires

packager rpm package building

09/02 2018

v1.1.1

1.1.1.0

RPM packager for PHP applications.

  Sources   Download

GPL-3.0

The Requires

  • php >=7.1.0
  • ext-phar *

 

The Development Requires

packager rpm package building

09/02 2018

v1.1.0

1.1.0.0

RPM packager for PHP applications.

  Sources   Download

GPL-3.0

The Requires

  • php >=7.1.0
  • ext-phar *

 

The Development Requires

packager rpm package building

28/12 2017

1.0.0

1.0.0.0

RPM packager for PHP applications.

  Sources   Download

GPL-3.0

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

24/01 2017

v0.1.6

0.1.6.0

RPM packager for PHP applications.

  Sources   Download

GPL-3.0

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

26/05 2015

v0.1.5

0.1.5.0

RPM packager for PHP applications.

  Sources   Download

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

26/05 2015

v0.1.4

0.1.4.0

RPM packager for PHP applications.

  Sources   Download

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

25/05 2015

v0.1.3

0.1.3.0

RPM packager for PHP applications.

  Sources   Download

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

25/05 2015

v0.1.2

0.1.2.0

RPM packager for PHP applications.

  Sources   Download

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

25/05 2015

v0.1.1

0.1.1.0

RPM packager for PHP applications.

  Sources   Download

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building

25/05 2015

v0.1.0

0.1.0.0

RPM packager for PHP applications.

  Sources   Download

The Requires

  • ext-phar *

 

The Development Requires

packager rpm package building