Converting the Novell iPrint client to a Debian package

April 2008


  1. From an iPrint servers' main page, all client rpm can be downloaded. So there is no need to install platform X in order to dowload the client rpm for platform X.

  2. We unpack the Debian package (created with alien):


      
    mkdir -p unpack/DEBIAN &&\
    dpkg -X novell-iprint-xclient-sl_6.500.20070508-2_amd64.deb unpack &&\
    dpkg -e novell-iprint-xclient-sl_6.500.20070508-2_amd64.deb unpack/DEBIAN
      

  3. Then we enter the unpack directory, and start moving things around:

    1. We move the log file to a proper place:


            
      cd unpack
      mkdir -p var/log/iprint && rm -rf var/opt/
            

          

    2. We move the manpage to a proper place:


            
      mkdir -p usr/share/man/man1 &&\
      mv opt/novell/man/man1/iprntcmd.1 usr/share/man/man1 &&\
      gzip usr/share/man/man1/iprntcmd.1 &&\
      rm -rf opt/novell/man/
            

          

    3. We move around some libraries:


            
      mv opt/novell/lib/* usr/lib
      mv opt/novell/lib64/* usr/lib64
      rm -rf opt/novell/lib*
            

          

    4. We push around some messages:


            
      mv opt/novell/iprint/share/locale usr/share/
            

          

    5. We push around (and convert in the process) some icons:


            
      mkdir -p usr/share/icons/gnome/32x32/apps/
      convert opt/novell/iprint/share/icons/iprint_32.gif \
              usr/share/icons/gnome/32x32/apps/iprint.png
      mkdir -p usr/share/icons/kdeclassic/32x32/apps
      convert opt/novell/iprint/share/icons/iprint_32.gif \
              usr/share/icons/kdeclassic/32x32/apps/iprint.png

      mkdir -p usr/share/icons/gnome/16x16/apps
      convert opt/novell/iprint/share/icons/iprint_16.gif \
              usr/share/icons/gnome/16x16/apps/iprint.png
      mkdir -p usr/share/icons/kdeclassic/16x16/apps
      convert opt/novell/iprint/share/icons/iprint_16.gif \
              usr/share/icons/kdeclassic/16x16/apps/iprint.png

      rm -rf opt/novell/iprint/share/
            

          

    6. We move around a few binaries:


            
      mkdir -p usr/bin
      mv opt/novell/iprint/bin/* usr/bin/
      rm -rf opt/novell/iprint/bin
            

          

    7. We move around some plugins:


            
      mkdir -p usr/lib/iprint
      mv opt/novell/iprint/plugin/* usr/lib/iprint/
      rm -rf opt/novell/iprint/
            

          

    8. We move around some desktop links:


            
      mkdir -p usr/share/applications/kde/
      mv opt/kde3/share/applications/novell-iprint.desktop  usr/share/applications/kde/

      mkdir usr/share/autostart
      mv opt/kde3/share/autostart/novell-iprint.desktop usr/share/autostart/

      mkdir -p usr/share/gnome/autostart
      mv opt/gnome/share/autostart/novell-iprint.desktop usr/share/gnome/autostart
            

          

    9. We handle some plugins:


            
      mkdir -p usr/lib/mozilla/plugins/
      mkdir -p usr/lib/firefox/plugins/
      mkdir -p usr/lib/iceweasel/plugins/
      cd usr/lib/mozilla/plugins/
      rm ./*
      ln -s ../../iprint/npnipp* ./
      cd ../../firefox/plugins/
      rm -rf ./*
      ln -s ../../iprint/npnipp* ./
      cd ../../iceweasel/plugins/
      ln -s ../../iprint/npnipp* ./

      rm -rf opt
            

          

    10. We clean up some odds and ends that are not needed any more because we put our files in default directories:


            
      rm -rf etc/ld.so.conf.d
      rm -rf etc/profile.d
            

          

    11. We leave etc/opt/novell/iprint/libiprint.conf in place because we suspect it has been hardcoded here and there.

  4. We modify some files that contain SuSE-specific path info:


      
    sed -i 's%/opt/novell/iprint/bin/iprint-listener%/usr/bin/iprint-listener%g; s%/opt/novell/iprint/share/icons/iprint_32.gif%/usr/share/icons/kdeclassic/32x32/apps/iprint.png%g' usr/share/applications/kde/novell-iprint.desktop
    sed -i 's%/opt/novell/iprint/bin/iprint-listener%/usr/bin/iprint-listener%g; s%/opt/novell/iprint/share/icons/iprint_32.gif%/usr/share/icons/kdeclassic/32x32/apps/iprint.png%g' usr/share/gnome/autostart/novell-iprint.desktop
    sed -i 's%/opt/novell/iprint/bin/iprint-listener%/usr/bin/iprint-listener%g' usr/bin/iprint-gnome-init

    cd usr/share/autostart/
    rm novell-iprint.desktop
    ln -s ../applications/kde/novell-iprint.desktop ./
      

  5. We modify the Debian control file to make the package depend on libglitz1:

    sed -i '/^Depends:/ s%$%, libglitz1%g' DEBIAN/control

  6. We truncate DEBIAN/conffiles


      
    cd etc/ && ln -s opt/novell/iprint/libiprint.conf ./
    echo -e "/etc/opt/novell/iprint/libiprint.conf\n/etc/libiprint.conf" > DEBIAN/conffiles
      

  7. We update the md5 checksums:

    find -type f -exec md5sum {} \; |grep -v DEBIAN|sed 's%\.\/%%g' > DEBIAN/md5sums

  8. We create a directory /var/log/novell/iprint/client and modify the postinstall script to set permissions on it


      
    mkdir -p /var/log/novell/iprint/client &&
    sed -i 's%\/var\/opt\/novell\//log\/novell\/iprint%g' DEBIAN/postinst
      

  9. Then we build a package from it:


      
    mv unpack novell-iprint-xclient-sl-amd64  \&\&
    dpkg-deb -b novell-iprint-xclient-sl-amd64  
      

[Warning]Warning

The path to /var/opt/novell/log seems to be hardcoded into several binaries and not configurable in /etc/libiprint.conf. So in /etc/libiprint.conf, the line TraceLevel off should remain. Alternatively, we could recompile from source, which we didn't do here.

[Warning]Warning

Please note that the resulting Debian package doesn't have all dependencies properly listed, and it isn't signed. It wouldn't be much use in a serious repository.

Procedure 67.  Trying out the new package

  • First we remove the package we created with alien, and we check what remains of the package:


      
    sudo apt-get remove novell-iprint-xclient-sl libglitz1
    for LINE in $(find etc usr var -not -type d ) ; do if [ -e "/${LINE}" ] ; then echo "/${LINE} still exists" ; fi ; done