diff options
Diffstat (limited to 'dev/python/pycryptopp')
-rw-r--r-- | dev/python/pycryptopp/Manifest | 23 | ||||
-rwxr-xr-x | dev/python/pycryptopp/pycryptopp.SlackBuild | 78 |
2 files changed, 97 insertions, 4 deletions
diff --git a/dev/python/pycryptopp/Manifest b/dev/python/pycryptopp/Manifest new file mode 100644 index 00000000..7bc71627 --- /dev/null +++ b/dev/python/pycryptopp/Manifest @@ -0,0 +1,23 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST pycryptopp-0.5.9.tar.gz 1381516 MD5 d2248ad28f4a6a0c902d638da0caa227 RMD160 df4c38b742ba9d99eab78f0a65ea56522707996a SHA1 077298cdd87b9dc33700242e937fa96a70cdb7a6 SHA256 4b3b092c9baab56304e1d0cb117fb0e8241dbe59102e8efd79346d2369d3fca8 SHA512 dabfe105892db2ef4e34d9edf9ef435cfbfa30b6ec8d14021e4b03224d9de37d0bf0568a25389e3e06a8e3929f123b0e1e45b54ed1cc142751ad74a34d7c81c2 +MKBUILD pycryptopp.mkbuild 2519 MD5 2d1a0e5013a3e4fe084aa8adf91b607a RMD160 35e220f98595f6d740d5b5d1e96f25a6689d7156 SHA1 c9985a9eff14206b37a52b2d2865e8065c68d2b8 SHA256 086b869b930cd70cdbce5c3208593d24878812e6df3ed154aa4ff38e738c5af8 SHA512 cddd38123dbfd3169d592e79c98a17266edf3b0d4175840d3b0bbd14bddd115d1ddd460e07a4702d3e8c3e22f9692d15199f036d79cc488a5df3c0a09fa280bb +SLACKBUILD pycryptopp.SlackBuild 6721 MD5 230e42f4e8f9863b7411f3171f130cb4 RMD160 668da847c7520724ab046ae0201b7237731ec60a SHA1 d9a276b62268698ae001c707c78f3ec6b59076aa SHA256 c34ecea099f884da0c71829f355cfc03320bc47623f4f41f34a8da6b24245b69 SHA512 d83d14aea02f67d72f538463fb7b2a9907aede5f235beb09e0fd2ffc648ff09b6084cc15dd356d163f759450f12ad6e9c2c21aeb988d30da9ce84be3d0be0bc4 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.9 (GNU/Linux) + +iQIcBAEBAgAGBQJJ+w0aAAoJEEHL93ESzgeidqYP/jzad1/5PAm4RgIg2p8J74tw +jr2hi/onm8iqOW0K/URWQYKWeHz5U5+FJc+PjMKNI2QxWo/QI/vVpNdl/wWUbo2t +AQ8YPgCWRCiklyYoY/9C6R/ceHS8UF1X4InK212CEYHok8Yir7pXghDAPQGyjJY6 +MUilih4rHFCksfnUZIjdgqRxBoWJjXCmmYG3PFSE0gn9s5IdMgP5AP+0B3r9kQGy +z+xSnK3R+0FSpciWVLDMjE6Ciq/q2ktJJRGqe0cepj4s41/dzaKNT3QNbmW+Qqwc ++1u0uiBnZP+5BuZ296ybyLe2FqdOZUb4pBmx74kx2XyztvYb5YvrP9tmF2/a4mK/ +R8G9Th+aNvHuTORGiVXqYhyYOic0lNtgYjhpRUxOk2zS8WEFntqQ5t22+3naqjR4 +sUvJha07DEQ2+dkmUih/E5xSKMNjv8V7uGxX1rkisYtpLE4kxGJu0dZJKcjASUlP +rdTbGZLhqlcp2od2RMQ12qaUae/Fxtnq55iCGkQw/4Y+oF4pS7L6D5vDLE7tFyvT +V3DbHfGdF7fXzJZRS3KJIyMF6NBDWU8oWfBOv/PvyGJnUXTXKeex5a8QeerzihG7 +wz1JWhkRu6hdlPBzroACY7aZ8h6r7jo+xDnEMNw9BgLBgiu13XK3Y+G6zaAc0h6b +CztLdB6JbfS/2v3TTqd/ +=d1TU +-----END PGP SIGNATURE----- diff --git a/dev/python/pycryptopp/pycryptopp.SlackBuild b/dev/python/pycryptopp/pycryptopp.SlackBuild index e151b97d..60f0c6a4 100755 --- a/dev/python/pycryptopp/pycryptopp.SlackBuild +++ b/dev/python/pycryptopp/pycryptopp.SlackBuild @@ -17,6 +17,7 @@ # slackbuild for pycryptopp, by Silvio Rhatto # requires: # tested: pycryptopp-0.5.9 +# model: generic.mkSlackBuild $Rev: 805 $ # # 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/python/pycryptopp"} PREFIX=${PREFIX:=/usr} PKG_WORK="$TMP/$SRC_NAME" CONF_OPTIONS=${CONF_OPTIONS:=""} @@ -47,9 +49,9 @@ NUMJOBS=${NUMJOBS:=""} LIBDIR="$PREFIX/lib" if [ "$ARCH" = "i386" ]; then - SLKCFLAGS="-O2 -march=i386 -mcpu=i686" + SLKCFLAGS="-O2 -march=i386 -mtune=i686" elif [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mcpu=i686" + SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686" elif [ "$ARCH" = "s390" ]; then @@ -65,6 +67,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_WORK" 2> /dev/null @@ -84,6 +87,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 rmd160 sha1 sha256 sha512; 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 @@ -136,9 +205,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 |