aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/misc/ttyrec/LICENCE30
-rw-r--r--app/misc/ttyrec/Manifest24
-rw-r--r--app/misc/ttyrec/ttyrec.SlackBuild214
3 files changed, 268 insertions, 0 deletions
diff --git a/app/misc/ttyrec/LICENCE b/app/misc/ttyrec/LICENCE
new file mode 100644
index 00000000..d25dea88
--- /dev/null
+++ b/app/misc/ttyrec/LICENCE
@@ -0,0 +1,30 @@
+Copyright (c) 1980 Regents of the University of California.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by the University of
+ California, Berkeley and its contributors.
+4. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/app/misc/ttyrec/Manifest b/app/misc/ttyrec/Manifest
new file mode 100644
index 00000000..fdb00a09
--- /dev/null
+++ b/app/misc/ttyrec/Manifest
@@ -0,0 +1,24 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+DIST ttyrec-1.0.8.tar.gz 8528 MD5 ee74158c6c55ae16327595c70369ef83 RMD160 f7538fa742d1c1e07b8b48f3fa79cfcf13ca8044 SHA1 645f1e2a1ac4b2a32ad314711fb3da014ce9684d SHA256 ef5e9bf276b65bb831f9c2554cd8784bd5b4ee65353808f82b7e2aef851587ec SHA512 b7f6f4c78c5148dacc7058534d89f13fcf333ee9e099d4475135e9c15a99a8aed72bf4bd5954652a6bb044d11ad35b4cb8d07208a5349c79c811f68fde7e8611
+MISC LICENCE 1735 MD5 29bc7510bd025c1f79d89d7ff764eb0a RMD160 3806854bd7bb279f483dc724d62f2a41d6fb4600 SHA1 a0bd3ff119fb0327e7a179f9f44d9bad7d29ffce SHA256 3b623ede2b19a25a22dd7d8535b95d66c4ea62f198d6ff007fead6c538b2d721 SHA512 c1cf8581472454225e29b97dc7fffc7bc3b0cc7548def1e38c7278441d81c58ffaacd22e0d388859159a4e0342a5aab964c6b9f151ea13ee1850a79b791a7408
+MKBUILD ttyrec.mkbuild 5336 MD5 2c5c04d70e5bbfffcdea08d0e90cd42e RMD160 9dffd6148650014c1877992de47e58526eab8594 SHA1 2a44e01cf9f6124443d6249294ca515528d7f2db SHA256 a2e8d5a6eb4600dc43f704d4baa143b01d198c4c46af69e7d2121ec3fd053faa SHA512 b51b6fc355ce3ca81d996a58f93d4930a7b820ecd23672855ca47a7c238b4c9b05cffb022a94e6323d8d5d4959eb869b7953f7251af059f7f5ae488c49d3f7c6
+SLACKBUILD ttyrec.SlackBuild 6793 MD5 77a1060057f861e119a5a16d2fc15300 RMD160 d94793f6210980953f1426841202fd092ef5fb77 SHA1 c5ad0dd5729dc97631ca61290b3f39d548109799 SHA256 c0a8eb884715603bec9c1a06f38817c211b7f509b127ef3202c0e1316f64cfd5 SHA512 e524dd4c58c9ef117399691cc9c7c8eceb849b24c1356ebdee9a4f62ac62935bbda92b6124d509d873b8d3df200c927ec6eb3640f5a0e6d0a504b1ee66844767
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBAgAGBQJJ8zPDAAoJEEHL93ESzgeiPxAQAIB4AosPgei7pHa7RW7kcEEx
+9wYC6ktJCwf4MssxLQsm690BpQfh3MV2PlPR+t4wPVrAbKZeyF/fUldIm0xUGocc
+Dpu21LKDdV6r2n0oqh+l5itccYdZdtvqrtl98qaw/07fcQQq+ER6rSuTjsn7p/MF
+hRigPxqb5DCwyA53WiFnAvQ7KhOyM17WIxgghHsOWrmaWGQX9h2XA23euuRKIuST
++yCAFLddAyxuXdhf1ADn18F6WrKgHaECZTnag8phRVJvSrWz+A3MMip/YC3muhcm
+khfb8PSwLa0a9eVnOWYs3u4PumDeKwLpu9jcQyXSVBT6V2YQ7LG7TNSttgKzUPkp
+XvLOSNKmuRw0QFjxUmiTqjafu3uC9Oztsvt+gPGJcj/WfSsj/wT5+FjDU1smcobI
+25W0Gww9gaT+SmYugvDnjq6OMzJ9WfQPQG32iMcLI2qSJ3DlS9o29gpwJ6LB4xeR
+qkH2oJZdW2THoYsLfjJ/L3xX4q0C21pxSRH6yy0nZJ+eJpN/a4Hk0jdKFJ65+N8N
+ELfogBs9FdMto71gWD8bunoo13hdq7d9vGslQyzG0YJbBjEMO3MaPUdbVMxAaCac
+TuZjp9rajhcOM16TF+z/llsPEKsvA1OH63HvWRN3eUDod/t0+ETb/TALNr93D22f
++EC+ODw7gbz/GP8pcml9
+=jC5x
+-----END PGP SIGNATURE-----
diff --git a/app/misc/ttyrec/ttyrec.SlackBuild b/app/misc/ttyrec/ttyrec.SlackBuild
new file mode 100644
index 00000000..3a5e90b1
--- /dev/null
+++ b/app/misc/ttyrec/ttyrec.SlackBuild
@@ -0,0 +1,214 @@
+#!/bin/bash
+#
+# ttyrec.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.
+#
+# ttyrec.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 ttyrec, by Silvio Rhatto
+# requires:
+# tested: ttyrec-1.0.8
+# 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="ttyrec"
+PKG_NAME="ttyrec"
+ARCH=${ARCH:=i486}
+SRC_VERSION=${VERSION:=1.0.8}
+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:="app/misc/ttyrec"}
+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://0xcc.net/ttyrec/$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 ttyrec ttyplay $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
+mkdir -p "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION" || exit $ERROR_MKDIR
+cp README "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+cp $CWD/LICENCE "$PKG/usr/doc/$PKG_NAME-$PKG_VERSION"
+
+# 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-------------------------------------------------------|
+ttyrec: ttyrec
+ttyrec:
+ttyrec: ttyrec is a tty recorder. Recorded data can be played back
+ttyrec: with the included ttyplay command. ttyrec is just a
+ttyrec: derivative of script command for recording timing information
+ttyrec: with microsecond accuracy as well. It can record emacs -nw,
+ttyrec: vi, lynx, or any programs running on tty.
+ttyrec:
+ttyrec:
+ttyrec:
+ttyrec:
+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