aboutsummaryrefslogtreecommitdiff
path: root/dev/perl/perl-time-hires
diff options
context:
space:
mode:
Diffstat (limited to 'dev/perl/perl-time-hires')
-rw-r--r--dev/perl/perl-time-hires/Manifest23
-rwxr-xr-xdev/perl/perl-time-hires/perl-time-hires.SlackBuild78
2 files changed, 97 insertions, 4 deletions
diff --git a/dev/perl/perl-time-hires/Manifest b/dev/perl/perl-time-hires/Manifest
new file mode 100644
index 00000000..6cd38a92
--- /dev/null
+++ b/dev/perl/perl-time-hires/Manifest
@@ -0,0 +1,23 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
+DIST Time-HiRes-1.9719.tar.gz 87541 MD5 2aa17d4b89f3649b9813ab891b83a5e3 RMD160 3e56602cc5dddac6204e12c48d215acf222ff13e SHA1 800f3c97491706824dd1b946d417807b813bb56a SHA256 c3ccd5bff5b20f152675ab16cc3352b37fa3caf01c9450a804b9f7cb93189e3e SHA512 9d511d32a607e9366d2a3b8983c6c5516bf3a9cf62becab7b63596378444ac1f3f7a11f055c087f94cdec05980a676a5604359b1e9aa57ac86100b21af7f6411
+MKBUILD perl-time-hires.mkbuild 2362 MD5 a459d332d8fd01f82db7cfde4b315200 RMD160 fd982e653a410e233437f43a0143fe6adbe2a2a1 SHA1 a9719a083324f082ea9488f23fa6cdf0a4a1b26b SHA256 464f830764be65885e0d995ba40c2f9f60b69c4b83db619aa0a1629c7a8aff04 SHA512 1acf57151763421a4b25edd784ad55eb07aaa2493b3a1f40369796cfd83da928e554d2ea74e2fad8b08a27159a605e572a0f1ac22992bc9e838d57e4ed261ba1
+SLACKBUILD perl-time-hires.SlackBuild 7047 MD5 5f44f3ed478867b7e7f15dcbe04cf3f7 RMD160 f4ee4510e8d0c123b795efb3d612d6eb0ae13008 SHA1 6497a1dd85068ea1f9e0b9702e43d208d498b5e7 SHA256 e4ab02f8ce55cd1f27abebd865aa1ac2ec8c2ba8df23c3839806d345acfebe81 SHA512 638c81eb3590b3a2352ee7df32a1cf6424f5acc4d3ac30a1dfcfbba12ea95b89ba368ac5f3f151f8943a12463812a5cd23a8eacda1c1d803138aba8e6aa0c2ae
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+iQIcBAEBCAAGBQJKr/geAAoJEEHL93ESzgeidZ0P/03FMTXB4ZjkNX7/m84PaDH8
+AG67ADVKZKFzzN6SrBS6RCSGUgmU0TYN5kON3wz3Y04JUVOmizym3mwYgU4sq7kU
+CrTSKwgkcJMIkVOSiUgzgpsfzj5QR49/haWFctshsN9gTHdKYRfHDp86jULNTx/c
+i5jsMWxw6RBBv8RrRAJKFD7RDie7vSFojsjAc54WA87NpHI7sdz0KJbMBDztSKNW
+QRwQVG2gYSztAo51fIlHBgL9r+pqqjcQiDkYSSwFvcGtlP+6mz9C0NYS4tgOm9Z/
+nO/09UesNORLMBys7hOR/Gpmq7HZgCtkeJ8MKC5cObUYe+KG3+Dtvk9qgwXJBbz0
+aEdYVwEI2RgoVn6R4gt2eL+PvFyLv2p1dBs66Owp1HAgpCVUlxy7hnx5i5K0iRxl
+AhfxkZ89DyMqdsa29xt3CoMu2YRtvJBwV9lMGbaLDgE9xK0Rz1cw5t5vza0mGZJN
+P2amEl7wOBePwEwkkTb5CNpA02T6Fp0YsnlrLB0fbElOteQgi7P7dv4MD3CHY12Z
+jm3pWuDheLurFb8/SXS91si+fRCZXk4DOHuublrSno/yMp8si5lMm7GZu5PxsD2V
+YezWbS9rizEFGvfKE1WhlNTpc8Y5gg0vBtjj6Mn0NtbRZ8dwn6kE1SLBzcFTqPgo
+zXtwNr1UK81qiWzT7Orv
+=3TFx
+-----END PGP SIGNATURE-----
diff --git a/dev/perl/perl-time-hires/perl-time-hires.SlackBuild b/dev/perl/perl-time-hires/perl-time-hires.SlackBuild
index b5e64336..010796b6 100755
--- a/dev/perl/perl-time-hires/perl-time-hires.SlackBuild
+++ b/dev/perl/perl-time-hires/perl-time-hires.SlackBuild
@@ -16,7 +16,8 @@
#
# slackbuild for perl-time-hires, by Silvio Rhatto
# requires:
-# tested: perl-time-hires-1.9715
+# tested: perl-time-hires-1.9719
+# model: perl.mkSlackBuild $Rev: 796 $
#
# Look for slackbuildrc
@@ -31,13 +32,14 @@ CWD="$(pwd)"
SRC_NAME="Time-HiRes"
PKG_NAME="perl-time-hires"
ARCH=${ARCH:=i486}
-SRC_VERSION=${VERSION:=1.9715}
+SRC_VERSION=${VERSION:=1.9719}
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-time-hires"}
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