build backports with less work

Hi, now I think about backports.
  1. backports is useful, since users can get newest version without upgrade whole environment and can mostly stay with stable version
  2. however backports considered harmful, since sometimes it would be unmaintained
  3. and backports is not enough, since 
    1. users should ask package maintainer to make backport package it's pain/hard for "average" users who need backport
    2. and, sometimes request would be (unfortunately) ignored...
    3. we have tons of packages, you know.
Sigh. Lack of human resource + not automated process makes backports harmful - then, what should we do? The answer for it, automate backporting process as much as we can. Now I'll introduce "dbackports" for you.

This is tiny tiny shell script, but it helps you to make backported package.
$ ~/bin/dbackports.sh
no X-Backports-Target is specified in debian/control, aborting...
Well, you should add "X-Backports-Target: 'codename'" to its debian/control file. codename should be specify as squeeze, wheezy, etc.
$ vi debian/control
$ ~/bin/dbackports.sh
please specify option.
Usage: dbackports [init|update|build|rollback]
dbackports has some option, then you should inititialize envinroment for the pacakge.
$ ~/bin/dbackports.sh init
..........
.
Ready.
Okay, now here we go.
$ vi debian/control
$ echo 7 > debian/compat
modify debhelper version since squeeze has it until debhelper7.
$ ~/bin/dbackports.sh update
Warning: trailing whitespace in line 6 of debian/control
 dpkg-source --before-build loqui-0.5.3
 fakeroot debian/rules clean
 dpkg-source -b loqui-0.5.3
 dpkg-genchanges -S >../loqui_0.5.3-4~bpo60+1_source.changes
dpkg-genchanges: not including original source code in upload
 dpkg-source --after-build loqui-0.5.3

Now here's a backports patch in debian/backports/squeeze and its source.
Ready to build (or dbackports back).
create diff for backports as below
$ cat debian/backports/squeeze
Index: loqui-0.5.3/debian/compat
===================================================================
--- loqui-0.5.3.orig/debian/compat 2011-10-22 22:45:07.000000000 +0900
+++ loqui-0.5.3/debian/compat 2012-11-06 20:55:22.876411565 +0900
@@ -1 +1 @@
-9
+7
Index: loqui-0.5.3/debian/control
===================================================================
--- loqui-0.5.3.orig/debian/control 2012-11-06 20:54:45.612323136 +0900
+++ loqui-0.5.3/debian/control 2012-11-06 20:55:17.436398651 +0900
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Hideki Yamane <henrich@debian.org>
 Uploaders: Yoichi Imai <sunnyone41@gmail.com>
-Build-Depends: debhelper (>= 9), libgtk2.0-dev (>= 2.4.0),
+Build-Depends: debhelper (>= 7), libgtk2.0-dev (>= 2.4.0),
                libglib2.0-dev (>= 2.22.0), autotools-dev,
                autoconf, automake, libtool
 Standards-Version: 3.9.3
it's just adjust debhelper version. Then, build it. build option invokes cowbuilder with specified distribution as X-Backports-Target (now it's squeeze).
$ ~/bin/dbackports.sh build
[sudo] password for henrich:
-> Copying COW directory
forking: rm -rf /var/cache/pbuilder/build//cow.4519
forking: cp -al /var/cache/pbuilder/squeeze.cow /var/cache/pbuilder/build//cow.451
...
That's all. Simple - isn't it? :-) It takes only 3 mins on my box.
real 2m59.413s
user 0m0.008s
sys 0m0.036s

Comments