How to build a Debian GNU/Linux Package (rdesktop 1.3.1 backport for "woody" on alpha)

For an old Digital/Compaq/HP Alphaserver 1000A 4/266 running Debian GNU/Linux 3.0 I've compiled  the program "rdesktop" for accessing a Microsoft Windows 2000 terminal server. A few days later I think about building a debian package of my installation. I googled around and I found no reasonable documentation on doing this for a more complicated example. As a result of my efforts you can read this short manual. Relax and enjoy!

  1. Perform the usual ./configure; make;... tasks. I won't describe them. As a hint I used to install my home build binaries in the /usr/local/ branch.
  2. Now we have to retrieve the debian packages which rdesktop is linked against. There is a small bash shell script "fdp" (find debian package) for doing this you will find it at the end of this page. If I run this script I've got the following information on my alpha system:
    # ./fdp '/usr/local/bin/rdesktop'
    /usr/local/bin/rdesktop is linked against:
    Package: libc6.1
    Version: 2.2.5-11.5
    
    Package: libssl0.9.6
    Version: 0.9.6c-2.woody.6
    
    Package: xlibs
    Version: 4.1.0-16woody3
    
    #
    
  3. At this step we have to identify the files rdesktop needs to execute succesfully. I found the information delivered by the "Makefile" would do the job:

  4. Now we can build the debian tree in our home directory. I created a directory "newpackages" including the needed subdirectories:

    Copy the desired files into the created directories. All names are case sensitive! Our package will be named "rdesktop.woody.1.3.1.deb" and we must have a look onto the file permissions. If this is done it looks like the following:
    hostname:/home/ickstadt/newpackages# ls -la -R
    .:
    total 104
    drwxr-xr-x    3 ickstadt ickstadt     4096 Mar 30 10:26 .
    drwxr-xr-x    7 ickstadt ickstadt     4096 Mar 30 09:22 ..
    drwxr-xr-x    4 ickstadt ickstadt     4096 Mar 30 09:22 rdesktop.woody.1.3.1
    -rw-r--r--    1 root     root        86266 Mar 30 10:26 rdesktop.woody.1.3.1.deb
    
    ./rdesktop.woody.1.3.1:
    total 16
    drwxr-xr-x    4 ickstadt ickstadt     4096 Mar 30 09:22 .
    drwxr-xr-x    3 ickstadt ickstadt     4096 Mar 30 10:26 ..
    drwxr-xr-x    2 ickstadt ickstadt     4096 Mar 30 10:23 DEBIAN
    drwxr-xr-x    3 root     root         4096 Mar 30 09:22 usr
    
    ./rdesktop.woody.1.3.1/DEBIAN:
    total 12
    drwxr-xr-x    2 ickstadt ickstadt     4096 Mar 30 10:23 .
    drwxr-xr-x    4 ickstadt ickstadt     4096 Mar 30 09:22 ..
    -rwxr-xr-x    1 root     staff         519 Mar 30 10:26 control
    
    ./rdesktop.woody.1.3.1/usr:
    total 12
    drwxr-xr-x    3 root     root         4096 Mar 30 09:22 .
    drwxr-xr-x    4 ickstadt ickstadt     4096 Mar 30 09:22 ..
    drwxrwsr-x    5 root     staff        4096 Mar 30 09:22 local
    
    ./rdesktop.woody.1.3.1/usr/local:
    total 20
    drwxrwsr-x    5 root     staff        4096 Mar 30 09:22 .
    drwxr-xr-x    3 root     root         4096 Mar 30 09:22 ..
    drwxrwsr-x    2 root     staff        4096 Mar 30 09:54 bin
    drwxrwsr-x    3 root     staff        4096 Mar 30 09:51 man
    drwxrwsr-x    3 root     staff        4096 Mar 30 09:22 share
    
    ./rdesktop.woody.1.3.1/usr/local/bin:
    total 176
    drwxrwsr-x    2 root     staff        4096 Mar 30 09:54 .
    drwxrwsr-x    5 root     staff        4096 Mar 30 09:22 ..
    -rwxr-xr-x    1 root     staff      224944 Mar 22 11:51 rdesktop
    
    ./rdesktop.woody.1.3.1/usr/local/man:
    total 12
    drwxrwsr-x    3 root     staff        4096 Mar 30 09:51 .
    drwxrwsr-x    5 root     staff        4096 Mar 30 09:22 ..
    drwxr-sr-x    2 root     staff        4096 Mar 30 09:53 man1
    
    ./rdesktop.woody.1.3.1/usr/local/man/man1:
    total 16
    drwxr-sr-x    2 root     staff        4096 Mar 30 09:53 .
    drwxrwsr-x    3 root     staff        4096 Mar 30 09:51 ..
    -rw-r--r--    1 root     staff        4351 Mar 22 11:51 rdesktop.1
    
    ./rdesktop.woody.1.3.1/usr/local/share:
    total 12
    drwxrwsr-x    3 root     staff        4096 Mar 30 09:22 .
    drwxrwsr-x    5 root     staff        4096 Mar 30 09:22 ..
    drwxr-sr-x    3 root     staff        4096 Mar 30 09:22 rdesktop
    
    ./rdesktop.woody.1.3.1/usr/local/share/rdesktop:
    total 12
    drwxr-sr-x    3 root     staff        4096 Mar 30 09:22 .
    drwxrwsr-x    3 root     staff        4096 Mar 30 09:22 ..
    drwxr-sr-x    2 root     staff        4096 Mar 30 09:55 keymaps
    
    ./rdesktop.woody.1.3.1/usr/local/share/rdesktop/keymaps:
    total 132
    drwxr-sr-x    2 root     staff        4096 Mar 30 09:55 .
    drwxr-sr-x    3 root     staff        4096 Mar 30 09:22 ..
    -rw-r--r--    1 root     staff        2239 Mar 22 11:51 ar
    -rw-r--r--    1 root     staff        2085 Mar 22 11:51 common
    -rw-r--r--    1 root     staff        2576 Mar 22 11:51 da
    -rw-r--r--    1 root     staff        2467 Mar 22 11:51 de
    -rw-r--r--    1 root     staff        2541 Mar 22 11:51 de-ch
    -rw-r--r--    1 root     staff        2581 Mar 22 11:51 en-gb
    -rw-r--r--    1 root     staff         609 Mar 22 11:51 en-us
    -rw-r--r--    1 root     staff        2236 Mar 22 11:51 es
    -rw-r--r--    1 root     staff        2685 Mar 22 11:51 fi
    -rw-r--r--    1 root     staff         907 Mar 22 11:51 fo
    -rw-r--r--    1 root     staff        2588 Mar 22 11:51 fr
    -rw-r--r--    1 root     staff        2876 Mar 22 11:51 fr-be
    -rw-r--r--    1 root     staff         934 Mar 22 11:51 fr-ca
    -rw-r--r--    1 root     staff        2471 Mar 22 11:51 fr-ch
    -rw-r--r--    1 root     staff        2699 Mar 22 11:51 hr
    -rw-r--r--    1 root     staff        1866 Mar 22 11:51 hu
    -rw-r--r--    1 root     staff        2462 Mar 22 11:51 it
    -rw-r--r--    1 root     staff        2034 Mar 22 11:51 ja
    -rw-r--r--    1 root     staff        1096 Mar 22 11:51 lt
    -rw-r--r--    1 root     staff        2840 Mar 22 11:51 lv
    -rw-r--r--    1 root     staff        2366 Mar 22 11:51 mk
    -rw-r--r--    1 root     staff         298 Mar 22 11:51 modifiers
    -rw-r--r--    1 root     staff        2576 Mar 22 11:51 no
    -rw-r--r--    1 root     staff        2672 Mar 22 11:51 pl
    -rw-r--r--    1 root     staff        2450 Mar 22 11:51 pt
    -rw-r--r--    1 root     staff        1354 Mar 22 11:51 pt-br
    -rw-r--r--    1 root     staff        2554 Mar 22 11:51 ru
    -rw-r--r--    1 root     staff        2293 Mar 22 11:51 sl
    -rw-r--r--    1 root     staff         999 Mar 22 11:51 sv
    -rw-r--r--    1 root     staff        3123 Mar 22 11:51 th
    -rw-r--r--    1 root     staff        2649 Mar 22 11:51 tr
    hostname:/home/ickstadt/newpackages#
      
  5. Hmm, there is a file called "./rdesktop.woody.1.3.1/DEBIAN/control" what can it be? The answer is easy it is a plain text file full of information about the entire package. This file is mandantory and you will retrieve something interesting about it by typing "man 5 deb-control" on the shell. The content of our control file looks like:
    Package: rdesktop
    Version: 1.3.1
    Section: x11
    Priority: optional
    Architecture: alpha
    Depends: libc6.1 (>= 2.2.5-11.5), libssl0.9.6 (>= 0.9.6c-2), xlibs (>= 4.1.0-16)
    Maintainer: Frank Ickstadt <my.email@address.tld>
    Description: RDP client for Windows NT/2000 Terminal Server
     rdesktop is an open source client for Windows NT/2000 Terminal
     Server, capable of natively speaking its Remote Desktop Protocol
     (RDP) in order to present the user's NT/2000 desktop. Unlike
     Citrix ICA, no server extensions are required.
      
    As you can see we use the data given from our fdp script to declare the dependencies. The description is gathered from the rdesktop web site. Beware: The blank at the beginning of the last four lines are not any kind of typos they have to be the first character in the lines!
  6. Now we are ready to build our first debian package and "dpkg-deb --build" creates the final stuff:
    hostname:/home/ickstadt/newpackages# dpkg-deb --build rdesktop.woody.1.3.1
    dpkg-deb: building package `rdesktop' in `rdesktop.woody.1.3.1.deb'.
      
  7. Just before reaching the end we make some tests to check the newly created package:
  8. Final we reach the end of this short manual. At last we have to rename the debian package to fit the debian nomenclature:
    mv rdesktop.woody.1.3.1.deb rdesktop_1.3.1-1_alpha.deb
      
That's all folks! You can install the package using "dpkg -i rdesktop_1.3.1-1_alpha.deb" or uninstall with following syntax "dpkg -r rdesktop". If you might have a look to the repository just type "dpkg --get-selections | grep rde":
hostname:/home/ickstadt/newpackages# dpkg -i rdesktop_1.3.1-1_alpha.deb
Selecting previously deselected package rdesktop.
(Reading database ... 51340 files and directories currently installed.)
Unpacking rdesktop (from rdesktop_1.3.1-1_alpha.deb) ...
Setting up rdesktop (1.3.1) ...

hostname:/home/ickstadt/newpackages# dpkg -r rdesktop
(Reading database ... 51379 files and directories currently installed.)
Removing rdesktop ...
dpkg - warning: while removing rdesktop, directory `/usr/local/share' not empty so not removed.
dpkg - warning: while removing rdesktop, directory `/usr/local/man/man1' not empty so not removed.
dpkg - warning: while removing rdesktop, directory `/usr/local/man' not empty so not removed.

hostname:/home/ickstadt/newpackages# dpkg --get-selections | grep rde
rdesktop                                        install
  

You can download the rdesktop 1.3.1 package for i386 [54 kB] and alpha [91 kB]. I would like to thank Martin Schmitt from ScSy for building the package for i386 architecture and the initial work on fdp [5 kB] shell script.

You can download this page as pdf file [121 kB].


Frank Ickstadt - Am Dattenbach 9-11 - 65817 Eppstein - Germany Frank Ickstadt
Am Dattenbach 9-11
65817 Eppstein
Germany
  Phone: not available Phone: not available

frank [dot] ickstadt [at] removethis gmail [dot] com

frank [dot] ickstadt [at] removethis gmail [dot] com   Fax: currently out of order Fax: currently out of order

jEdit Programmer's Text Editor button