Package Creation and Use

In this section, we actually create the package, and try it out.

  1. [Warning]Warning

    I do my packaging on a carefully configured machine (running Ubuntu Oneiric) which I installed with the specific purpose of packaging in mind. It has all the appropriate tools installed and configured, and my home directory has the right settings for creating and signing packages. I've started to describe the setup of such a machine, but that description is by no means finished.

    So chances are that when you type the commands given without some thorough preparation, you 'll get error messages instead of a package.

    Anyway, here is the command that gets me the package:

    DIST=precise  pdebuild --architecture amd64 --auto-debsign --debsign-k "j.bokma@rug.nl" --buildresult ../lastbuild/ --logfile ../lastbuild/pdebuild.log

    [Note]Note

    I don't show the output, because it is way too long. But a few lines I still want to mention:

    dpkg-shlibdeps: warning: dependency on libssl.so.6 could be avoided if "debian/res-am-agent/usr/sbin/resamad" were not uselessly linked against it (they use none of its symbols).
    dpkg-shlibdeps: warning: dependency on libuuid.so.1 could be avoided if "debian/res-am-agent/usr/sbin/resamad" were not uselessly linked against it (they use none of its symbols).
    dpkg-shlibdeps: warning: dependency on libxml2.so.2 could be avoided if "debian/res-am-agent/usr/sbin/resamad" were not uselessly linked against it (they use none of its symbols).

    These messages usually mean that the package could be leaner, had we packaged from source. But in this case it also means that all the hoops we jump through to fix that libssl.so.6 dependency could 've been skipped if the builder of the binary (whether human or computer) had checked whether it actually needed linking agains libssl!

  2. apprentice@precise-box:~$ echo 'res-am-agent res-am-agent/dispatcherlist string 129.125.58.21'|sudo debconf-set-selections
    apprentice@precise-box:~$ sudo dpkg -i res-am-agent_6.5-0.89780_amd64.deb
    Selecting previously unselected package res-am-agent.
    (Reading database ... 62810 files and directories currently installed.)
    Unpacking res-am-agent (from res-am-agent_6.5-0.89780_amd64.deb) ...
    Setting up res-am-agent (6.5-0.89780) ...
    spawn resamad -dd129.125.58.21
    1.      res-am@sql01.workspace.rug.nl
    Enter value: 1
    Processing triggers for ureadahead ...
    Processing triggers for man-db ...
    jurjen@cit-zb-3-53:~$ ps axu|grep [r]esamad
    root     24603  0.0  0.0 256484  2492 ?        Ssl  22:42   0:00 resamad -dd129.125.58.21
    apprentice@precise-box:~$ sudo /etc/init.d/res-am-agent stop
    apprentice@precise-box:~$ ps axu|grep [r]esamad
    apprentice@precise-box:~$ sudo /etc/init.d/res-am-agent start
    apprentice@precise-box:~$ ps axu|grep [r]esamad
    root     24722  0.0  0.0 256484  2508 ?        Ssl  22:43   0:00 /usr/sbin/resamad
    apprentice@precise-box:~$ sudo apt-get remove res-am-agent
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      res-am-agent
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    After this operation, 553 kB disk space will be freed.
    Do you want to continue [Y/n]? y
    (Reading database ... 62818 files and directories currently installed.)
    Removing res-am-agent ...
    Processing triggers for man-db ...
    Processing triggers for ureadahead ...
    apprentice@precise-box:~$ 

    So yes, it can be installed, started, stopped and removed. When provided with a dispatcher IP through debconf, it gets configured and started without user interaction.

    It can be purged and /etc/res will be gone. It can be installed without anything in debconf, then it will not be started but just lie in wait until it gets configured.

  3. Yes, it does. My colleague Michel ran scripts on my test machine from the dispatcher. He was able to install packages (e.g. firefox) from the dispatcher. This looks good.

[Note]Note

Yet this juggling around with libraries and symlinks is by no means as good as a package built from sources. I hope RES will agree to try that.

[Note]Note

The RES software is proprietary, so I can't link to the package here. However, if you download their software and follow the recipes above (and add a manpage), you should end up with a working package.

[Note]Note

The package we created doesn't build on Lucid, because of unresolvable dependencies. Maybe the package for Red Hat 4 would. But building from source would probably eliminate that problem anyway.