aboutsummaryrefslogtreecommitdiff
path: root/dev/perl/perl-db_file
diff options
context:
space:
mode:
Diffstat (limited to 'dev/perl/perl-db_file')
-rw-r--r--dev/perl/perl-db_file/Manifest23
-rwxr-xr-xdev/perl/perl-db_file/perl-db_file.SlackBuild74
2 files changed, 95 insertions, 2 deletions
diff --git a/dev/perl/perl-db_file/Manifest b/dev/perl/perl-db_file/Manifest
new file mode 100644
index 00000000..c3be6944
--- /dev/null
+++ b/dev/perl/perl-db_file/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST DB_File-1.817.tar.gz 87996 MD5 405ee3e2e76c557d8574980eecf04379 RMD160 268f560af33d3aac9d8a54b28383f2566365e1b3 SHA1 009187ed32c50dd53d09f4fc0352226369b49f66 SHA256 b9e19a22603b7856d2428c59a134d87bb62d29595c1f62a8da49ca85892aa6ba SHA512 6b0567ad15a21c1575d22beebcae864276557a7d884de7dd2e996a1b5cccc31a769f72bb86840c90c73f06fdc381ebf99675f8151965d3d718ebf1ef0689efc2
+MKBUILD perl-db_file.mkbuild 2298 MD5 11b0feec785af3eabaf8043e8a9bda53 RMD160 8a4020c790cee0d015d7c363bf7103a361b2c864 SHA1 108eee7e016c5a9668bfa2a502380d2eeae324ff SHA256 2d4af1637ee44daa78be97ab6f69b86178b39514b6afc0aedf8ac5dde182eb1c SHA512 7aee6075dc53f4dfaea368ba5c3fb1cfec8fbc337f0598f8a5d2fcafe3a06cb8d4caf919fcb7be4d5a72a22d08065a85c0269c08c9fceaf8493bd175ac3b683b
+SLACKBUILD perl-db_file.SlackBuild 6970 MD5 90e61a83ddef8eedf6a8ddc28a129dd7 RMD160 8adcb7c23290c05eeb9aebfd9984f10585933ea8 SHA1 6b538db2d5c6a27b7f1c747a665588053d262f7f SHA256 47f69ef84f260c35e774f82ac825783b1415b935ba275970b47ae0793c76329b SHA512 05bf21dc8c04dffb1641cf51800d13c602d22429b6729889eb484296a5ab6b4765dfcef2f25ee05ff116a4a4dfb923c673545279ac09bfac0702c8716bfef97b
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKsAJ6AAoJEEHL93ESzgeifhoP/2yFk5Z3ri81QwVzt9rJQSmC
+J8AiI1GSVzqOX39kOy3nXk0CB0JL1GeoS7RK4u/BRwG5D8uRY2izCSSVYtB7Jra8
+MUJNzlPrkellRItINzwYv+fcFBO2duZMz5ZyGZ3j82xdQkR5a9iqBhmoeaJ0gCz7
+1NnNjE/Z/OjRoJkt6+f5A7XNhglv30cDGCTCUnccH/TlpQ0qoMSepl+iCGf+zdVQ
+tw+M1kd25aerTwBKxRaQFAIWphqLUtWuTmfbRrTbVxKlcQ7LzPuWXu/xkrQJXbf9
+mhji+oqodZEUqArFGHE7dkSxKlS/+94j5SFzokMdHq9tQO5/zWnK6wH/2iosq13c
+UO/snXBqeSgjv5QALhLd5E+HUxWArAf85KxjBhfSjea5uhGLUMwHyR2iWyL188Py
+GsuQIBAWVIQAbeiNJibIf+iaDONQ8uUWIhzPrDMoKPTIHKnd8niIm5VvXiJ74BVB
+2lWe2SitM/Kuv9hFStsnOZSHiz7v4QVle9xjB+R9C4f+B3APEGr0/bbcd+aftYqK
+BqEdIllKW0TF2ytXGY92XK0hKQDEcRSV2NgQ/CygD8JS0rVIfw27xL+abjniSiB3
+JY41VqMSLhOrzuib03DqiPvNylxOss5NHtdTBJfQSshyUain12Xqbu2mj8AILMgn
+3/wXtVvZAgTQJYTGcuU4
+=V6Q+
+-----END PGP SIGNATURE-----
diff --git a/dev/perl/perl-db_file/perl-db_file.SlackBuild b/dev/perl/perl-db_file/perl-db_file.SlackBuild
index db1cfac5..5cd97ad5 100755
--- a/dev/perl/perl-db_file/perl-db_file.SlackBuild
+++ b/dev/perl/perl-db_file/perl-db_file.SlackBuild
@@ -17,6 +17,7 @@
# slackbuild for perl-db_file, by Silvio Rhatto
# requires:
# tested: perl-db_file-1.817
+# 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-db_file"}
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