summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2004-11-18 04:10:52 +0000
committerJason Woodward2004-11-18 04:10:52 +0000
commit47d95714fb76f2725f11cb0e4dc13419f2ef1896 (patch)
tree6b27c7ac32abfd9936916d01408fc15002f2d4ac
parentf70ba5d104e08bb5f359fb0e8248f8d0507b20d1 (diff)
downloadcpan2tgz-47d95714fb76f2725f11cb0e4dc13419f2ef1896.tar.gz
added buildslackpkg.sh script
-rw-r--r--MANIFEST.SKIP1
-rwxr-xr-xbuildslackpkg.sh79
2 files changed, 80 insertions, 0 deletions
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 434afe6..af9fb22 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -2,3 +2,4 @@
CVS\/.*
.*.bak
Makefile$
+buildslackpkg.sh$
diff --git a/buildslackpkg.sh b/buildslackpkg.sh
new file mode 100755
index 0000000..3031c47
--- /dev/null
+++ b/buildslackpkg.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+DESTINATION=/tmp/$$
+VERSION=`grep VERSION cpan2tgz |awk '{print $4}'|cut -f2 -d\"`
+PKGNAME=cpan2tgz
+
+perl Makefile.PL
+make
+chown -R root.root .
+find . -perm 777 -exec chmod 755 {} \;
+find . -perm 555 -exec chmod 755 {} \;
+find . -perm 444 -exec chmod 644 {} \;
+find . -perm 666 -exec chmod 644 {} \;
+find . -perm 664 -exec chmod 644 {} \;
+
+make install DESTDIR=$DESTINATION
+
+if [ ! -d "$DESTINATION" ]; then
+ echo Failed to install to $DESTINATION
+ exit
+fi
+
+(cd $DESTINATION && mkdir -p ./usr/doc/${PKGNAME}-${VERSION} )
+find . -iregex '.*readme.*' -o -iregex '.*change.*' -o -iregex '.*todo.*' -o -iregex '.*license.*' -o -iregex '.*copying.*' -o -iregex '.*install.*' -o -iregex '.*\.txt' -o -iregex '.*\.html' |xargs -r -iZ cp Z $DESTINATION/usr/doc/${PKGNAME}-${VERSION}
+
+(
+ cd $DESTINATION;
+ find . | xargs file | grep 'executable' | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep 'shared object' | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find ./usr/share/man/ -name '*.3' -exec gzip -9 {} \; 2> /dev/null
+ find ./usr/share/man/ -name '*.1' -exec gzip -9 {} \; 2> /dev/null
+ if [ -d ./usr/share/man ]; then
+ mv ./usr/share/man ./usr
+ fi
+ if [ -d ./usr/bin ]; then
+ chown -R root.bin ./usr/bin
+ chmod 755 ./usr/bin/*
+ fi
+ chmod 644 ./usr/man/man?/*
+ rmdir ./usr/share
+ mkdir install
+
+ PERLLOCALPOD=`find . -name perllocal.pod`
+ cat >./install/doinst.sh <<EOF
+#!/bin/sh
+cat >> ${PERLLOCALPOD/.\\//} <<PLP
+EOF
+ cat $PERLLOCALPOD >>install/doinst.sh
+ echo "PLP" >>install/doinst.sh
+ rm $PERLLOCALPOD
+
+ echo perl > ./install/slack-required
+
+ cat >./install/slack-desc <<EOF
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+${PKGNAME}: ${PKGNAME} - create Slackware packages from CPAN Perl modules
+${PKGNAME}:
+${PKGNAME}: Packaged by cpan2tgz
+${PKGNAME}:
+${PKGNAME}: cpan2tgz by Jason Woodward <woodwardj at jaos dot org>
+${PKGNAME}:
+${PKGNAME}:
+${PKGNAME}:
+${PKGNAME}: http://software.jaos.org/
+${PKGNAME}:
+EOF
+ makepkg -l y -c n /usr/src/${PKGNAME}-${VERSION}-noarch-1.tgz
+)
+
+make distclean
+rm -r $DESTINATION
+