Discussion:
Debian packaging for spiped
Andreas Olsson
2012-11-17 17:45:50 UTC
Permalink
Greetings

Been working on setting up Debian packaging for spiped.

https://github.com/andreaso/spiped-debian

(The only thing new in that git repo is the ./debian folder. Everything
else is an extracted spiped 1.2.2 tarball.)

While the original motivation has been that I need that packaging for
myself right now, it would also be nice to see if I can get spiped into
Debian. Hence, I've made an effort to do the packaging in what I hope to
have understood to be the proper way.

Feel free to tell me what I am doing wrong.

The two main differences between the Debian package and installing using
make; make install is that the package is built using flags provided by
dpkg-buildflags and that basic man pages are provided.

Currently, in Debian Unstable, these are the build flags in question:

$ dpkg-buildflags --get CFLAGS
-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
$ dpkg-buildflags --get CPPFLAGS
-D_FORTIFY_SOURCE=2
$ dpkg-buildflags --get LDFLAGS
-Wl,-z,relro

And for the man pages, they are pretty much a cut-n-paste
from ./spipe/README and ./spiped/README.

// Andreas
Peter Pentchev
2012-11-17 22:12:29 UTC
Permalink
Post by Andreas Olsson
Greetings
Been working on setting up Debian packaging for spiped.
https://github.com/andreaso/spiped-debian
(The only thing new in that git repo is the ./debian folder. Everything
else is an extracted spiped 1.2.2 tarball.)
Wow... I haven't taken a look at your packaging yet, but it seems that
there has been a bit of a duplication of effort :) I filed a Debian
ITP (intent to package) bug on the same day spiped came out, and I'm
almost ready with my package at http://gitorious.org/spiped/spiped :)
(in general, an ITP bug in Debian is the proper way to notify others that
somebody's working on a package, so that there's no duplication of work :)

Tomorrow I'll take a look at what you've done and see if there's something
blindlingly different :) (except the manual pages, which I have also written
but haven't committed/pushed yet)

G'luck,
Peter
--
Peter Pentchev ***@ringlet.net ***@FreeBSD.org ***@packetscale.com
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13
Thit sentence is not self-referential because "thit" is not a word.
Andreas Olsson
2012-11-17 22:48:14 UTC
Permalink
Post by Peter Pentchev
Wow... I haven't taken a look at your packaging yet, but it seems that
there has been a bit of a duplication of effort :) I filed a Debian
ITP (intent to package) bug on the same day spiped came out, and I'm
almost ready with my package at http://gitorious.org/spiped/spiped :)
(in general, an ITP bug in Debian is the proper way to notify others that
somebody's working on a package, so that there's no duplication of work :)
Hey, that ITP wasn't there when I looked a week or so ago :) The reason
I myself didn't file a ITP was that I wanted something to show before
making any noice, not having done any previous Debian packaging.

Seems like the main difference being that you applied patches while I
applied workarounds.

Instead of 01-honor-destdir.patch I went with
BINDIR=$$(pwd)/debian/spiped/usr/bin

Instead of 02-honor-compiler-flags.patch I put the CPPFLAGS within the
CFLAGS as well as used LDADD_EXTRA for the LDFLAGS.

I have no equivalent to 03-warnings.patch nor to 04-debian-build.patch.

// Andreas
Colin Percival
2012-11-18 09:54:46 UTC
Permalink
Post by Peter Pentchev
Wow... I haven't taken a look at your packaging yet, but it seems that
there has been a bit of a duplication of effort :) I filed a Debian ITP
(intent to package) bug on the same day spiped came out, and I'm almost
ready with my package at http://gitorious.org/spiped/spiped :)
Ultimately it's up to you Debian folks, but a few comments:

1. I agree with Andreas that setting compiler and linker flags in the
environment or make command line is better than patching the Makefiles...
after all, I specifically put bits in to let you do that.

2. Similarly, can you add -D_POSIX_C_SOURCE=200809L to CFLAGS instead of
patching source code?

3. I'll add an #ifdef #undef asprintf to my code, so in a future release
that will no longer be needed. (I have no plans for future releases at
this time, but odds are that at some point one will happen.)

4. I'm happy with replacing cp/strip/chmod/mv with install -- I would have
used install myself except that it's not guaranteed to exist on POSIX.

Finally, can I convince one of you to contribute man pages back under the
two-clause BSD license so I can include them in a future release?
--
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
Andreas Olsson
2012-11-18 16:56:59 UTC
Permalink
Post by Colin Percival
Finally, can I convince one of you to contribute man pages back under the
two-clause BSD license so I can include them in a future release?
Well, you are more than welcome to use the man pages I put together.

https://github.com/andreaso/spiped-debian/blob/master/debian/{spipe.1,spiped.1}

For the stuff I created under ./debian/ I assigned a MIT/Expat
license[1]. Will that do, or do you want me to explicitly contribute
back under the two-clause BSD?

(On that note, I really do need to clarify somewhere that those man
pages are derivative works based on the corresponding README files.)

That said, my man pages are currently really a bare minimum. Before
using them I'd wait and see what Peter has put together.

// Andreas

[1]: https://github.com/andreaso/spiped-debian/blob/master/debian/copyright
Colin Percival
2012-11-22 00:59:53 UTC
Permalink
Post by Andreas Olsson
Post by Colin Percival
Finally, can I convince one of you to contribute man pages back under
the two-clause BSD license so I can include them in a future release?
Well, you are more than welcome to use the man pages I put together.
https://github.com/andreaso/spiped-debian/blob/master/debian/{spipe.1,spiped.1}
For the stuff I created under ./debian/ I assigned a MIT/Expat license[1].
Will that do, or do you want me to explicitly contribute back under the
two-clause BSD?
I'd prefer two-clause BSD, just for the sake of having all the bits I
distribute under the same license and keeping things simple.
Post by Andreas Olsson
(On that note, I really do need to clarify somewhere that those man pages
are derivative works based on the corresponding README files.)
That said, my man pages are currently really a bare minimum. Before using
them I'd wait and see what Peter has put together.
Right, there's no urgency here.

--
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
Andreas Olsson
2012-11-23 17:16:21 UTC
Permalink
Post by Colin Percival
Post by Andreas Olsson
For the stuff I created under ./debian/ I assigned a MIT/Expat license[1].
Will that do, or do you want me to explicitly contribute back under the
two-clause BSD?
I'd prefer two-clause BSD, just for the sake of having all the bits I
distribute under the same license and keeping things simple.
@Colin: True, keeping things simple is a good is a good thing. I've now
put my ./debian/ folder additions under the two-clause BSD.

https://github.com/andreaso/spiped-debian/commit/e9ce4793c078ff9389cac998b7e362f49beeba13

@Peter: How are things coming on your end? Any thoughts on the
difference in packaging?

Another possibly noteworthy difference being that I settled for
depending on debhelper 8, making it easier to also backport/build the
package for Debian Stable (6.0). Anything in particular in this case
missing by not using debhelper 9?

// Andreas
Andreas Olsson
2013-01-06 21:29:35 UTC
Permalink
@Peter: Any new thoughts/progress on your end? Given that you are the
one sitting on the ITP it feels a bit like the ball is in your court.

@Others: I have now created an Ubuntu PPA for my package builds. While
it's primarily for my personal benefit, feel free to use it, in case you
happen to be in a sufficiently trusting state of mind.

https://launchpad.net/~andol/+archive/spiped/


// Andreas
Peter Pentchev
2013-01-18 16:40:55 UTC
Permalink
Post by Andreas Olsson
@Peter: Any new thoughts/progress on your end? Given that you are the
one sitting on the ITP it feels a bit like the ball is in your court.
Hi,

I'm really, really sorry about the awful delay :(

I'm almost done with some changes to my Debian package, which might very
well turn out incorporating your manual pages :) (thanks!) I'll send a
more elaborate reply later today or tomorrow.

Just as a side note, about your earlier Debian-specific question about
using debhelper 9: well, it offers quite a few Good Things(tm), if only
for the dependencies between the build targets and the multiarch
support. The build flags help a bit, too, although I've already
acquired the habit of setting them to absolute values anyway. And about
the support in earlier Debian releases - well, there *is* a very much
functional backport of debhelper 9 to Debian Squeeze, so there are
really no problems there. Anyway, the package is not using anything
really specific to debhelper 9 (see my remark about setting absolute
flags above :)), so backporting it to even earlier (unsupported anyway
:)) releases of Debian will be as simple as changing the compat level
and the versioned dependency.
Post by Andreas Olsson
@Others: I have now created an Ubuntu PPA for my package builds. While
it's primarily for my personal benefit, feel free to use it, in case you
happen to be in a sufficiently trusting state of mind.
https://launchpad.net/~andol/+archive/spiped/
G'luck,
Peter
--
Peter Pentchev ***@ringlet.net ***@FreeBSD.org ***@storpool.com
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13
Nostalgia ain't what it used to be.
Peter Pentchev
2013-01-25 21:49:38 UTC
Permalink
Post by Colin Percival
Post by Peter Pentchev
Wow... I haven't taken a look at your packaging yet, but it seems that
there has been a bit of a duplication of effort :) I filed a Debian ITP
(intent to package) bug on the same day spiped came out, and I'm almost
ready with my package at http://gitorious.org/spiped/spiped :)
Hi Colin, Andreas,

After a quite unfortunate delay of three months, for which I can only
apologize again most sincerely, here's an updated version of my work on
packaging spiped-1.2.2 for Debian - and a couple of attached patches for
Colin's review and possible inclusion upstream.

The whole Debian package is, again, available at
http://gitorious.org/spiped/spiped/commits/debian
git://gitorious.org/spiped/spiped.git -b debian
Post by Colin Percival
1. I agree with Andreas that setting compiler and linker flags in the
environment or make command line is better than patching the Makefiles...
after all, I specifically put bits in to let you do that.
With all due respect, I have to disagree here, but only a bit :)
Of course, if this were only about passing new values to CFLAGS or
LDFLAGS_EXTRA, I would be all for it - and that's what the Debian
package does with CFLAGS. However, IMHO the upstream build system
should also handle CPPFLAGS and LDFLAGS, not just CFLAGS, for a couple
of reasons:
- even if right now the spiped source doesn't need the distinction
between C compiler and preprocessor flags, it might very well arise in
the future; for several of my projects, it arose when I realized that
I do need some (but not all!) of the definitons at the "make depend"
stage, when only the preprocessor is invoked. It makes no real sense
to pass debugging, optimization, etc flags to the C preprocessor at
that stage, and some of the environment's settings really do need to
be passed. Again, spiped doesn't need this right now, but IMHO it'll
do no harm.
- in Debian's case, there *are* some settings that the build environment
passes in CPPFLAGS and not CFLAGS, and they really do need to make it
into the build system - mostly build hardening flags that are, at the
present, strongly encouraged if not outright compulsory as defined by
the Debian Policy document. Of course, this could've been handled
very well by adding a simple CFLAGS+= ${CPPFLAGS} in the Debian build
infrastructure and letting spiped's build system just listen to CFLAGS
as it already does, but this way - honoring the conventional way of
passing C preprocessor flags - seems a bit cleaner to me personally.
- finally, a kind of weak argument, but... at least in my software, I've
(gradually, I have to admit! :) consciously built a habit of following
the conventions - and over the years I have formed the personal
opinion that *most* conventions call for CPPFLAGS, CFLAGS and LDFLAGS
as separate variables with those most common names. With lots of
build and packaging systems in all kinds of OSs and distributions, it
seems easier to me to just honor the flags passed in those variables
if they are available.
Post by Colin Percival
2. Similarly, can you add -D_POSIX_C_SOURCE=200809L to CFLAGS instead of
patching source code?
Yes, I do have to admit that this was a momentary lapse of reason on my
part. Of *course* it's easier to pass them as flags instead of patching
all the source files that *seem* to need them. Furthermore, when I did
that and passed them in the global preprocessor flags, it turned out
that I was quite mistaken in shunting out the posix-l.sh invocation
because it had seemed to me at the time that Debian doesn't need librt -
well, with a proper _POSIX_C_SOURCE definition, Debian does want
functions that only exist there :) So I restored that.

Now... Once again, it is my personal opinion that the POSIX compliance
flags should be set in the spiped build system, so that it is easier for
people to build it in any POSIX-compliant C environment without the
explicit need of passing more flags. There is no harm in them being the
default - I hope. This is the point of my last commit in the repository
- the one that pushes the _POSIX_C_SOURCE definition into the top-level
Makefile in the spiped distribution. Of course, if you do not like it,
feel free to take the last-but-one commit from the repository and simply
ignore the Makefile bit of the 03-warnings patch attached here.
Post by Colin Percival
3. I'll add an #ifdef #undef asprintf to my code, so in a future release
that will no longer be needed. (I have no plans for future releases at
this time, but odds are that at some point one will happen.)
Thanks!
Post by Colin Percival
4. I'm happy with replacing cp/strip/chmod/mv with install -- I would have
used install myself except that it's not guaranteed to exist on POSIX.
Yep, I completely understand. I have some ideas about checking for that
at build/install time, but I'll have to think about it some more
(hopefully less than three months this time).
Post by Colin Percival
Finally, can I convince one of you to contribute man pages back under the
two-clause BSD license so I can include them in a future release?
Many thanks to Andreas for actually taking the time to do that! I have
included his manual pages in my Debian package, too - after taking the
liberty of once again converting them to yet another representation
format. In my Debian package, they use the mdoc set of macros instead
of the man ones - IMHO this is 1. a bit more readable, 2. a bit closer
to the BSD origins of spiped itself :)

Once again, thanks to both of you for your work and your patience with
me!

G'luck,
Peter
--
Peter Pentchev ***@ringlet.net ***@FreeBSD.org ***@storpool.com
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13
I am the thought you are now thinking.
Loading...