diff options
Diffstat (limited to 'dev/perl/perl-mime-tools')
-rw-r--r-- | dev/perl/perl-mime-tools/Manifest | 24 | ||||
-rwxr-xr-x | dev/perl/perl-mime-tools/perl-mime-tools.SlackBuild | 78 |
2 files changed, 98 insertions, 4 deletions
diff --git a/dev/perl/perl-mime-tools/Manifest b/dev/perl/perl-mime-tools/Manifest new file mode 100644 index 00000000..ad12bdb4 --- /dev/null +++ b/dev/perl/perl-mime-tools/Manifest @@ -0,0 +1,24 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +DIST MIME-tools-5.427.tar.gz 391971 MD5 4333caa7238cb9eafb5f7fb39fcbd8e7 RMD160 c4ba32e528541b35ff75dd331f8d84261b7133f3 SHA1 8fda2cb93fdc76079cee35cdab4181cb18b312ed SHA256 844d2499fd2934d4836bd86dc73dd51955aea3fd88109b9d559d99449851fe6e SHA512 fb7d095920db0568e5eb108e5b0340fc86a65b4409f4331acce1f894f7e6df16debbbe52746a7a1b6a935ea2c0c60bd15ee7fa09aeecffb2f8e034904d5b0669 +MKBUILD perl-mime-tools.mkbuild 2489 MD5 86533e972d5ff2f7512b499769cae513 RMD160 e13597780a960375ecb0162a9c7baace0fa11018 SHA1 3a6f0a98f32a1a26ea254f813c2aaf55428d8502 SHA256 76fa66460f3663ffb2e489718b01e1b55e0f6411f23b0522cafba9b2d4b50c6d SHA512 80255800856e7852c250f7eb585c6b5cb806011d840752145f1fdbcc50b06b0368888db4bbaecb73d6ba9627435e1d93c2b1c977daf4bedd747a5580143fc8a3 +SLACK-REQUIRED slack-required 149 MD5 ad95e6f4de5a3fae6edf49db8a9efc1f RMD160 886861ee2c2aa27a2cf34a05accc95dac24545b3 SHA1 31c979a3471ab9ecce0478f4daed404e203b19ce SHA256 5b29cc31983d50d269e954d0a30f1ff5baf6be47e30bf90f311e0fa8a47b129b SHA512 5057eaaffaddeae54c2211f29a150981d40690b0a2ece1bc779b7860090ecf8861db2745a31503e7af8d20464593af240e911d40aa7e92dfa80c0b8d61c9f112 +SLACKBUILD perl-mime-tools.SlackBuild 7186 MD5 d2ae424a974a54bd99d96e48264cc143 RMD160 0f39f8aed2016078e8240a05a0f23f4d23954527 SHA1 8f98a8dbdaec2465f91f0efbb8920f8dc33b1683 SHA256 8772adb0494fa01d76f326005f75a0088be0ef496b84a22fa5a2a4556ac1e3d5 SHA512 4d370ffeafed5733464581bcd5537194372ea394cb079a0e40e4e8d07565fcf70c3b0fd7280876fa20079adad5600b11dd6c1c93abcbc57ef5e7a6aa514d5c47 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBCAAGBQJKr+ezAAoJEEHL93ESzgeiy8UP/iF70zGNgWhLza8ROO0krKsQ +w+3r6yDFN9KJd8eaEXh9oVv6Msc3NdC/XPhm1NFAM5oVusbS2poOfqr6xKQLaWmN +naQa1q8kw90hWcHyeuQQHMQv9Vyi2Tbk+6tHAHUQncEIbOjI40ia19jc58mBZHKE +YL8FR/WKP7PjmP0b5OET1kd+z7TAS3Y6lFTCnkFyoaQZ/1fAKQeFwS3xcetMu0ML +TNuQLovgwg58lYXNp2aDuRZx4WHkFLlWbtSkwm/ACJtMUcHcz+RdXMnjMM5LRha3 +w1UvNfW9ye9yBE9ZDA170Yl2rdlvBnt/oXHUbB9m4wSv7tLA+DG1jWkvogHsSSkj +UQSukeHlhdk+CIfdAj3Us3qvP4noZHKNnTiU7/R5weQ0tgZ26umODp8UtHXWj1Ja +vujpotOk5oRA+fXggZk7HudMhSmWDaAR6IVRZqSquv9tS8rC0tztsxijHyrpBXmC +6Eb20ANsuWOrhhmz/viHB+NbeV3k6Rfkd2TEVzJHmttfLf099KH24mCJLaOMloeG +/Kkd5FyJtX3ldxiN9GjcQQGKJFFNJWdvCw91fr+ipynAMe6E7ntjvoGBvNS1dQ/i +fW4Qr2V2HGFYvZoXFJp2tI5jlJ7pe1k7Pi48QRctvUS5zwt7AKus0rpaXtsgvGvY +FDET0tjCeT22U8/yINST +=bIrc +-----END PGP SIGNATURE----- diff --git a/dev/perl/perl-mime-tools/perl-mime-tools.SlackBuild b/dev/perl/perl-mime-tools/perl-mime-tools.SlackBuild index 7b114e49..64e955ad 100755 --- a/dev/perl/perl-mime-tools/perl-mime-tools.SlackBuild +++ b/dev/perl/perl-mime-tools/perl-mime-tools.SlackBuild @@ -15,8 +15,9 @@ # Place - Suite 330, Boston, MA 02111-1307, USA # # slackbuild for perl-mime-tools, by Silvio Rhatto -# requires: perl-file-temp perl-mime-base64 perl-mailtools perl-io-stringy -# tested: perl-mime-tools-5.426 +# requires: +# tested: perl-mime-tools-5.427 +# model: perl.mkSlackBuild $Rev: 796 $ # # Look for slackbuildrc @@ -31,13 +32,14 @@ CWD="$(pwd)" SRC_NAME="MIME-tools" PKG_NAME="perl-mime-tools" ARCH=${ARCH:=i486} -SRC_VERSION=${VERSION:=5.426} +SRC_VERSION=${VERSION:=5.427} 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-mime-tools"} 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 @@ -154,7 +223,8 @@ fi # 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" ] || [ "$1" = "--cleanup" ]; then |