]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@525 04377dda-e619-0410...
authorrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Sat, 6 Sep 2008 23:11:24 +0000 (23:11 +0000)
committerrudson <rudson@04377dda-e619-0410-9926-eae83683ac58>
Sat, 6 Sep 2008 23:11:24 +0000 (23:11 +0000)
trunk/mkbuild/generic.mkSlackBuild

index a9b07ef92b8675b93dec5d25d9984e1d9eb01659..49b9e716429ebf002990fcdc8a403d1f85a8fd3a 100644 (file)
@@ -137,24 +137,20 @@ PKG_SRC="$PWD/$SND_DIR"
 cd "$PKG_SRC"
 </svn_source>
 
-<md5sum_download_and_check_0> off
-MD5SUM_SRC="$(md5sum "$SRC_DIR/$SRC" | cut -d " " -f 1)"
+<md5sum_check> off
 MD5SUM_URL="[[MD5SUM CODE]]"
 
-[ "$MD5SUM_SRC" == "$MD5SUM_URL" ] || exit $ERROR_MD5
-</md5sum_download_and_check_0>
+if [ ${#MD5SUM_URL} -eq 32 ]; then
+    MD5SUM_SRC="$(md5sum "$SRC_DIR/$SRC" | cut -c-32 )"
+    [ "$MD5SUM_SRC" == "$MD5SUM_URL" ] || exit $ERROR_MD5
 
-<md5sum_download_and_check_1> off
 # Download source's MD5 checksum if necessary and check it
 if [ ! -s "$SRC_DIR/$SRC.[[MD5SUM EXTENSION]]" ]; then
    wget "$URL.[[MD5SUM EXTENSION]]" -O "$SRC_DIR/$SRC.[[MD5SUM EXTENSION]]" || exit $ERROR_WGET
 fi
 
-MD5SUM_SRC="$(md5sum "$SRC_DIR/$SRC" | cut -d " " -f 1)"
-MD5SUM_URL="$(grep "$SRC[ \t]*$" "$SRC_DIR/$SRC.[[MD5SUM EXTENSION]]" | cut -d " " -f 1)"
-
-[ "$MD5SUM_SRC" == "$MD5SUM_URL" ] || exit $ERROR_MD5
-</md5sum_download_and_check_1>
+md5sum -c "$SRC_DIR/$SRC.[[MD5SUM EXTENSION]]" || exit $ERROR_MD5
+</md5sum_check>
 
 <gpg_signature_check> off
 # Import minimized signing key from
@@ -244,6 +240,15 @@ if echo [[PATCH URLS]] | grep -q -v "PATCH URLS"; then
 fi
 </patch_source>
 
+<files_permissions> off
+# Set permissions
+chown -R root:root .
+find . \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+</files_permissions>
+
 <configure> off
 # Configure
 CFLAGS="$SLKCFLAGS" \
@@ -406,7 +411,7 @@ makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERRO
 
 <clean_builds> off
 # Delete source and build directories if requested
-if [ "$CLEANUP" == "yes" ] || [ "$1" = "--cleanup" ]; then
+if [ "$CLEANUP" == "yes" ]; then
   rm -rf "$PKG_WORK" "$PKG"
 fi
 </clean_builds>