aboutsummaryrefslogtreecommitdiff
path: root/dev/perl/perl-test-simple
diff options
context:
space:
mode:
Diffstat (limited to 'dev/perl/perl-test-simple')
-rw-r--r--dev/perl/perl-test-simple/Manifest23
-rwxr-xr-xdev/perl/perl-test-simple/perl-test-simple.SlackBuild78
2 files changed, 97 insertions, 4 deletions
diff --git a/dev/perl/perl-test-simple/Manifest b/dev/perl/perl-test-simple/Manifest
new file mode 100644
index 00000000..a5e9a7fe
--- /dev/null
+++ b/dev/perl/perl-test-simple/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST Test-Simple-0.94.tar.gz 106635 MD5 e4e09d8bf2cc73124152ba2c45c95b5b RMD160 34d53454a592f297300ed9cbe62e0639c5dcdf27 SHA1 ae41562c9dbb28724f62ed4414eb2f391a878b34 SHA256 6f93a4f758ac99bcaa2f917bf10493f6eb102b1ab769d57f5d5cafd6bf4aaee9 SHA512 37f7a543a5cf9103328955abd35845e58f390d140b2c1437b0a217078b5299ca1c46779d5d5863ab2869ab3105574499d06e9a252beb8e2a7869d3a8ef91e271
+MKBUILD perl-test-simple.mkbuild 2355 MD5 4fa5a5a6d8159a6b85236f676852865b RMD160 60112bb8ce7e93b6b491a8290d27650172d905f3 SHA1 d697d44232d2ebbdbca153820610982d3e05073c SHA256 46d425a164345e79ebaaa57b4a30358afc2442644c3e866fae813adaf87cab86 SHA512 15c28b04788b359d3642ef4d89fe95aa47a77f8371d2ec653d7e03367eb42b0f60805adc90acc9391c2dba79a3a900b9d71f17f221f27dbd290e6f6d335f28f9
+SLACKBUILD perl-test-simple.SlackBuild 7042 MD5 69f08eb7e9b23ab11191d34e7cacd9ff RMD160 f50604b81430de719d636b60ef40c7a33d43d9b6 SHA1 6509e974b2c1d28b7abf341ec1c6f05afdfdbc32 SHA256 3d33d686b52a1ffc184a9a03bdca51101f9e0f7604a776ee603787fef2132897 SHA512 6f6338f66b1a1492ccf1db52692e2ab139e4340ade0f3d6652703160a27aa84267a9f0f177ff9ad70b0ae9887a0393e4c85357f41056bf00dcd36b9484216df0
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKsElEAAoJEEHL93ESzgeibmkQAIKuQwG/RpFet0Jyz2oD5els
+DQg4zThgWek3qXdX/oshE1UpxmBQDs8eZvtusi4qQV7gGhHCr4wAILSFHLu9qaZP
+0xAGoxfdEHHUzTysnFaTxu8+WXoABE9Av4Y8b/rgptqWjiwJWXWet/rGTFBqs3sP
+wCz0jE1mkjdIG+Qs1sGSCnvPf99DQJFwapKvuurJHLFcXB+lzFX/cyOv61tcgkq1
+KpblfQ21z5qACxt3IoUbT0x4W3hm4xM/enBBYud5BTeEtd2+PxSQq66WyyXPQdIc
+/+PwoADGE0B3qil1BwYtXqY5pJd1xa8oW3mdfSATbNGb+RqIycVQi6rs/DGKsTc9
+pkJ3+g02ryc71Z1l4KXHOTAoMp1y7VzhvhFnINAHgPmuPdYDaafRKrYRSLZoP4uh
+XvSKuVMrDpuNrpPTfSFdW5kNggNtJlYHh9WuCwYvdDxeAGICUcNpe3iq5YBYP2N0
+ub+pYdhrcPgRjx1LCB2NxaM0qPe94b56atjpcc+2vQoc5uiaiJI1Y+xkRPG4DfaJ
+AkStp92PZ7WeQlXfBBhQXJoj/UENU9Zd5RRPUe6F+M3dxCexv8p7yG/aNiHwkl4W
+uD8PXHsw/2Y27QlYgxK1NvY4Rr96vkfam6RlIokBea2UJrvI4AqGhovQ8EhwRKu1
+jk7z6NwZ5rnEz0RMUPYH
+=ulJT
+-----END PGP SIGNATURE-----
diff --git a/dev/perl/perl-test-simple/perl-test-simple.SlackBuild b/dev/perl/perl-test-simple/perl-test-simple.SlackBuild
index e81ff1f6..fd129ccf 100755
--- a/dev/perl/perl-test-simple/perl-test-simple.SlackBuild
+++ b/dev/perl/perl-test-simple/perl-test-simple.SlackBuild
@@ -16,7 +16,8 @@
#
# slackbuild for perl-test-simple, by Silvio Rhatto
# requires:
-# tested: perl-test-simple-0.80
+# tested: perl-test-simple-0.94
+# model: perl.mkSlackBuild $Rev: 796 $
#
# Look for slackbuildrc
@@ -31,13 +32,14 @@ CWD="$(pwd)"
SRC_NAME="Test-Simple"
PKG_NAME="perl-test-simple"
ARCH=${ARCH:=i486}
-SRC_VERSION=${VERSION:=0.80}
+SRC_VERSION=${VERSION:=0.94}
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/perl/perl-test-simple"}
PREFIX=${PREFIX:=/usr}
PKG_WORK="$TMP/$SRC_NAME"
CONF_OPTIONS=${CONF_OPTIONS:=""}
@@ -64,6 +66,7 @@ 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_SRC" 2> /dev/null
@@ -83,6 +86,72 @@ 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 sha1 sha256 sha512 rmd160; 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
@@ -148,9 +217,10 @@ EODESC
# Build the package
cd "$PKG"
-makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG
+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" ]; then
+if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
rm -rf "$PKG_WORK" "$PKG"
fi