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  set different command to execute instead of dh-make-perl to create debian/ folder.

DESCRIPTION

dh-make-pm is basicaly recursive dh-make-perl that will build the deb package from CPAN distribution and all it's dependecies 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