keeping debian folder after package generation

119 views
Skip to first unread message

Andrea Rota

unread,
Nov 3, 2012, 8:59:04 PM11/3/12
to fpm-...@googlegroups.com
hi,

i am using fpm to create a Debian package from a PEAR package - i was looking for a way to keep the debian folder once the package is generated: is this possible at all or no such folder is used and the package is assembled directly via some other logic that avoids the usual debian folder and dpkg-buildpackage or similar tools? i couldn't find an option for this in the help screen or on the fpm wiki on github.

best
andrea

Jordan Sissel

unread,
Nov 4, 2012, 12:29:06 AM11/4/12
to fpm-...@googlegroups.com
First, I'll ask the obvious question - why do you want this? Is there
a feature of fpm missing?

Second, fpm implements debian package building without the use of
*any* debian tools. It doesn't use any 'debian' directory, and it
never runs dpkg-buildpackage, debuild, dh_make, or any related tools.
This allows two great benefits - first, that you can build deb
packages on any machine for any platform since there is no requirement
for debian's tools. Second, that because fpm doesn't use debian
tooling, you aren't burdened by the many (possibly invasive and
destructive) 'debian policy' decisions that are enforced and applied
by debian's package tools.

Finally, how to achieve what you ask. Currently the only file fpm will
generate is the 'control' file to put into the package during
building. Under normal circumstances for 'debuild' and
'dpkg-buildpackage' you'll need a 'rules' file and several other
things before it will know how to build a package.

You can certainly save the 'control' file somewhat hackishly using
EDITOR env var to copy the file out during package building:

EDITOR='sh -c "cp \$1 /tmp/control" -' fpm --edit -s dir -t deb -n
example /etc/motd

Example:

% EDITOR='sh -c "cp \$1 /tmp/control" -' fpm --edit -s dir -t deb -n
example /etc/motd
Created deb package {"path":"example_1.0_amd64.deb"}

% cat /tmp/control
Package: example
Version: 1.0
License: unknown
Vendor: jls@pork
Architecture: amd64
Maintainer: <jls@pork>
Installed-Size: 0
#Pre-Depends:
Section: default
Priority: extra
Homepage: http://example.com/no-uri-given
Description: no description given

Let me know if you need any other help! :)

-Jordan

Andrea Rota

unread,
Nov 4, 2012, 6:07:43 AM11/4/12
to fpm-...@googlegroups.com
hi Jordan,

thank your detailed reply:


On Sunday, 4 November 2012 04:29:06 UTC, Jordan Sissel wrote:
First, I'll ask the obvious question - why do you want this? Is there
a feature of fpm missing?

uhm, no - i now realise i was trying to use fpm for the wrong use case, namely preparing a source PEAR module for packaging for eventual inclusion in the Debian archives or at least to be used in an Ubuntu PPA for the time being.
 
Second, fpm implements debian package building without the use of
*any* debian tools. It doesn't use any 'debian' directory, and it
never runs dpkg-buildpackage, debuild, dh_make, or any related tools.
This allows two great benefits - first, that you can build deb
packages on any machine for any platform since there is no requirement
for debian's tools. Second, that because fpm doesn't use debian
tooling, you aren't burdened by the many (possibly invasive and
destructive) 'debian policy' decisions that are enforced and applied
by debian's package tools.

sure, i understand now - in fact, seeing that my package was created almost instantly i assumed that no debian build toolchain was involved. being able to quickly build a package on any platform/architecture and with no debian toolchain (or, even worse, the whole PEAR build thingy) dependencies is awesom when there is no need to stick to specific policies and all is needed is a ready to use package file.

[...]

thank you for your help!
best
andrea

Jordan Sissel

unread,
Nov 4, 2012, 1:15:15 PM11/4/12
to fpm-...@googlegroups.com
On Sun, Nov 4, 2012 at 3:07 AM, Andrea Rota <a...@xelera.eu> wrote:
> hi Jordan,
>
> thank your detailed reply:
>
>
> On Sunday, 4 November 2012 04:29:06 UTC, Jordan Sissel wrote:
>>
>> First, I'll ask the obvious question - why do you want this? Is there
>> a feature of fpm missing?
>
>
> uhm, no - i now realise i was trying to use fpm for the wrong use case,
> namely preparing a source PEAR module for packaging for eventual inclusion
> in the Debian archives or at least to be used in an Ubuntu PPA for the time
> being.

On the flip side, if you are interested in building regular debian
packages, you might find 'dh_make' a great starting point.

Here's an example script that does python packages into debs that I
wrote prior to fpm:
https://github.com/jordansissel/python-packaging/blob/master/python2deb.sh

In general:

This will create a debian directory for you with a few things filled
in already (like the name, etc)
dh_make -s -n -p 'mysimplepackage_1.0' < /dev/null

Then you can just 'debuild -us -uc' to get your package rolling. You
may have to tweak the 'rules' file or other features, but in general,
dh_make should get you on the right path :)

-Jordan
Reply all
Reply to author
Forward
0 new messages