diff options
-rw-r--r-- | dev/libs/argtable/Manifest | 23 | ||||
-rw-r--r-- | dev/libs/argtable/argtable.SlackBuild | 221 |
2 files changed, 244 insertions, 0 deletions
diff --git a/dev/libs/argtable/Manifest b/dev/libs/argtable/Manifest new file mode 100644 index 00000000..da1111ab --- /dev/null +++ b/dev/libs/argtable/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST argtable2-10.tar.gz 3370706 MD5 2ea4cd1b55ee250baa37a42b255ae426 RMD160 f7d730227fd9cdb588b52399db8bc8b1b39710f6 SHA1 4b49f5babacd72fb5d94ab8028e056f467732386 SHA256 73c75feba04b2559265985e74a6d8d754627c9d351554093cc0e74737f721286 SHA512 5e35fa7e0d13b7b484300ff901c032c4c83eafbdb12d6156324d678233d040755c39c07e6eed0b9c5797e70ca8a748ba7b7d6224544b3b24d1df7f301e139d99 +MKBUILD argtable.mkbuild 3453 MD5 d822f5ffbe29d29e4a23f57efe0e885f RMD160 d68cb203c1aa4415c5f67eca0f347ba2ac7d6bb4 SHA1 8a8d2d4a195c180839107450efa08023768bf660 SHA256 0a7414e58cc4eff79e74135743906bbea9d951193fc585a93a598eb612052226 SHA512 7e1aef6b2e44a6d1bf6227d1218e2915fa39e40d300aa16d0fa96e10dc2b5bfafe68f436a709f443ce71746e691823abff81022375891214438e44c31b1a4d2e +SLACKBUILD argtable.SlackBuild 7219 MD5 01d88c0478095f7ce5ade3a2db3d27bc RMD160 89b2cfe5c45bad00e77a3b0c430b91d8d3787dfa SHA1 7097a4db26f166a2f36bc7331483c43a460aca32 SHA256 1684684c9d106baf8c98452c0e7717da5d7bc80b42eb9df0caf98ca8fbb8bcaa SHA512 93e47bf6fa430bb0c69f59558d3336f64f507545877f6dc5ace7a03ca4d16ad164943b9e078018b9d8794bdf5db4d26a17787a89d41a5aeb542ea966c1e5162f +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJnGH8AAoJEEHL93ESzgeiUukQAKVGW5Bga34AIkOXgzc5q6jy +1mAMKrGiPN5Np+yClaRlWWOc8FNt0X1S/b3ywTue9+P1lu6je6m6vH127UqebTrs +T+8aEVglJhs+t0FPX0nPB1dugD/Q8vUPF6rA2abu0B2lF9Z27zCvOD8olaFCUABH +b/JUXFmoUsvrKe5qgcGKAQB/gPpnWl2iix5WR+RmX0EYHX6knYdNfo6HPCqyLsUk +v7k8UY4KHYmxVB734iT7et1Y5rR2CavFgVKW1kTDToHAG66+UwcM3SL+4zSyjnQg +xWn4FqaBytu/yyryRGwMfM8P/5aDt5EQGHCIwD67+smrRVsjZ25qOOCLwi3YwPVj +RDUvxr9vpdjtXg8qrvXEstBiLrNh2IjDh2oVd3j9FD/HCZdWwcp9Hdgv/4AAPK0h +VsnMd8LGUxAa0hErDulvPi944v2Gh4MEtL+aXmbC3I755t1r4XZ33sga3lOm1yKk +AfqLJOzM/p0Hm0AISXXpENrEHLAY6oTLC2/OPR6mxPATif5V+gS31NoxQzb+nuyy +PmC2sX3JDBg1H1I/VsPDf1gY0bQRv9j9z/ysOOwbnmWgtlH826qJVdUJk6SdNXkm +9C4dAgwIS59yOJzWX8OjVmQq6lSJ+PyxhTMqv65zbNlS6y/sSWwLQahVqxwnmweb +sx3W9vQK5H4wGBGA62Pr +=k+qE +-----END PGP SIGNATURE----- diff --git a/dev/libs/argtable/argtable.SlackBuild b/dev/libs/argtable/argtable.SlackBuild new file mode 100644 index 00000000..2ac454f8 --- /dev/null +++ b/dev/libs/argtable/argtable.SlackBuild @@ -0,0 +1,221 @@ +#!/bin/bash +# +# argtable.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. +# +# argtable.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 argtable, by Silvio Rhatto +# requires: +# tested: argtable-10 +# model: generic.mkSlackBuild $Rev: 784 $ +# + +# Look for slackbuildrc +if [ -f ~/.slackbuildrc ]; then + source ~/.slackbuildrc +elif [ -f /etc/slackbuildrc ]; then + source /etc/slackbuildrc +fi + +# Set variables +CWD="$(pwd)" +SRC_NAME="argtable2" +PKG_NAME="argtable" +ARCH=${ARCH:=i486} +SRC_VERSION=${VERSION:=10} +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} +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://downloads.sourceforge.net/argtable/$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" + +# Configure +CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure \ + --prefix="$PREFIX" --libdir="$LIBDIR" $CONF_OPTIONS || exit $ERROR_CONF + +# Compile +make $NUMJOBS || exit $ERROR_MAKE + +# Install +make install DESTDIR="$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="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-----------------------------------------------------| +argtable: argtable +argtable: +argtable: Argtable is an ANSI C library for parsing GNU style command +argtable: line arguments, as in "foo -abc -o myfile --help --count=7". +argtable: It enables a program's command line syntax to be defined in +argtable: the source code as an array of argtable structs. The default +argtable: parsing, validation, and error reporting routines may be +argtable: replaced by user-defined callbacks if desired, and new +argtable: argtable data types may be created to parse user-defined +argtable: argument types. The parsing itself is done using GNU +argtable: getopt and so is 100% GNU compatible. +EODESC + +# Build the package +cd "$PKG" +makepkg -l y -c n "$REPOS/$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 |