4 usage="cpan2deb <module>"
12 if [ -d locallib ]; then
19 cpan -m $1 1>cpan.out 2>&1 || (echo "cpan failed"; exit 1)
20 builddir=$(ls -rt ~/.cpan/build |tail -1)
21 cd ~/.cpan/build/$builddir
22 perl Makefile.PL PREFIX="~/locallib"
24 make install 1>~/cpan.out 2>&1
25 echo "Module $1 installed to ~/locallib, output written to cpan.out"
31 #grep "^Installing" cpan.out |sed "s/Installing //" >build/cpan.tmp
37 #/lib/ {print $0" $1/usr/share/perl5";} \
38 #/man/ {print $0" $1/usr/share/man";}' cpan.tmp >cpan.cp
41 version=$(perl -M$1 -e 'print $ARGV[0]->VERSION' $1)
43 name=lib${mname/::/-}-perl
47 cat << EOF >$name/DEBIAN/control
54 Maintainer: WagnerTech UG <mail@wagnertech.de>
55 Description: $1 perl modul
59 #mkdir -p $name/usr/share/perl5
60 #mkdir -p $name/usr/share/man
63 # move locallib content
64 mkdir -p $name/usr/local/
66 for dir in $(ls ~/locallib); do
69 share) mv ~/locallib/share $name/usr/local/
71 man) mv ~/locallib/man $name/usr/
76 fakeroot dpkg-deb --build $name
77 cp $name.deb ${name}_$version.deb
78 echo "${name}_$version.deb erstellt."