summaryrefslogtreecommitdiffstats
path: root/perl/perl-switch
diff options
context:
space:
mode:
Diffstat (limited to 'perl/perl-switch')
-rw-r--r--perl/perl-switch/README5
-rw-r--r--perl/perl-switch/perl-switch.SlackBuild84
-rw-r--r--perl/perl-switch/perl-switch.info10
-rw-r--r--perl/perl-switch/slack-desc19
-rw-r--r--perl/perl-switch/switch.diff11
5 files changed, 129 insertions, 0 deletions
diff --git a/perl/perl-switch/README b/perl/perl-switch/README
new file mode 100644
index 0000000000..81d18ab0c4
--- /dev/null
+++ b/perl/perl-switch/README
@@ -0,0 +1,5 @@
+perl-switch (a switch statement for Perl)
+
+The Switch.pm module implements a generalized case mechanism that
+covers a lot of the numerous possible combinations of switch and case
+values.
diff --git a/perl/perl-switch/perl-switch.SlackBuild b/perl/perl-switch/perl-switch.SlackBuild
new file mode 100644
index 0000000000..6580806c80
--- /dev/null
+++ b/perl/perl-switch/perl-switch.SlackBuild
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+# Slackware build script for perl-switch
+# Written by ponce (matteo.bernardini@gmail.com)
+
+PRGNAM=perl-switch
+VERSION=${VERSION:-2.16}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+SRCNAM=Switch
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $SRCNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
+cd $SRCNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# fix http://rt.cpan.org/Public/Bug/Display.html?id=60380
+patch -p1 < $CWD/switch.diff
+
+perl Makefile.PL \
+ PREFIX=/usr \
+ INSTALLDIRS=vendor \
+ INSTALLVENDORMAN3DIR=/usr/man/man3
+make
+make test
+make install DESTDIR=$PKG
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | xargs rm -f || true
+
+find $PKG -depth -type d -empty -delete || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a Changes README MANIFEST $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/perl/perl-switch/perl-switch.info b/perl/perl-switch/perl-switch.info
new file mode 100644
index 0000000000..53d3ea79ea
--- /dev/null
+++ b/perl/perl-switch/perl-switch.info
@@ -0,0 +1,10 @@
+PRGNAM="perl-switch"
+VERSION="2.16"
+HOMEPAGE="http://search.cpan.org/~rgarcia/Switch-2.16/"
+DOWNLOAD="http://search.cpan.org/CPAN/authors/id/R/RG/RGARCIA/Switch-2.16.tar.gz"
+MD5SUM="bf75dc7f171b4718a2118c3d6cbe6013"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="ponce"
+EMAIL="matteo.bernardini@gmail.com"
+APPROVED=""
diff --git a/perl/perl-switch/slack-desc b/perl/perl-switch/slack-desc
new file mode 100644
index 0000000000..f04b3c3393
--- /dev/null
+++ b/perl/perl-switch/slack-desc
@@ -0,0 +1,19 @@
+# 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 ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+perl-switch: perl-switch (a switch statement for Perl)
+perl-switch:
+perl-switch: The Switch.pm module implements a generalized case mechanism that
+perl-switch: covers a lot of the numerous possible combinations of switch and case
+perl-switch: values.
+perl-switch:
+perl-switch:
+perl-switch:
+perl-switch:
+perl-switch: homepage: http://search.cpan.org/~rgarcia/Switch-2.16/
+perl-switch:
diff --git a/perl/perl-switch/switch.diff b/perl/perl-switch/switch.diff
new file mode 100644
index 0000000000..90e96cbb7d
--- /dev/null
+++ b/perl/perl-switch/switch.diff
@@ -0,0 +1,11 @@
+--- Switch-2.16-wjgfvU/Switch.pm 2009-10-23 00:52:51.000000000 -0700
++++ Switch-2.16-wjgfvUcopy/Switch.pm 2010-08-15 17:41:38.000000000 -0700
+@@ -146,7 +146,7 @@ sub filter_blocks
+ die "Bad $keyword statement (problem in the code block?) near $Switch::file line ", line(substr($source,0, pos $source), $line), "\n";
+ };
+ my $code = filter_blocks(substr($source,$pos[0],$pos[4]-$pos[0]),line(substr($source,0,$pos[0]),$line));
+- $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch $arg;/;
++ $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch($arg);/;
+ $text .= $code . 'continue {last}';
+ next component;
+ }