diff options
Diffstat (limited to 'dev')
-rw-r--r-- | dev/python/db3/Manifest | 4 | ||||
-rw-r--r-- | dev/python/db3/db3.SlackBuild | 87 |
2 files changed, 78 insertions, 13 deletions
diff --git a/dev/python/db3/Manifest b/dev/python/db3/Manifest new file mode 100644 index 00000000..94e400fe --- /dev/null +++ b/dev/python/db3/Manifest @@ -0,0 +1,4 @@ +DIST db-3.3.11.tar.gz 2343243 MD5 b6ae24fa55713f17a9ac3219d987722c SHA1 d6871c7e6008eb726d6fc28e3debc44d34570f93 SHA256 ac911bdd336a33aa4ced298aa3862cd317cbd372a20bbce9f65d0c21adea94fd SHA512 a9b89547d0e42a2c10cec981a60de100d5365b0928fcee05b9736b7889b095181824c524b43dc26edb3d914baabfd39bbb6b26a89ee7e930586b29f91d3e7de7 RMD160 08092e2cd6d67e767ed5c3f7ff55726c3f6a7d45 +MKBUILD db3.mkbuild 4519 MD5 f7cbd675431cfe0ced8e2b4a79e05426 SHA1 a2852c1bf8433aaa63036dbf6a0a23a707112afe SHA256 37ef85604cef8d806ea8e4e38ea7c57364113067ee803b72d19d2b1940c73c78 SHA512 449561438e164602db2911bef73b3c4cd18fb5d0675052eff8fc3dc58768ddc6ef80c9a06e279e9fbe0f471638a9c3f766f19a8127e26b10862a5697bc7fc658 RMD160 912bc53d0fc0613833229c3f319228a9e8536268 +PATCH patch.3.3.11.1.gz 622 MD5 46419c00f191a61f87e135dac25ec383 SHA1 1d05cee1f236eddc0f29e0e038df27eb88b29720 SHA256 4c88f2aaa2024d603ac74824729efe621180ef4a124b28e2e78b8fad1cfe691c SHA512 7f82720a32e983500456c2aac47a37e6c445fd856dd67b36cce41990e05f94a646428d3dac81e78f1bc03f64fa2d1aa269efc2e9b4a0e911875c34bc25b37eb3 RMD160 c7b9f413a146ac36316d7a1f3f9432fd37962546 +SLACKBUILD db3.SlackBuild 8156 MD5 acf043a2103345b4469d6db9c0950eff SHA1 651d563c443e93f552635dd56828f65344126b53 SHA256 af8d05e4b0c98d7c704aa70ac959a8a5095aa309847da33faf16d245e57246ff SHA512 e3bf1d9aa4f1e3339932b33ab1f1fb6b6400436ac3df3c411f42687de40e95721809547e3b25c447ebc001519dcfc8cc27009384f066c4641ce9010f527ec084 RMD160 8e248abefc0ab8226eaa12a751f1b098ce007db1 diff --git a/dev/python/db3/db3.SlackBuild b/dev/python/db3/db3.SlackBuild index f4e22c20..e3abdd3f 100644 --- a/dev/python/db3/db3.SlackBuild +++ b/dev/python/db3/db3.SlackBuild @@ -65,6 +65,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 +85,73 @@ if [ ! -s "$SRC_DIR/$SRC" ] || ! gunzip -t "$SRC_DIR/$SRC" 2> /dev/null; then wget "$URL" -O "$SRC_DIR/$SRC" || exit $ERROR_WGET fi +# Download patches +if echo http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/pasture/source/db3/patch.3.3.11.1.gz | grep -q -v "PATCH URLS"; then + for patch_url in http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/pasture/source/db3/patch.3.3.11.1.gz; do + patch="`basename $patch_url`" + if [ ! -s "$SRC_DIR/$patch" ]; then + wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET + fi + done +fi + +# Check Manifest file +if [ -e "$CWD/Manifest" ]; then + + 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 @@ -91,10 +159,11 @@ PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" # Patch source -patches=" +patches=" http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/pasture/source/db3/patch.3.3.11.1.gz $PKG_NAME.diff $PKG_NAME-$PKG_VERSION.diff $PKG_NAME-$PKG_VERSION-$ARCH.diff $PKG_NAME-$ARCH.diff" for patch in $patches; do + patch="`basename $patch`" if [ -f "$CWD/$patch" ]; then patch -Np0 < "$CWD/$patch" || exit $ERROR_PATCH elif [ -f "$CWD/patches/$patch" ]; then @@ -103,15 +172,7 @@ for patch in $patches; do gzip -dc "$CWD/$patch.gz" | patch -Np0 || exit $ERROR_PATCH elif [ -f "$CWD/patches/$patch.gz" ]; then gzip -dc "$CWD/patches/$patch.gz" | patch -Np0 || exit $ERROR_PATCH - fi -done - -if echo http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/pasture/source/db3/patch.3.3.11.1.gz | grep -q -v "PATCH URLS"; then - for patch_url in http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/pasture/source/db3/patch.3.3.11.1.gz; do - patch="`basename $patch_url`" - if [ ! -s "$SRC_DIR/$patch" ]; then - wget "$patch_url" -O "$SRC_DIR/$patch" || exit $ERROR_WGET - fi + elif [ -f "$SRC_DIR/$patch" ]; then if [ "`basename $patch .gz`" != "$patch" ]; then gzip -dc $SRC_DIR/$patch | patch -Np0 || exit $ERROR_PATCH elif [ "`basename $patch .bz2`" != "$patch" ]; then @@ -119,8 +180,8 @@ if echo http://slackware.cs.utah.edu/pub/slackware/slackware-12.1/pasture/source else patch -Np0 < "$SRC_DIR/$patch" || exit $ERROR_PATCH fi - done -fi + fi +done # Configure cd dist @@ -178,6 +239,6 @@ cd "$PKG" makepkg -l y -c n "$REPOS/$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 |