Git Product home page Git Product logo

php-deb-packager's Introduction

Debian packager (PHP)

  • Develop: Build Status
  • Master : Build Status

A simple debian packager for PHP applications

Get composer:

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

Install dependencies and autoloader

php composer.phar install

Use it:

<?php

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

$control = new \wdm\debian\control\StandardFile();
$control
    ->setPackageName("my-package-name")
    ->setVersion("0.1.1")
    ->setDepends(array("php5", "php5-cli", "php5-xsl"))
    ->setInstalledSize(4096)
    ->setMaintainer("Walter Dal Mut", "[email protected]")
    ->setProvides("my-package-name")
    ->setDescription("My software description");
;

$packager = new \wdm\debian\Packager();

$packager->setOutputPath("/path/to/out");
$packager->setControl($control);

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

Create the Package

$(php pack.php)

Pre-Post scripts

Optianally you can add script for different hooks

  • pre-install
    • Run pre install
  • post-install
    • Run post install
  • pre-remove
    • Run pre package remove
  • post-remove
    • Run post package remove

Adding scripts

$packager->setPreInstallScript(__DIR__ . '/my-pre-install-script.sh');
$packager->setPostInstallScript(__DIR__ . '/my-post-install-script.sh');
$packager->setPreRemoveScript(__DIR__ . '/my-pre-remove-script.sh');
$packager->setPostRemoveScript(__DIR__ . '/my-post-remove-script.sh');

See a script example

#!/bin/sh
#postinst script for upcloo

set -e

echo "Goodbye Cruel World"

exit 0

Use Yaml files instead the library directly

Just take a look to wdalmut/php-deb-describe

php-deb-packager's People

Contributors

ashleyfraser avatar davidgoodwin avatar jhfrintrop avatar tony133 avatar utkuaydin avatar wapmorgan avatar wdalmut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

php-deb-packager's Issues

Fix empty lines in control file

Hi! I have this error

21:46 $ sudo apt-get install docli
Reading package lists... Error!
E: Problem parsing dependency Depends
E: Error occurred while processing docli (NewVersion2)
E: Problem with MergeList /var/lib/apt/lists/dl.bintray.com_gianarb_deb_Packages
E: The package lists or status file could not be parsed or opened.

cat /etc/apt/lists/dl.bintray.com_gianarb_deb_Packages

Package: docli
Version: 1.0.0
Section: web
Priority: optional
Architecture: amd64
Essential: no
Depends:
Pre-Depends:
Recommends:
Suggests:
Installed-Size: 2048
Maintainer: Gianluca Arbezzano[[email protected]]
Conflicts:
Replaces:
Provides: docli
Description: DigitalOcean cli manager
Filename: docli-1.0.0.deb
SHA1: e6eede5a45a06dd0e36e322c8a43e35b7cb4f5fe
Size: 2015912

If I remove empty line.. for example Conflicts, Replaces, Depends... apt-get install docli works..
Thanks for this library

I have tried this test with clouwatch-agent and it return same error

Adapter idea

Move all to adapter. In this way we can provides packages for Debian and Redhat based distro and others...

<?php
$packager->setAdapter(new Debian());

class Debian extends PackageAdapter
{
...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.