aboutsummaryrefslogtreecommitdiff
path: root/dev/python/pyutil
diff options
context:
space:
mode:
Diffstat (limited to 'dev/python/pyutil')
-rw-r--r--dev/python/pyutil/Manifest23
-rw-r--r--dev/python/pyutil/pyutil.SlackBuild214
2 files changed, 237 insertions, 0 deletions
diff --git a/dev/python/pyutil/Manifest b/dev/python/pyutil/Manifest
new file mode 100644
index 00000000..2eaa88d8
--- /dev/null
+++ b/dev/python/pyutil/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST pyutil-1.3.30.tar.gz 71569 MD5 5b5314d79e24e86a9fdaa6a85aeccbbb RMD160 64fddf8101f1f408a5e89cecd2042674622d1e37 SHA1 fa9d17087c47702417d4335687439b0a8602be3c SHA256 2928fafb8968a005fdd7771ad65da512eecd90aa61cbda9a677c948eec234bcf SHA512 a140f7e84a1b4820c048ebc26c5d68b3b61b267c27ca3bcb3810f3c6811e208b9b995b5a234db139656c63f941fc172679dec1b44200cea3570a2f4389f5eef0
+MKBUILD pyutil.mkbuild 5385 MD5 362df1169798b05ff4ebdfa806c67405 RMD160 e063bcafb28ab791d795ff43f817e83f70e6db7f SHA1 ae8879c65412725a98cc441ff6ef3c6b8091a0d6 SHA256 b95422ccdba5a1a2064120ed5132d0738724c91534bd1e424e231ab7b089a9b2 SHA512 03303ad88893430df6194bcd67bf552cd9e52483c5e1b888d5273e4a63a6cd50994c9719fec81ae7725fb20567102d5d87622f1c37a106c511213848f04e7d91
+SLACKBUILD pyutil.SlackBuild 7060 MD5 f22d52367c34c4f33964c209bf0bbb9e RMD160 c2837bbf63a2da92d1928553d1943dad2004f11f SHA1 30548c285ab0b389e0deaa7152d0c3f662c3c645 SHA256 a4a74b4bdeb711f4fdf16ccfe90c286694f4ca37f52efcb0c3a13bdab30f57c5 SHA512 2bb414aebc4a16f4fa1306314005e8c2c2e79861b4e18c333a41d126cfdf674ee390555e20113f904638aeeb355223cb1453ff874dffc785365056841e206f74
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ+xQ0AAoJEEHL93ESzgeiA+AP/1O7dlfQ7g2pgzSexokZ6jx9
+6efBxNyAVxR10e5VoN5UYxiFJdPghXrlzmbt//wHfH9Y5iv5pRRKOAkX86dI4Jrx
+vNwqjgAEans3P+aZbQP12eXhiIZ+3lp8jghjs80PkoCJyyiea0OZQMeT1yK4e9FU
+I6hhSM4aqpicET4ah2ZVAJts80RsB44MZ4UxmA+S1cmNCJlVq903ST4S2jSWcd1a
+BMp/y0hhOFEMCRg4ATVPgimTq24MLqasi0GIEwhz66GGf0qIUNfnzcBAXdG70ehr
+v31tvd5wMEFiB84or0OTPhe3zt2j/usthDCwuaGeyBWovlJabqu0Vwel9l+XWwYz
+MmOTGHJxu/+Mv5dloBno9B8kygkxOf4rn+23YPZVH+s+FTmVKa2eRDa0Dpr5N59R
+9pzB3jV2EbVyhH+Tpi+ORN/95iWKNVd+L8L5f+V+XBFGwzH2UEOaIHh8Is/9H1Q8
+w0QaQlC0QAtAMTMs+sb3HXakrMlFEd3X0djCFLiCO6cmBN3kqn9cuD+ynu77FLYW
+fOOsASN4Xw6FnN0CLk8lxUG90z7NoI9eoSO/bCPpOKeSEvGTIATezgdx/umA1BaJ
+CFRxQKpEGIipzpX9toNsTzLIm0cEe7MiVfHrX/kNT6V5Yf6bvVulGWnpVm+z1fNP
+JiQoG05Dq1C7g8Lr7fts
+=Pb/Z
+-----END PGP SIGNATURE-----
diff --git a/dev/python/pyutil/pyutil.SlackBuild b/dev/python/pyutil/pyutil.SlackBuild
new file mode 100644
index 00000000..7e214386
--- /dev/null
+++ b/dev/python/pyutil/pyutil.SlackBuild
@@ -0,0 +1,214 @@
+#!/bin/bash
+#
+# pyutil.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.
+#
+# pyutil.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 pyutil, by Silvio Rhatto
+# requires:
+# tested: pyutil-1.3.30
+# model: generic.mkSlackBuild $Rev: 805 $
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+ source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+ source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="pyutil"
+PKG_NAME="pyutil"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.3.30}
+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/python/pyutil"}
+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 -mtune=i686"
+elif [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIR="$PREFIX/lib64"
+ LDFLAGS="-L/lib64 -L/usr/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_WORK" 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://pypi.python.org/packages/source/p/pyutil/$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 rmd160 sha1 sha256 sha512; 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="$PWD/`ls -l | awk '/^d/ { print $NF }'`"
+cd "$PKG_SRC"
+
+# Build and install package
+python setup.py build install --root=$PKG || exit $ERROR_INSTALL
+
+# 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="COPYING.GPL COPYING.TGPPL.html CREDITS README.txt"
+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-------------------------------------------------------|
+pyutil: pyutil: a collection of mature utilities for Python programmers
+pyutil:
+pyutil: "These are a few data structures, classes and functions which
+pyutil: we've needed over many years of Python programming and which
+pyutil: seem to be of general use to other Python programmers. Many
+pyutil: of the modules that have existed in pyutil over the years have
+pyutil: subsequently been obsoleted by new features added to the Python
+pyutil: language or its standard library, thus showing that we're not
+pyutil: alone in wanting tools like these."
+pyutil:
+pyutil:
+EODESC
+
+# 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