[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Basic tutorial for packaging



On Tuesday 09 August 2011 10:50:31 Rudolf Vavruch wrote:
> Hello,
> 
> I want to package some PHP apps, for starters just something I can
> copy somewhere and run "dpkg -i" on, but with the intention of setting
> up my own private repository in the future. Neither the packages nor
> the repository will be open to the public.
> 
> I have made some RPMs, but it seems DEBs are a far more complicated
> beast - and I have absolutely no experience with them.
> 
> I have been reading various articles, for example
> (https://wiki.ubuntu.com/MOTU/School/PackagingWithoutCompiling), but I
> am still lost. The afore mentioned article leaves me with a bunch of
> text files and directories, which is clearly not a deb, and I am not
> sure whether the files I have are even in the correct directories. I
> have read other articles that assume I'm trying to package C code that
> needs to be compiled first.
> 
> I feel like I am wasting my time randomly stumbling around the web
> looking for the right information. Is it possible that someone could
> direct me to a basic tutorial about packaging, from start to finished
> deb, and packaging PHP apps
> in particular? Maybe even throw in something about setting up cron
> jobs with a deb? It would be much appreciated.
> 
> Kind regards,
> Rudolf

Debs aren't particularly difficult, but following Debian guidelines can be. If 
you don't intend these packages to go into Debian then you can forget the 
guidelines as long as the resulting packages work.

A really simple way to make debs is to simply make a folder/file structure 
like the following (Google for what to put in "control"):

my_pkg/
 DEBIAN/
  control
 usr/
  bin/
   foo

Then simply run a command like "dpkg-deb --build my_pkg" to create the 
package. In this case it will install the file /usr/bin/foo. See here for a 
quick guide
http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO

Everything else to do with packaging boils down to a) handling things that 
need compiling, b) automating a lot of the maintainence and c) best practices 
and policy compliance. For PHP apps you don't need to care about (a), as for 
(b) and (c) you can do as little or as much as you think is worth it.

A more comprehensive guide can be found here, which covers things like extra 
configuration files (for cron, etc.), but its example is a C program that 
needs compiling, rather than interpreted PHP 
http://www.debian.org/doc/manuals/maint-guide/

Cheers,
Chris


Reply to: