4 usage="cpan2deb <module>"
12 if [ -d locallib ]; then
20 cpan -m $1 1>cpan.out 2>&1 || (echo "cpan failed"; exit 1)
22 # find build directory
24 name=lib${mname/::/-}-perl
26 #builddir_prefix=${mname/::/-}
27 builddir=$(ls -rtd ~/.cpan/build/*/ |tail -1)
30 perl Makefile.PL INSTALL_BASE="~/locallib"
32 make install 1>~/cpan.out 2>&1
33 echo "Module $1 installed to ~/locallib, output written to cpan.out"
37 version=$(perl -M$mname -e 'print $ARGV[0]->VERSION' $mname)
43 cat << EOF >$name/DEBIAN/control
50 Maintainer: WagnerTech UG <mail@wagnertech.de>
51 Description: $1 perl modul
55 #mkdir -p $name/usr/share/perl5
56 #mkdir -p $name/usr/share/man
59 # move locallib content
60 mkdir -p $name/usr/local/
62 for dir in $(ls ~/locallib); do
65 share) mv ~/locallib/share $name/usr/local/
67 man) mv ~/locallib/man $name/usr/
72 fakeroot dpkg-deb --build $name
73 cp $name.deb ${name}_$version.deb
74 echo "${name}_$version.deb erstellt."