From 5ee4c14efb7a55b41a7f3ebe14a9377f26bf2983 Mon Sep 17 00:00:00 2001 From: rhatto Date: Fri, 1 May 2009 15:27:08 +0000 Subject: tahoe: updating tahoe and dependencies git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2179 370017ae-e619-0410-ac65-c121f96126d4 --- dev/python/argparse/Manifest | 23 ++++ dev/python/argparse/argparse.SlackBuild | 214 ++++++++++++++++++++++++++++++++ 2 files changed, 237 insertions(+) create mode 100644 dev/python/argparse/Manifest create mode 100644 dev/python/argparse/argparse.SlackBuild (limited to 'dev/python/argparse') diff --git a/dev/python/argparse/Manifest b/dev/python/argparse/Manifest new file mode 100644 index 00000000..039bfd22 --- /dev/null +++ b/dev/python/argparse/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST argparse-0.9.1.zip 114894 MD5 37675a2dd5822a2f5bd16f3fd4d8b4f1 RMD160 c9c03916aa6d87ff41998a8fe6446cbc94b9a321 SHA1 3f5ba68ac903e2c4f0af2b867a9c269a1218b615 SHA256 d560ebd2198643e787890ff19c923b7ca4950c9a927b95ab4eee32c6b9185c02 SHA512 552becb6643883f16583e714008f9d3d3ecaf69dc32e775464bb595e942455f75c698358b5a5e97afaff3baf717f1d5a1d43ea979db06cc3b6aa6fd6c7b56bff +MKBUILD argparse.mkbuild 5320 MD5 5cbff25ea2e719adab39ac283d80d47f RMD160 bf97d190919fde5f05e1cb6e5872413d4b0dad61 SHA1 0fcd37c13ac53f61b9c3fd5cbcc15ef4722e8427 SHA256 6e3bec92c9fa9b0693554708740b559127fd80720bf485832098e0b27ca22621 SHA512 4556aee8ee6904e2f10e2943e1d689403f7c21168c5d348a85cba5ee4bd03b03764a91716eca82b32f403551b7790493c697118686cd950bb20a6bfa11423f36 +SLACKBUILD argparse.SlackBuild 6955 MD5 93cb81b0b0a8f394c3f3699fb0362ff9 RMD160 b16637aeb30ee23b24e14821d852c9f85a39bb29 SHA1 a9ebe4c4944df754a9812713a675e87999e1d119 SHA256 305edec0930f73498cdbf5c6c53866b5b59ad3558ec6b11f0decd3d44cb44757 SHA512 85538ca9f78be3c49cc854af20ef37159402c2a846b076381542dbb06152723fee8f12bcdb1d63ded44007ee4da1421bf2d39c0792ef8586db03aa2b194543f3 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJ+xVJAAoJEEHL93ESzgeiFykP/20AhIpkdGWEZlI0qvST2xJ8 +0t2M0FExfNj4ZF/LfmeNwu1aeZDpeeoWLlSSoj2I1fAkRSyWqlFTgwae2o5g7hhv +4xVPYIWAsO6jQeupqyxPbZ5Ce5JAsyev5G1aeJGMEwBIE+L1rMVc/msYRs6xmxtH +FA9usk+fB/WNVLRl4zTlDNeHk84jOJONKzWelvmcgUYMczJu4/wi0Z+WuEI1CHGc +KKOZGSKiQP1mIoJVasCbWkax98ljbNy2R11lyGeQFN9ImuakH8P1piyOiOH1mnnx +xHZrcBn5mIgDN7mqDtKnt5WSKJMvnD7Cqq/WaIiFmKIm0r5xz11CwArF1luA/csR +I8+NUNrQwCbyoO+5lvFXp0yvJTMteu3cj6FfDHfp0iWWE4KtLxxRr+5CYfXZ5ca/ +1VJfDQgRJwy/4A5hMGIbv9hneT5wSoN3AsqNqyhzCMSrgUt9L1reJuiRpKQZ50AN +xZ6lv9qUzu9jwcu24oBkCnCc5W62DtMwX2jA75VGXSTJgA33m0l20awjLVigVFSC +Ttz5+kyjLxgnieuoSfbM8FckxbS8FD1cX9gQA6S9berZjIK2pxW9XiKYgmjsBvGM +A7DMZonhSBmPe47fpZtknwty46bP9tWNbkEi+UWFqudGD++n7VUrVpx5R8gfjWU4 +/mY7Q/YVk70u5385yuZM +=eszu +-----END PGP SIGNATURE----- diff --git a/dev/python/argparse/argparse.SlackBuild b/dev/python/argparse/argparse.SlackBuild new file mode 100644 index 00000000..72ffc6c2 --- /dev/null +++ b/dev/python/argparse/argparse.SlackBuild @@ -0,0 +1,214 @@ +#!/bin/bash +# +# argparse.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. +# +# argparse.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 argparse, by Silvio Rhatto +# requires: +# tested: argparse-0.9.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="argparse" +PKG_NAME="argparse" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=0.9.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/argparse"} +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.zip" +URL="http://pypi.python.org/packages/source/a/argparse/$SRC" + +if [ ! -s "$SRC_DIR/$SRC" ] || ! unzip -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" +unzip "$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="README.txt PKG-INFO" +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-----------------------------------------------------| +argparse: argparse: An optparse-inspired command-line parsing library +argparse: +argparse: Argparse takes the best of the optparse command-line parsing +argparse: module and brings it new life. Argparse adds positional as well +argparse: as optional arguments, the ability to create parsers for +argparse: sub-commands, more informative help and usage messages, and +argparse: much more. At the same time, it retains the ease and flexibility +argparse: of use that made optparse so popular. +argparse: +argparse: +argparse: +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 -- cgit v1.2.3