Alien and the LSB

    Joey Hess FSG Packaging Summit, Berlin Dec 6th, 2006

  1. alien overview
    1. package format converter
      1. deb
      2. rpm
      3. lsb
      4. tgz (Slackware/tarball)
      5. slp (Stampede)
      6. pkg (Solaris)
    2. limitations
      1. maintainer script issues
        1. parameters
        2. environment variables
        3. execution environment
      2. dependencies
        1. no standard names
        2. no standard versions
        3. file dependencies
        4. library/symbol dependencies
      3. only converts package, not contents
        1. no guarantee it will work
    3. lsb support
      1. looks for lsb packages
        1. "lsb-*.rpm" name
        2. depends on "lsb" (for now)
      2. treats them like rpms (mostly)
        1. but converts maintainer scripts
        2. and preserves "lsb" dependency
  2. rpm vs deb
    1. package names
      1. characters not allowed in deb names
        1. no uppercase
        2. no punctuation except for "-"
    2. versions
      1. deb version needs at least one number
        1. DEADBEEF - not valid
        2. 0xDEADBEEF - ok!
      2. deb release number also needs a digit
      3. rpm version cannot contain dashes
    3. descriptions
      1. deb descriptions formatting
        1. change tabs to space
        2. remove trailing whitespace
        3. special case for empty lines
        4. remove leading blank lines
    4. permissions
      1. rpm files have 2 sets of permissions
        1. set in the cpio
        2. set in the control data
    5. preinst, etc scripts
      1. can be binaries in deb
      2. must be shell scripts in rpm
    6. architecture names
      1. powerpc -> ppc
      2. amd64 -> x86_64 (or em64t)
  3. alien internals
    1. alien skeleton
         #!/usr/bin/perl
         use Alien::Package::Deb;
         use Alien::Package::Lsb;
        
         $p=Alien::Package::Lsb->new(
         		filename => "lsb-foo.rpm");
         $p->unpack;
        
         bless($p, "Alien::Package::Deb");
        
         $p->prep;
         $p->install($p->build); 
    2. package object fields
      1. name
      2. version
      3. release
      4. arch
      5. maintainer
      6. depends
      7. group
      8. summary
      9. description
      10. copyright
      11. origformat (rpm, deb, lsb, etc)
      12. distribution (Debian, Red Hat, etc)
      13. conffiles
      14. files
      15. changelogtext
      16. postinst
      17. postrm
      18. preinst
      19. prerm
      20. unpacked_tree
  4. idea: lsb_install
       lsb_install /tmp/tree/ \
      		--name=lsb-foo \
      		--version=1.0 \
      		--description="Foo Bar" \
      		--preinst /tmp/lsb-foo.preinst