aboutsummaryrefslogtreecommitdiff
path: root/dev/perl/perl-file-temp
diff options
context:
space:
mode:
Diffstat (limited to 'dev/perl/perl-file-temp')
-rw-r--r--dev/perl/perl-file-temp/Manifest23
-rwxr-xr-xdev/perl/perl-file-temp/perl-file-temp.SlackBuild78
2 files changed, 97 insertions, 4 deletions
diff --git a/dev/perl/perl-file-temp/Manifest b/dev/perl/perl-file-temp/Manifest
new file mode 100644
index 00000000..0b07993d
--- /dev/null
+++ b/dev/perl/perl-file-temp/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST File-Temp-0.22.tar.gz 38352 MD5 a7e93cf2015881ded1f22b5b2d0cb391 RMD160 463f3ca7e25fd6949b8b2da1bc39c31a401a953a SHA1 5535c96e69e5d7f433fa446b5087fe4cab1bc129 SHA256 989f9222497e6c056af3478018316cf634dba946e9a85d4d2b5a09c5351a4785 SHA512 26cd2dac046e43b534bd7c6df1c8e28bc39a093c8e3554127ff899d24ede9d42f71637c367d67d9b38162f9ce950f902115b63dce30eccfe30b6c8872cbffd4a
+MKBUILD perl-file-temp.mkbuild 2336 MD5 e8d1b98e2ac142b54fe200d5b1842e13 RMD160 a98444a8e12c7fd4b67e260875050e03d6e1190e SHA1 3e4259dd1280524d875b87e1807ac983b3437fc1 SHA256 6900eb505d1746489527a02eb52376af8bf940448965c1f9c7da14f37f4f9cef SHA512 c32f25e637d03a393d4a1ff1de4320491cfa7755d24c0df7e4a8b315a4ab6ecf876f763225bfb5f60249f82a3fdf2455e730829f88d5a05eeb17702a4f03b91a
+SLACKBUILD perl-file-temp.SlackBuild 7029 MD5 e54ffdf470bcda1053268b8e755cdb96 RMD160 0273081682a0f9d078c51025212686f1a7d6b51c SHA1 58f3220d0c154eebf40f77e450c119e110e1db0c SHA256 4c3e646d3a9a00f81596594b4c3eaaf3eef8fb40157eb5944c52bf0f9ae1a3a5 SHA512 7bf0d0e069c45c48e08963f30b061a25ef33dd572f97def66dc4ab781d38a4383255da0e583510dd65dab583b2d029cd96fc49dd7b62cd3225b404774949bc50
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKr+aAAAoJEEHL93ESzgeifQAQAL08M9QygD3Wf8LkXS+mIqcR
+s7zHA3n/As9xBMYcfFGzDd1SD/1cMO76hgkxRUW25tsvZoijbQ2rVv8d3sbdNW64
+jbTpRrmQpAlx9D3IiN6ZD0IFX4922Ihj9GWONvRu3BRO8PkOlP6v8yFeAWQVEQKl
+yRJyg4EVI1Fs8js1NACgBvT/aw24W6Q7WUVxxL28IG3ZUgTUVrHRbUkc5LJUF9/0
+jSa7WjayobjoNAmkaUuVKs/c9fF5zFfN3DSZkbDEptARTO/Lf2JYfCvO08LfYkhm
+kbgfKmgZwb6orMSH2H0HihPIEQQddQzvHX9JeDYiADPDSL5vfM+E04GFWO0ra6M8
+YTn8cE3pRUYqkygMJGdud1YITxID0yJdJZeuwL6sg0opk3j+2P3WDV3/nXer9zhI
+En9bHp8X9UC5gyZvaBi2jYZ5fiBBGCbYLjJf89NTjJ9PmJjyrzIHa47TIjIIJrhm
+Icko9V1mJI0UY8SP38Iaz9ggqRC7jhXkJvLaMGCn9bg8f7/OyQgm1GGRBssHcu+f
+m0waa3Sf4eeAE/soNKZ417FCMKhaEc7fgSGaGZsJu0pUc8C4zY2YEj/5RIAlaKgK
+RlLKR3PN+dCmoEoJZcxIkz2MSlPizMYCqDsdBzBlvo3kxZH8l5lEZn/7wc+K93iN
+Eg1R3TnQrGqDjsXgdF+z
+=+mSO
+-----END PGP SIGNATURE-----
diff --git a/dev/perl/perl-file-temp/perl-file-temp.SlackBuild b/dev/perl/perl-file-temp/perl-file-temp.SlackBuild
index ba54c8f9..bdcb1ba1 100755
--- a/dev/perl/perl-file-temp/perl-file-temp.SlackBuild
+++ b/dev/perl/perl-file-temp/perl-file-temp.SlackBuild
@@ -16,7 +16,8 @@
#
# slackbuild for perl-file-temp, by Silvio Rhatto
# requires:
-# tested: perl-file-temp-0.20
+# tested: perl-file-temp-0.22
+# model: perl.mkSlackBuild $Rev: 796 $
#
# Look for slackbuildrc
@@ -31,13 +32,14 @@ CWD="$(pwd)"
SRC_NAME="File-Temp"
PKG_NAME="perl-file-temp"
ARCH=${ARCH:=i486}
-SRC_VERSION=${VERSION:=0.20}
+SRC_VERSION=${VERSION:=0.22}
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-file-temp"}
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