#!/bin/sh
# make_math-matrix.sh is a script that generates a DEB Match::Matrix package
# from CPAN source. Aimed at Ubuntu 8.04

set -o errexit  # Exit when simple command fails.  Same as `set -e'
set -o nounset  # Trigger error when expanding unset variables.  Same as `set -u'

echo "*** Going to install dependencies from repository..."
sudo aptitude -y install \
  build-essential devscripts dh-make-perl perl libimage-size-perl libimage-exiftool-perl libgraphviz-perl libmath-matrix-perl

LOG=$HOME/${0}.log
VER=Panotools-Script-0.21
mkdir -p $HOME/src
cd $HOME/src
wget  http://search.cpan.org/CPAN/authors/id/B/BP/BPOSTLE/$VER.tar.gz
tar -xvzf $VER.tar.gz
dh-make-perl $VER
cd $VER
debuild --rootcmd=sudo --no-tgz-check -i -us -uc -b
# Clean up 
NAME=libpanotools-script-perl_0.21
cd $HOME/src
rm -rf $NAME-1_amd64.build $NAME-1_amd64.changes
  
echo "The package is in $HOME/src directory"

