diff options
-rw-r--r-- | app/crypt/hashalot/Manifest | 4 | ||||
-rwxr-xr-x | app/crypt/hashalot/hashalot.SlackBuild | 104 |
2 files changed, 89 insertions, 19 deletions
diff --git a/app/crypt/hashalot/Manifest b/app/crypt/hashalot/Manifest new file mode 100644 index 00000000..5491ecd9 --- /dev/null +++ b/app/crypt/hashalot/Manifest @@ -0,0 +1,4 @@ +DIST hashalot_0.3.orig.tar.gz 79017 MD5 dc5a8b653daec843d41d0ab08d56545a SHA1 023b4e864b3e127255b8d6ebaf75e9aaa3be8e69 SHA256 a2d0f0df5a09763f1dc123cd607c9f1dd83c3dc8f400ca0a4ec978602eca0933 SHA512 ca9c684e6ff29cd42c5427ad899b28978330274b0f25b65b1a0e2fc7fdb7c42bb53f6b50e751c4690d4464230e5187008264dca1ef4f5c1b3cb27e6b06ea32b1 RMD160 6564825a123c05cc11ae6547089d347374f4c2eb +MKBUILD hashalot.mkbuild 3366 MD5 582a376c426bb4ca6b64ff50c408a987 SHA1 a5adcb063614c2d8c402587ea0cbc4d965b161ae SHA256 b257b78a6fb5a2b61793443186e6a170ba4a862b74f43dac048b15c4b819db13 SHA512 c33c03345de97c0fd02fafc9fde71b9334105dc0824782ff72aa7fa22437f6780ee6c0d21fdf9b80fc0231b5ef38c1f68911a3892696d4e140248017deb562ec RMD160 8debd21a21709fe70e20eee7a44d8c73f105f0d1 +PATCH hashalot_0.3-5.diff.gz 4639 MD5 4dee7c1f94c39e1c6dd1eab90b4830fb SHA1 2b80e8b1e6ef4f1cf4cb86a442e2aa43156d85a4 SHA256 8e8901ca03d79820b6f8ba87c4c6d0ada15b0d9a69ce16989d56dff32a60e7d0 SHA512 c84362d663c86ad40b9faeb2adbf9f45d1d4e55c0a9c40b8478d8ed53f43b7e4ec305142955626605c2a699be9be55f49dfdf3ed59667767938b3304b2eb2214 RMD160 1718ce7d6f2c442be1ccf74ed1cd30bb8413382a +SLACKBUILD hashalot.SlackBuild 7979 MD5 4ca614ad384ba82574cae91ecb87bbae SHA1 2d605b9cea0cce1cd0b02609ecfda7b09f477dae SHA256 ac7e2142662d2579a639b50576005ec82288c43efd8eda666c124903b56bae42 SHA512 32d9167337cbfcf58ac9efd758e8f9c2b92892fc9a7c0048e2235fd98eed476ad4829a2734a07be8fa7ae6d64db7a6cf1cbf09725258a38c70ccab473e29fffd RMD160 040816c2637e3df42ab1dd3182591f4d069584f1 diff --git a/app/crypt/hashalot/hashalot.SlackBuild b/app/crypt/hashalot/hashalot.SlackBuild index 36e0b8f8..2a372218 100755 --- a/app/crypt/hashalot/hashalot.SlackBuild +++ b/app/crypt/hashalot/hashalot.SlackBuild @@ -10,9 +10,9 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 59 Temple -# Place - Suite 330, Boston, MA 02111-1307, USA +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA # # slackbuild for hashalot, by Silvio Rhatto # requires: @@ -57,6 +57,7 @@ elif [ "$ARCH" = "s390" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIR="$PREFIX/lib64" + LDFLAGS="-L/lib64 -L/usr/lib64" fi # Set error codes (used by createpkg) @@ -64,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 @@ -83,30 +85,94 @@ 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://ftp.debian.org/debian/pool/main/h/hashalot/hashalot_0.3-5.diff.gz | grep -q -v "PATCH URLS"; then + for patch_url in http://ftp.debian.org/debian/pool/main/h/hashalot/hashalot_0.3-5.diff.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="`head -n $MANIFEST_COUNT $CWD/Manifest | 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 -PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $8 }'`" +PKG_SRC="$PWD/`ls -l | awk '/^d/ { print $NF }'`" cd "$PKG_SRC" # Patch source -patches=" +patches=" http://ftp.debian.org/debian/pool/main/h/hashalot/hashalot_0.3-5.diff.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 -Np1 < "$CWD/$patch" || exit $ERROR_PATCH elif [ -f "$CWD/patches/$patch" ]; then patch -Np1 < "$CWD/patches/$patch" || exit $ERROR_PATCH - fi -done - -if echo http://ftp.debian.org/debian/pool/main/h/hashalot/hashalot_0.3-5.diff.gz | grep -q -v "PATCH URLS"; then - for patch_url in http://ftp.debian.org/debian/pool/main/h/hashalot/hashalot_0.3-5.diff.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 "$CWD/$patch.gz" ]; then + gzip -dc "$CWD/$patch.gz" | patch -Np1 || exit $ERROR_PATCH + elif [ -f "$CWD/patches/$patch.gz" ]; then + gzip -dc "$CWD/patches/$patch.gz" | patch -Np1 || exit $ERROR_PATCH + elif [ -f "$SRC_DIR/$patch" ]; then if [ "`basename $patch .gz`" != "$patch" ]; then gzip -dc $SRC_DIR/$patch | patch -Np1 || exit $ERROR_PATCH elif [ "`basename $patch .bz2`" != "$patch" ]; then @@ -114,8 +180,8 @@ if echo http://ftp.debian.org/debian/pool/main/h/hashalot/hashalot_0.3-5.diff.gz else patch -Np1 < "$SRC_DIR/$patch" || exit $ERROR_PATCH fi - done -fi + fi +done # Configure CFLAGS="$SLKCFLAGS" \ @@ -150,9 +216,9 @@ done mkdir -p "$PKG/install" || exit $ERROR_MKDIR cat << EODESC > "$PKG/install/slack-desc" # HOW TO EDIT THIS FILE: -# The "handy ruler" below makes it easier to edit a package description. Line +# The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' -# on the right side marks the last column you can put a character in. You must +# on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. @@ -175,6 +241,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 |