: Alien and the LSB
:
: Joey Hess 
: FSG Packaging Summit, Berlin  Dec 6th, 2006
: 
alien overview
    
    package format converter
        deb
        rpm
        lsb
        tgz (Slackware/tarball)
        slp (Stampede)
        pkg (Solaris)
    limitations
        maintainer script issues
            parameters
            environment variables
            execution environment
        dependencies
            no standard names
            no standard versions
            file dependencies
            library/symbol dependencies
        only converts package, not contents
            no guarantee it will work
    lsb support
        looks for lsb packages
            "lsb-*.rpm" name
            depends on "lsb" (for now)
        treats them like rpms (mostly)
            but converts maintainer scripts
            and preserves "lsb" dependency
rpm vs deb
    package names
        characters not allowed in deb names
            no uppercase
            no punctuation except for "-"
    versions
        deb version needs at least one number
            DEADBEEF - not valid
            0xDEADBEEF - ok!
        deb release number also needs a digit
        rpm version cannot contain dashes
    descriptions
        deb descriptions formatting
            change tabs to space
            remove trailing whitespace
            special case for empty lines
            remove leading blank lines
    permissions
        rpm files have 2 sets of permissions
            set in the cpio
            set in the control data
    preinst, etc scripts
        can be binaries in deb
        must be shell scripts in rpm
    architecture names
        powerpc -> ppc
        amd64 -> x86_64 (or em64t)
alien internals
    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);
    package object fields
        name
        version
        release
        arch
        maintainer
        depends
        group
        summary
        description
        copyright
        origformat (rpm, deb, lsb, etc)
        distribution (Debian, Red Hat, etc)
        conffiles
        files
        changelogtext
        postinst
        postrm
        preinst
        prerm
        unpacked_tree
idea: lsb_install
    ; lsb_install /tmp/tree/ \
    ;       --name=lsb-foo \
    ;       --version=1.0 \
    ;       --description="Foo Bar" \
    ;       --preinst /tmp/lsb-foo.preinst