Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 120 | All time: 9,502 This week: 140 |
Version | License | PHP version | Categories | |||
package-builder 1.4 | BSD License | 5.3 | PHP 5, Tools, Unix |
Command-line utility that builds a package from composer project.
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.
Create clean and lite version of your package. For this manual let's take a mythical package `taifun/tornado`:
mkdir package-build && cd package-build
composer create-project --prefer-dist --no-dev taifun/tornado .
Install Package Builder globally. Skip this step if you have done this before.
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`.
$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);
Launch a Packaging Wizard. It will ask for additional information and finally build a package and store it in one-level above directory.
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 (9) |
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 (9) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Application (2 files) | ||||
PackageConfiguration.php | Class | Class source |
Files (9) | / | src | / | Application |
File | Role | Description |
---|---|---|
Application.php | Class | Class source |
BuildCommand.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
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.