aboutsummaryrefslogtreecommitdiff
path: root/app/crypt
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2009-01-28 00:04:44 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2009-01-28 00:04:44 +0000
commit2a1df3cc5f2f072fcbf0a78b3b879616dafd5235 (patch)
tree6f297078c4e0b788278510391afeb4235f0e5c50 /app/crypt
parent5ee154872d87c355616b521eab0066c7cbffc598 (diff)
downloadslackbuilds-2a1df3cc5f2f072fcbf0a78b3b879616dafd5235.tar.gz
slackbuilds-2a1df3cc5f2f072fcbf0a78b3b879616dafd5235.tar.bz2
ssss: adding ssss
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@2098 370017ae-e619-0410-ac65-c121f96126d4
Diffstat (limited to 'app/crypt')
-rw-r--r--app/crypt/ssss/Manifest24
-rw-r--r--app/crypt/ssss/slack-required4
-rw-r--r--app/crypt/ssss/ssss.SlackBuild217
3 files changed, 245 insertions, 0 deletions
diff --git a/app/crypt/ssss/Manifest b/app/crypt/ssss/Manifest
new file mode 100644
index 00000000..9dafe4f4
--- /dev/null
+++ b/app/crypt/ssss/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST ssss-0.5.tar.gz 17435 MD5 24227252aa195a146d09de1df10357a1 RMD160 63bd228393afee454d9f72abab411cc162e03c65 SHA1 3f8f5046c2c5c3a2cf1a93f0a9446681852b190e SHA256 5d165555105606b8b08383e697fc48cf849f51d775f1d9a74817f5709db0f995 SHA512 be8df1666ac61d4097b5fd54f2cee3640db8f85ec21411f1b208a35b671c5699bc692079525d8d313d1cf2500da31bfb03771829a9fdccc0bb6d806749526ec9
+MKBUILD ssss.mkbuild 3578 MD5 d114b474e64eba5eb71d0f3adc171627 RMD160 26b9b99ac5491f84fc99abc37672fbe2ed5d7a87 SHA1 0cc941a1ce6ad80aaa8073db587dfdae6c1f9af2 SHA256 8063deb3ffd53d5eac6f62960fed3d4ac69479d2256b180fb45194645e027c81 SHA512 7d03e6c61a3622bd726f1e23799b6e0efe644b26d2510b3ca704b4ebf1bb376ef91bdaad954e1c7edde32cbcd00495f7a1e9d4ae5f062ba2db89a03a521e85ba
+SLACK-REQUIRED slack-required 77 MD5 753d22a332724483a68253a0603a2f76 RMD160 8a68af1a3caf0f2dcf4f015c2dffc48f73616dca SHA1 babec9aa9492499558d80d6ee0be4cc9ee402aa1 SHA256 651e0c74fa134d488536d2e024ecff86281e8a23870c08085ead960f7398bd86 SHA512 9582a72b670fd496d4aca055839f2a29d25f646e4219b2dce019d43a5f92b690ec65556d7716fe325b1a015052e639f4ec618adf11d9dfb1b3726e499b998877
+SLACKBUILD ssss.SlackBuild 6969 MD5 46cdb2f6d5866fb09bb08255f22b6685 RMD160 23cd4ca72ae8043ebd8b1adef5c363c026fd3518 SHA1 f91ecf6bc7cbdad29885e576f4370e93a2d11ed1 SHA256 26abfbdb34c1eff1fb158f652bb6ba0ed871d0071bb875d29ad1f4db7ac86c24 SHA512 36745dfa45d159e7ef195e95c76fba05eab2dd5f3e3181515d48aa63ccea1453ce433da8c71a48a7372fe607e9c7d2f54559188e26545ce370a1fcd9e0efb694
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJf6IOAAoJEEHL93ESzgeiEZQP/Aqv0ER2VTjrsUaGe/0pQj4z
+j8iuDd+1oj4dCbeUFS5LKOAyOEgeF2frrjtLUaBGS2x/+af/Bm7f7zi1oEr+zCeN
+foomv/azd8CdUfvokdkYNjS1qaSGlWuWEKrvBP9rxRC3g7pndxcoYFVf9JAsJ+hn
+J8ASkbANuDzaQtTrQXInyBSeyCLBAXzxtRKPhJp1phH1q734F380JQlelWrgJ7Qh
+D/lc94yLKxCpXRZhX3c+JK1w/R+gtZZB7fIcu9YoFsq9bfRyRB5P8hFjGKw7eG52
+dXEAfUzhnXAaGJpyUxbM/C+/lc3f95p0ZIq7j+d8Omv7rSRANqsODXKJZn4p4niK
+3SgDOPFmJwBVg9YRGdzayZoQs5364YzeWzGU3jw32+Hl1VE9E6Nsm+BOeCX97v7s
+G3ncmD4NLvkSQ6jo15kJfvI+1+Ju+oTA8Pa6xe4qRQG48VojcDPjjUCvNN5njicm
+6p4CK3H8Jed0feopvkeXe6UsGnqHUNkFrpvxGVGZFSWnC0SbOLpJGLWzpxjZwJH3
+9q8o4GBfXizvyYy95jJS5xkDCMybhsQbNg1mfRgx5qPAJKNC2zPt7/afG7dOfKhl
+Rambi5Zwg1nD+TC3CubThhK+iSBVLaFZX74YhSlS5HxHg5R8TJUfM/nC3W5WR/l9
+u8NcTulBDGDvsLJXJ4SH
+=mGQh
+-----END PGP SIGNATURE-----
diff --git a/app/crypt/ssss/slack-required b/app/crypt/ssss/slack-required
new file mode 100644
index 00000000..940c74e0
--- /dev/null
+++ b/app/crypt/ssss/slack-required
@@ -0,0 +1,4 @@
+# Dependency list to ssss
+#
+# dependency [condition] [version]]
+xmltoman
diff --git a/app/crypt/ssss/ssss.SlackBuild b/app/crypt/ssss/ssss.SlackBuild
new file mode 100644
index 00000000..16f4bcdb
--- /dev/null
+++ b/app/crypt/ssss/ssss.SlackBuild
@@ -0,0 +1,217 @@
+#!/bin/bash
+#
+# ssss.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.
+#
+# ssss.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 ssss, by Silvio Rhatto
+# requires: xmltoman
+# tested: ssss-0.5
+#
+
+# Look for slackbuildrc
+if [ -f ~/.slackbuildrc ]; then
+ source ~/.slackbuildrc
+elif [ -f /etc/slackbuildrc ]; then
+ source /etc/slackbuildrc
+fi
+
+# Set variables
+CWD="$(pwd)"
+SRC_NAME="ssss"
+PKG_NAME="ssss"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=0.5}
+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://point-at-infinity.org/ssss/$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"
+
+# Compile
+make $NUMJOBS || exit $ERROR_MAKE
+
+# Install
+mkdir -p $PKG/usr/bin
+cp ssss-split $PKG/usr/bin
+cp ssss-combine $PKG/usr/bin
+chmod 755 $PKG/usr/bin/*
+
+# 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="HISTORY LICENSE THANKS ssss.1.html"
+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---------------------------------------------------------|
+ssss: ssss (Shamir's secret sharing scheme implementation)
+ssss:
+ssss: Implementation of Shamir's Secret Sharing Scheme. The program
+ssss: suite does both: the generation of shares for a known secret,
+ssss: and the reconstruction of a secret using user-provided shares.
+ssss:
+ssss: In cryptography, a secret sharing scheme is a method for
+ssss: distributing a secret amongst a group of participants, each
+ssss: of which is allocated a share of the secret. The secret can
+ssss: only be reconstructed when the shares are combined together;
+ssss: individual shares are of no use on their own.
+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