Jozef Kutej > Debian-Apt-PM-0.08 > dh-make-pm

Download:
Debian-Apt-PM-0.08.tar.gz

Annotate this POD

View/Report Bugs
Source   Latest Release: Debian-Apt-PM-0.09

NAME ^

dh-make-pm - build Debian packages (dh-make-perl on pbuilder+cowdancer steroids)

SYNOPSIS ^

        dh-make-pm --cpan Debian::Apt::PM
        
                --cpan              which module to build
                --no-retry          will skip packaging modules that already failed to package
                --dh-make-perl=s    set different command to execute instead of dh-make-perl to create debian/ folder.
                --no-cpan-patches   do not apply CPAN::Patches
                --tilde=s           string that should apper after version~ (ex. 2.00~string)
                --debian-version        set debian version string, default is 1 (ex. 2.00-1)

DESCRIPTION ^

dh-make-pm is basically recursive dh-make-perl that will build the deb package from CPAN distribution and all it's dependencies properly indexing and creating repository.

USAGE ^

pbuilder set-up ^

        # execute
        sudo apt-get install cowdancer
        cowbuilder --create --distribution sid
        echo "dh-make-pm" > /var/cache/pbuilder/base.cow/etc/debian_chroot

        # add to /etc/pbuilderrc
        MIRRORSITE=http://ftp.cz.debian.org/debian/
        BINDMOUNTS="/var/cache/pbuilder/result"
        PDEBUILD_PBUILDER=cowbuilder
        
        mkdir /var/cache/pbuilder/result/unstable
        wget http://bratislava.pm.org/tutorial/debian-simple-repo/Makefile -O /var/cache/pbuilder/result/Makefile
        wget http://bratislava.pm.org/tutorial/debian-simple-repo/Release.conf -O /var/cache/pbuilder/result/Release.conf
        
        vim /var/cache/pbuilder/base.cow/etc/apt/sources.list    # update to your taste
        echo "deb file:///var/cache/pbuilder/result/ unstable/" >> /var/cache/pbuilder/base.cow/etc/apt/sources.list
        echo "deb file:///var/cache/pbuilder/result/ unstable/" >> /etc/apt/sources.list

        # generate a key without passphrase
        gpg --gen-key
        gpg --export --armor $KEYID
        apt-key add -
        chroot /var/cache/pbuilder/base.cow/
        apt-key add -
        exit

        cd /var/cache/pbuilder/result/
        make

        cowbuilder --update --bindmounts /var/cache/pbuilder/result/
        
        cpan -i Debian::Apt::PM
        
        # patch DhMakePerl.pm
        cd /usr/share/perl5/
        patch -p1 < $DIST_ROOT/patch/DhMakePerl.pm.patch

create deb files ^

        dh-make-pm --cpan Debian::Apt::PM
        dh-make-pm --cpan Tatsumaki

when something goes wrong ^

I most cases when there is a missing or wrong dependency then the .deb build will fail.

        cd $HOME/.dh-make-pm/build/$TAR_BALL_FOLDER/
        vim debian/control
        # set correct dependencies
        pdebuild
        mv /var/cache/pbuilder/result/*-perl* /var/cache/pbuilder/result/unstable/
        cd /var/cache/pbuilder/result
        make
        dh-make-pm --cpan $THE_MODULE_YOU_WANTED_TO_BUILD

TODO ^

    * when source Debian package already exists, get the source and backport
    * build conflicts from the apt-file
syntax highlighting: