aboutsummaryrefslogtreecommitdiff
path: root/dev/python/zbase32
diff options
context:
space:
mode:
Diffstat (limited to 'dev/python/zbase32')
-rw-r--r--dev/python/zbase32/Manifest23
-rw-r--r--dev/python/zbase32/zbase32.SlackBuild214
2 files changed, 237 insertions, 0 deletions
diff --git a/dev/python/zbase32/Manifest b/dev/python/zbase32/Manifest
new file mode 100644
index 00000000..3802e0f0
--- /dev/null
+++ b/dev/python/zbase32/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST zbase32-1.1.1.tar.gz 21222 MD5 b46a97a869f4aa2932182cc555e2f7e1 RMD160 3b9381700d8fee4ad6b3698bdd140b39088036e4 SHA1 b7b41f08000a5073448d73b967dea73156d5f2ad SHA256 f5a10b27b0c5e3beacf46126e086900a991ca55c9e67a76f87791ba133a1a958 SHA512 814d70c9960afba9c7116597311d9503f1c67dd921c3571e4b51d74024c2e778e2bc552269cb66d38100363d0cd2c8fba0480a8be41d5d8b9df5022d191b38fb
+MKBUILD zbase32.mkbuild 4967 MD5 11f74d9213d06e8167b3bd783c19ea22 RMD160 8472d6dd56810d692b87089263669c9c9d342567 SHA1 2f9fee229c94dc69e0e98f42c84a57236b48307a SHA256 01900f12c596bd993e80b8c6555683bda4e33b3b369aacd76e592ee95905af33 SHA512 90c34e7d6685704dbddee90ede83cc938ea8b37714b4395ac28b7608fc04b54e39d272ca996ee0cf60fe2310c7b566250092ccafa73e4e065910c4724cb041f3
+SLACKBUILD zbase32.SlackBuild 6645 MD5 51ff01ec356f1b3b078bf0d768feeee4 RMD160 696ea690387a809a9083715738939173994d8ebe SHA1 ae240d0e5a11303999d4dd93b7538e957bf25d2d SHA256 0f2747e38a20bcfe9623f7fbf3188d4d3e859ee3b12bdd92b57903edcba6d48d SHA512 4cbb1ac79598ea4513ed727f16113b434aaeecd8aa7a9c7f740bbe7598c9bcb07742d837265a46d1f2dcc823f65d82a2270920e8fb88783f1167069e2b74c163
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ+xXoAAoJEEHL93ESzgeiQHwP/1U2XdR5L58t4gt1e4csyOIZ
+zB9l86B9sn5jujafO+kbVQOjbTudDSwXtqIBexnQ2WquS65aParWndsy0sTbpUNJ
+F+OAFqXEGE3OymZlfbN1TyBJvG3n4nv+7Ed9o8qAbmL41okrQgSiW01LMWTKU6mx
+kNymdz1ir4YOnx9AaFX4wJsr3Yrpx2gt7YxIpp5q+wKv5GS7nxhWc3t5bNJXQsUF
+NSfaijxjH/jFG1TwRwf/D8Wzr/3VCOMkkeBH69ctvDrlEz27gNi0XjhFV0hHjmY/
+MDRnafa6oxwQmJ9CgFGEEg2YEjwYo+c9/cwgXMsNDE7pMeOeTjgyDrLP7Uq35sXZ
+Uwb9a/zu/eYZ8UnCWEBe8dFSoibpZscQM0HvmUPt8KJInU+KqkFX6fo1V9cAOvY3
+1Hti2bmGNbfUV36cmcsnRTJ8ydMFqGDyGpHA1LdnboZyIExvl1BQdbj0rOqAaXJQ
+SH36hfnsRJU7U85Wd12rVAykAHGN5o7MqlTxK1P0AK/k2SIQ4e4761gDI+9+3Lks
+npUIPju8eVTPK82ApXGStxwCLgz5bP5hruekvxPfpOxKerLpftib0ubxK/hATuSo
+ieqeUX9tXtt3bedmxJjnsGsnQNuBM1ay0kWBKsEuojLehakodJcFqNCikqg03YYx
+a5JxDPg7XmzhoC08G2Sp
+=Zet0
+-----END PGP SIGNATURE-----
diff --git a/dev/python/zbase32/zbase32.SlackBuild b/dev/python/zbase32/zbase32.SlackBuild
new file mode 100644
index 00000000..71096c2d
--- /dev/null
+++ b/dev/python/zbase32/zbase32.SlackBuild
@@ -0,0 +1,214 @@
+#!/bin/bash
+#
+# zbase32.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.
+#
+# zbase32.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 zbase32, by Silvio Rhatto
+# requires:
+# tested: zbase32-1.1.1
+# 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="zbase32"
+PKG_NAME="zbase32"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.1.1}
+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/zbase32"}
+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/z/zbase32/$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="DESIGN PKG-INFO README TODO"
+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------------------------------------------------------|
+zbase32: zbase32
+zbase32:
+zbase32: An alternate base32 encoder (not RFC 3548 compliant).
+zbase32:
+zbase32:
+zbase32:
+zbase32:
+zbase32:
+zbase32:
+zbase32:
+zbase32:
+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