Download .zip |
Info | Documentation | View files (9) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-06-15 (17 hours ago) | Not yet rated by the users | Total: 102 This week: 8 | All time: 8,670 This week: 125 |
Version | License | PHP version | Categories | |||
package-builder 1.4 | BSD License | 5.3 | PHP 5, Utilities and Tools, Unix |
Command-line utility that builds a package from composer project.
bin
section of composer.json
) will be made symbolic links and placed in /usr/local/bin/. That way you will be able use them like any other system program.By default, utility uses os detection to decide what format of package should be used.
For now, it supports following package formats:
deb* - uses automatically on Debian installation. You can force using this format by adding --type deb
in console.
rpm* - uses automatically on Fedora installation. You can force using this format by adding --type rpm
in console.
taifun/tornado
:
`
sh
mkdir package-build && cd package-build
composer create-project --prefer-dist --no-dev taifun/tornado .
`
`
sh
composer global require wapmorgan/package-builder
`
Add another path of autoloader in your binaries. All files of your package will be placed in /usr/lib/[package name]/ folder, so composer autoloader will be available by /usr/lib/[package name]/vendor/autoload.php path. [package name] is not the same as composer package name. You can use any that is not used in your system. For demonstrating purposes let's use simplepackage
.
`
php
$paths = [
__DIR__.'/../vendor/autoload.php',
__DIR__.'/../autoload.php',
__DIR__.'/../../../autoload.php',
'/usr/lib/simplepackage/vendor/autoload.php', // this line added
];
function init_composer(array $paths) { foreach ($paths as $path) { if (file_exists($path)) { require_once $path; return true; } } return false; }
if (!init_composer($paths)) die('Run composer install
firstly.'.PHP_EOL);
`
`
sh
pbuilder build .
`
A resulting ready-to-install deb or rpm-package will be stored in file ../simplepackage-version.deb or ../simplepackage-version-release.rpm.
Why do I need to package php scripts?
May be you want to take control of all files on your PC and just like your package manager.
What preinstalled steps is needed to build a package?
* On Debian-based:
- Install packages:
`
sh
build-essential
`
* On Fedora-based:
- Install build packages:
- @development-tools
- fedora-packager
- rpmdevtools
- Create build tree:
`
sh
rpmdev-setuptree
`
Can I build a package with different type than my OS uses?
No, PackageBuilder uses system commands like dpkg
and rpmbuild
to create a package.
Files |
File | Role | Description | ||
---|---|---|---|---|
bin (1 file) | ||||
src (1 file, 1 directory) | ||||
tests (1 file) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE.md | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | src | / | Application |
File | Role | Description |
---|---|---|
Application.php | Class | Class source |
BuildCommand.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.