aboutsummaryrefslogtreecommitdiff
path: root/dev/perl/perl-io-stringy
diff options
context:
space:
mode:
Diffstat (limited to 'dev/perl/perl-io-stringy')
-rw-r--r--dev/perl/perl-io-stringy/Manifest23
-rwxr-xr-xdev/perl/perl-io-stringy/perl-io-stringy.SlackBuild74
2 files changed, 95 insertions, 2 deletions
diff --git a/dev/perl/perl-io-stringy/Manifest b/dev/perl/perl-io-stringy/Manifest
new file mode 100644
index 00000000..2352fddd
--- /dev/null
+++ b/dev/perl/perl-io-stringy/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST IO-stringy-2.110.tar.gz 40590 MD5 2e6a976cfa5521e815c1fdf4006982de RMD160 429496202c06b3a9485d12897d59d3cb631575c7 SHA1 3ef94404e51e3a6276ddddcce9ba7bbdd6b76a1f SHA256 7e3cf438b3938a2692cb502704c0bbfa2c5ec4a5071ab77906a2432126b004ee SHA512 54f274ac398023c3c245172052d781e72cdaa2d2edd425a25104098212fe2862da615f3512792daffcd22fd9b1cf7c0df12b85faad8241d8d7e600a319135d95
+MKBUILD perl-io-stringy.mkbuild 2352 MD5 3adf9b88060c2158cd40a655f428117a RMD160 10640a85ffdebcc980df14c565da19b756cf4033 SHA1 98a464135a7284b3626352552aadb0d7474de106 SHA256 ca4fbd60a3b40504756b8564b95bfbde2719bd9ef1229b4f089a871a7606c370 SHA512 33324559e11612cc6a2571b3b27e8bb35a6f16ab88a5fb4369631d6233e76de1f53d240a057851f126b813514e4c0ddf2fa62e02d28c9318dbae7c7438bf9e0b
+SLACKBUILD perl-io-stringy.SlackBuild 7036 MD5 454a80e5fbffcb45e01bdb0679392cb3 RMD160 8aab5562ec9e3c2b8f1aa0d9315c8bfff9ce2e90 SHA1 7fe8cbcd6a95e38790c314a09f99bfa300fc4b1a SHA256 e875b27974887db00b0777741975f0901844c48446adcf3f8584a4201894f5e2 SHA512 915b8f2009b70e4031855403d90317f9a75c84f4851bbe667df474856734dbea773ae6ab5344308d6f27fdc8768419a8d017e0e8977d51acecdd958a1699ee13
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKr9YLAAoJEEHL93ESzgeik0oP/2j37Ls6gNeLIoZm6YI8Jo+V
+SNMzUTa+mnScn9wzblZh0N7TBOFs9MaYhxxkZ8W2JEBKF5fKe2IjnnxFbbr2IaBr
++fPqvPyzmtmfbdQBQCGUK1vBoRgfPcICaMhkd+7s0OXKCKiYVlg4+qtPTEh+XVAb
+OYaUAEboUShkZ3h+C7rpnabgy48GjPK68BPW6ZwiTosza2kTEPSWEdxD9h3G3ERC
+Q3Ek0iITOxogf+Dv7CrFCx8Cif8MURdiDDbEuMCs6MNi5AUnELiE7q8X3lf6wUQ+
+gaJa3ZslwJkR+frKNw6FliZ2Dt+qsPf4XRxt/ugvabZLTiseTTQv2aoXAlgkDHK0
+VTLvmfh/BmL5WXywTptODAYo/y20QnEI6Dgas/x1KdKkUSlU42yOtudh9o76INze
+WN/IKa+mN48fccAmr+RnBhlt7I4N3fiUKGg5gxMCIRFn9or3gUN6Y8Y6dXka2RLv
+ZhX+ALQ7x1lq52wxdep55AYio3H6IbuR3ZDnYOzPe0PebdP6WJ9FG8rqxD94ZjCd
+LXGQMbucmsUf0xyd+gKUZur750n/CLAj+lBMpXAVvATyWR9aTXLQ+kYW14q5BSJB
+/J6WtIfmdDRGc7xVlghtMDJ45q2BH0PZ0BOdTpSpaq7PeUq3pOJZ0lsqapTNK1vQ
+sWJ9xLG907MG0gBslrMP
+=MIvl
+-----END PGP SIGNATURE-----
diff --git a/dev/perl/perl-io-stringy/perl-io-stringy.SlackBuild b/dev/perl/perl-io-stringy/perl-io-stringy.SlackBuild
index e8c0327f..c7c038bc 100755
--- a/dev/perl/perl-io-stringy/perl-io-stringy.SlackBuild
+++ b/dev/perl/perl-io-stringy/perl-io-stringy.SlackBuild
@@ -17,6 +17,7 @@
# slackbuild for perl-io-stringy, by Silvio Rhatto
# requires:
# tested: perl-io-stringy-2.110
+# model: perl.mkSlackBuild $Rev: 796 $
#
# Look for slackbuildrc
@@ -38,6 +39,7 @@ 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-io-stringy"}
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