diff options
Diffstat (limited to 'dev/perl/perl-set-infinite')
-rw-r--r-- | dev/perl/perl-set-infinite/Manifest | 23 | ||||
-rw-r--r-- | dev/perl/perl-set-infinite/perl-set-infinite.SlackBuild | 232 |
2 files changed, 255 insertions, 0 deletions
diff --git a/dev/perl/perl-set-infinite/Manifest b/dev/perl/perl-set-infinite/Manifest new file mode 100644 index 00000000..50e3505a --- /dev/null +++ b/dev/perl/perl-set-infinite/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +DIST Set-Infinite-0.63.tar.gz 49960 MD5 8c573e00f3152db222de08b104b74c31 RMD160 e26858f41536c9d70c4ec834924555ff1c68840f SHA1 4732c8826fb3c8baf78bee0ec17111a4a6d3bb4e SHA256 5c9039ff2afed512783808e5b4e588f40000390533f20278d047c3dec851097c SHA512 9b67ffd6dbb0045d9c313a1e07b3455832be0bd2ac20ed9fd85bdd5b07d9809b8c4fdb44e36957dbb6ff21eaee6ef651cd34905b5466ac81f20068e4a0b3b746 +MKBUILD perl-set-infinite.mkbuild 2428 MD5 3d3d1b2fc9202686ece78edbed520f4a RMD160 4b91f4343d918ef7061cf2d6c4d0f27901225e75 SHA1 dcdc75a2506f11f4be5e45ef29959fa114200777 SHA256 453d99a6b925c861756738e8b7e7fcd6bf5abd3855c23b64c741d3b00722fa20 SHA512 99d1d4e15e683fcfd4b42b7de9863e747c96028d99f228049afd43a598824592e5b5e9869fe857e1640e31abb89896a5cb7f6b1327e7778c3e5f265b002df591 +SLACKBUILD perl-set-infinite.SlackBuild 7197 MD5 79e3c351d9135b7126b86eed6f989434 RMD160 44fc39798b444361eb28408c076a0372592ab1e5 SHA1 a8e5f9d8899ca4ab05afcb08509afcac0278dfd3 SHA256 4493b966d797e776cdcee9e7f30092abcc2c13856fa44afe273dfa9d356e5c97 SHA512 309c7403d676ebd7940eb60f2f848650211f1c773d2390cf93364ab8a5c5e8378439b988732b7e67c654606f1fd0007aef3a44b186adfa737e631dde5c6a7b67 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBCAAGBQJKvMwkAAoJEEHL93ESzgeiSLcP/1DbW5OeIEEt1P/oGBgrE9+2 +PYWv5BQMtn54ZWglUpIJwicvUIK8twgvEA5l3sGA5c+0AR3KRyTZ/+kkYdSc7cNL +EA/I75O4MY4Q1FrzKEQJFMOgJkytu9DQuMaPzz7fkZDj2P85smYfZyDzCLo9nsaF +9WOHwkV78gAhtHWDIO+PfkXfTr0gnkqGQR1tdONagzHCOREvn8dh24sFXPrXRdLJ +TZGOkHRQ0KnE+cK72xNmdvzW6SljCD5wSxNDHM6p4x+R9rWVgURVU4JF/fO+YuMs +JiNIHJRxgmbt0gEhLPGBY8+XPQNfmIYmrD1k76XY5s//6BovdZ9O4SQHk/M+zb0M +CbypoC1kRYOx3heRTOpsC5NcN7Pulw4NiWE0XLa1majL8j3y7DiDvdIsSGwH+lU1 +uK6fAzakL5EBgIjcMQv4FFoveR3rqSOvZfk/9R1rapSZgxPhfnjdA3HSQZ3Y0ZNu +1Ugi8UKdCmJbzn6Nv8U+gZ5VmenRWOsM11OMV9YuwkYf8PUFdlxbqNtdUWxPrFft +tY1gDjT2HqLXaKGEwK+H8phdF+39cyGe/hccE6O0YqTSdlJeEbE8CYva8unfsvyu +CpdDX7USjckHiiwA/SgKOFeFQsrdqTwN7viFxAF4jfyrG7lxl1+HJGTdC7koJ8ef +TPSZX9Dm7peQ5DkNd1zN +=nMyd +-----END PGP SIGNATURE----- diff --git a/dev/perl/perl-set-infinite/perl-set-infinite.SlackBuild b/dev/perl/perl-set-infinite/perl-set-infinite.SlackBuild new file mode 100644 index 00000000..1efa0865 --- /dev/null +++ b/dev/perl/perl-set-infinite/perl-set-infinite.SlackBuild @@ -0,0 +1,232 @@ +#!/bin/bash +# +# perl-set-infinite.SlackBuild is free software; you can redistribute +# it and/or modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the License, +# or any later version. +# +# perl-set-infinite.SlackBuild is distributed in the hope that it will +# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple +# Place - Suite 330, Boston, MA 02111-1307, USA +# +# slackbuild for perl-set-infinite, by Silvio Rhatto +# requires: +# tested: perl-set-infinite-0.63 +# model: perl.mkSlackBuild $Rev: 796 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="Set-Infinite" +PKG_NAME="perl-set-infinite" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=0.63} +PKG_VERSION="$(echo "$SRC_VERSION" | tr '[[:blank:]-]' '_')" +BUILD=${BUILD:=1rha} +SRC_DIR=${SRC_DIR:=$CWD}/$PKG_NAME +TMP=${TMP:=/tmp} +PKG=${PKG:=$TMP/package-$PKG_NAME} +REPOS=${REPOS:=$TMP} +SLACKBUILD_PATH=${SLACKBUILD_PATH:="dev/perl/perl-set-infinite"} +PREFIX=${PREFIX:=/usr} +PKG_WORK="$TMP/$SRC_NAME" +CONF_OPTIONS=${CONF_OPTIONS:=""} +NUMJOBS=${NUMJOBS:=""} + +# Set system libraries' path and optmization flags based on $ARCH +LIBDIR="$PREFIX/lib" + +if [ "$ARCH" = "i386" ]; then + SLKCFLAGS="-O2 -march=i386 -mcpu=i686" +elif [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mcpu=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2" + LIBDIR="$PREFIX/lib64" +fi + +# Set error codes (used by createpkg) +ERROR_WGET=31; ERROR_MAKE=32; ERROR_INSTALL=33 +ERROR_MD5=34; ERROR_CONF=35; ERROR_HELP=36 +ERROR_TAR=37; ERROR_MKPKG=38; ERROR_GPG=39 +ERROR_PATCH=40; ERROR_VCS=41; ERROR_MKDIR=42 +ERROR_MANIFEST=43; + +# Clean up any leftovers of previous builds +rm -rf "$PKG_SRC" 2> /dev/null +rm -rf "$PKG" 2> /dev/null + +# Create directories if necessary +mkdir -p "$SRC_DIR" || exit $ERROR_MKDIR +mkdir -p "$PKG" || exit $ERROR_MKDIR +mkdir -p "$REPOS" || exit $ERROR_MKDIR +mkdir -p "$PKG_WORK" || exit $ERROR_MKDIR + +# Dowload source if necessary +SRC="$SRC_NAME-$VERSION.tar.gz" +URL="http://search.cpan.org/CPAN/authors/id/F/FG/FGLOCK/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then + wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET +fi + +# Check Manifest file +if [ -e "$CWD/Manifest" ]; then + + # Manifest signature checking + if grep -q -- "-----BEGIN PGP SIGNED MESSAGE-----" $CWD/Manifest; then + echo "Checking Manifest signature..." + gpg --verify $CWD/Manifest + if [ "$?" != "0" ]; then + exit $ERROR_MANIFEST + fi + fi + + MANIFEST_LINES="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | wc -l`" + + for ((MANIFEST_COUNT=1; MANIFEST_COUNT <= $MANIFEST_LINES; MANIFEST_COUNT++)); do + + MANIFEST_LINE="`grep -E -v "^(MKBUILD|SLACKBUILD)" $CWD/Manifest | head -n $MANIFEST_COUNT | tail -n 1`" + MANIFEST_FILE="`echo $MANIFEST_LINE | awk '{ print $2 }'`" + MANIFEST_FILE_TYPE="`echo $MANIFEST_LINE | awk '{ print $1 }'`" + + if [ -e "$SRC_DIR/$MANIFEST_FILE" ]; then + MANIFEST_FILE="$SRC_DIR/$MANIFEST_FILE" + else + MANIFEST_FILE="`find $CWD -name $MANIFEST_FILE`" + fi + + if [ ! -e "$MANIFEST_FILE" ] || [ -d "$MANIFEST_FILE" ]; then + continue + fi + + echo "Checking Manifest for $MANIFEST_FILE_TYPE $MANIFEST_FILE integrity..." + + SIZE_SRC="`wc -c $MANIFEST_FILE | awk '{ print $1 }'`" + SIZE_MANIFEST="`echo $MANIFEST_LINE | awk '{ print $3 }'`" + + # Check source code size + if [ "$SIZE_SRC" != "$SIZE_MANIFEST" ]; then + echo "SIZE Manifest: $SIZE_MANIFEST; SIZE $SRC: $SIZE_SRC" + exit $ERROR_MANIFEST + else + echo "Size match." + fi + + # Check source code integrity + for ALGO in md5 sha1 sha256 sha512 rmd160; do + if [ $ALGO = "rmd160" ]; then + ALGO_SRC="`openssl rmd160 $MANIFEST_FILE | awk '{ print $2 }'`" + else + ALGO_SRC="`"$ALGO"sum $MANIFEST_FILE | awk '{ print $1 }'`" + fi + ALGO="`echo $ALGO | tr '[:lower:]' '[:upper:]'`" + ALGO_MANIFEST=$(echo $MANIFEST_LINE | sed "s/.* $ALGO //" | awk '{ print $1 }') + if [ "$ALGO_SRC" != "$ALGO_MANIFEST" ]; then + echo "$ALGO Manifest: $ALGO_MANIFEST; $ALGO $SRC: $ALGO_SRC" + exit $ERROR_MANIFEST + else + echo "$ALGO match." + fi + done + + done + +else + exit $ERROR_MANIFEST +fi + +# Untar +cd "$PKG_WORK" +tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TAR +PKG_SRC=`ls -l | awk '/^d/ { print $8 }'` +cd "$PKG_SRC" + +# Configure +perl Makefile.PL || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$PKG" || exit $ERROR_INSTALL + +# Fix .packlist +string="`echo $PKG | sed -e 's/\//\\\\\//g'`" +for file in `find $PKG -name .packlist`; do + sed -e "s/^$string//g" $file > $file.tmp + mv $file.tmp $file +done + +# Strip binaries +( cd "$PKG" + 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 +) + +# Install documentation +DOCS="NEWS TODO README AUTHORS INSTALL ChangeLog MAINTAINERS COPYING LICENSE SIGNATURE readme.*" +mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR +for doc in $DOCS; do + if [ -f "$doc" ]; then + cp -a $doc "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" + fi +done + +# Add package description (slack-desc) +mkdir -p "$PKG/install" || exit $ERROR_MKDIR +cat << EODESC > "$PKG/install/slack-desc" +# 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--------------------------------------------| +perl-set-infinite: perl-set-infinite +perl-set-infinite: +perl-set-infinite: Sets of intervals +perl-set-infinite: +perl-set-infinite: +perl-set-infinite: +perl-set-infinite: +perl-set-infinite: +perl-set-infinite: +perl-set-infinite: +perl-set-infinite: +EODESC + +# Copy slack-required +mkdir -p "$PKG/install" || exit $ERROR_MKDIR +if [ -f "$CWD/slack-required" ]; then + cp $CWD/slack-required $PKG/install +fi + +# Build the package +cd "$PKG" +mkdir -p $REPOS/$SLACKBUILD_PATH +makepkg -l y -c n "$REPOS/$SLACKBUILD_PATH/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG + +# Delete source and build directories if requested +if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then + rm -rf "$PKG_WORK" "$PKG" +fi |