Discussion:
Basic tutorial for packaging
Rudolf Vavruch
2011-08-09 09:50:31 UTC
Permalink
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
--
To UNSUBSCRIBE, email to debian-webapps-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/CAG61tjfeNCdo=3QMuc4=fDXdKX7E=BteZVq85G-22+***@mail.gmail.com
sean finney
2011-08-09 10:33:23 UTC
Permalink
Hi Rudolf,
Post by Rudolf Vavruch
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.
You're probably best off taking this to the debian-mentors list, btw.

Yes, debian packaging is a bit more involved than the RPM-based packaging,
though this yeilds a number of benefits in terms of expressiveness and
flexibility.
Post by Rudolf Vavruch
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.
often, you can take such a package (that does compilation), and just remove
the compilation steps from debian/rules (and perhaps change the Arch field
in debian/control from any->all). dh_make (apt-get install dh-make) will
provide a decent "starter" package, but also see below.
Post by Rudolf Vavruch
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.
This is a pretty helpful and semi-authoritative link on getting started
with debian packaging amongst other topics:

http://www.debian.org/doc/manuals/maint-guide/index.en.html

and one final note: there are two popular packaging helpers (debhhelper and
cdbs) that you will often find referenced in the various HOWTO's on
the internetz. Generally speaking, debian related howto's tend to focus
on the former while ubuntu tends to focus on the latter. Either way should
work, though people have favorite-editor-like opinions about which is
actually better (we all know debhelper is the best though:)


sean
--
To UNSUBSCRIBE, email to debian-webapps-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@cobija.connexer.com
Chris Warburton
2011-08-09 10:30:45 UTC
Permalink
Post by Rudolf Vavruch
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
--
To UNSUBSCRIBE, email to debian-webapps-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@ocproducts.com
Rudolf Vavruch
2011-08-10 20:16:34 UTC
Permalink
Thanks for the suggestions and links. I am going to try the simpler
method first.
Post by Chris Warburton
Post by Rudolf Vavruch
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
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
--
--
To UNSUBSCRIBE, email to debian-webapps-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@mail.gmail.com
Loading...