5         pushd ~/locallib 1>/dev/null
 
   6                 if [ $(ls lib/p*/ |wc -w) -eq 1 ]
 
   8                         # seems to be arichtecturalsub dir
 
  16                 # check, if there is a real archtecturel depandence
 
  17                 shared_lib=$(find . -name "*.so")
 
  18                 if [ -n "$shared_lib" ]
 
  23         mv ~/locallib/lib $name/usr/
 
  26 usage="cpan2deb <module>"
 
  34 if [ -d locallib ]; then
 
  37 #if [ -d build ]; then
 
  44 cpan -m $1 1>$start_dir/cpan.out 2>&1 || (echo "cpan failed"; exit 1)
 
  46 # find build directory
 
  48 name=lib${mname/::/-}-perl
 
  50 builddir=$(ls -rtd ~/.cpan/build/*/ |tail -1)
 
  52 pushd $builddir 1>/dev/null
 
  53         perl Makefile.PL INSTALL_BASE="~/locallib"
 
  55         make install 1>>~/cpan.out 2>&1
 
  56         echo "Module $1 installed to ~/locallib, output written to $start_dir/cpan.out"
 
  61 # move locallib content
 
  64 for dir in $(ls ~/locallib); do
 
  68         share) mv ~/locallib/share $name/usr/
 
  70         man) mv ~/locallib/man $name/usr/
 
  76 export PERL5LIB="$start_dir/$name/usr/lib/perl5:$PERL5LIB"
 
  77 version=$(perl -M$mname -e 'print $ARGV[0]->VERSION' $mname)
 
  80 if [ "$arch" != "all" ]
 
  83         if [ "$arch" = "i686" ]
 
  85                 # i686-Paketarchitektur gibt es nicht
 
  91 cat << EOF >$name/DEBIAN/control
 
  98 Maintainer: WagnerTech UG <mail@wagnertech.de>
 
  99 Description: $1 perl modul
 
 102 fakeroot dpkg-deb --build $name
 
 103 cp $name.deb ${name}_$version$arch_name.deb
 
 104 echo "${name}_$version$arch_name.deb erstellt."