aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2020-03-05 16:35:08 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-03-07 14:06:33 +0700
commit1f9f359f3711f4e64c67df3e45da683cd364fdb7 (patch)
treefa1ba15013cf973891e606ab4b8599f44daf6693
parent7e7c72981c937a323644bec8fe19d07b5f6d26e2 (diff)
misc/rarcrack: New maintainer, various fixes.
Signed-off-by: B. Watson <yalhcru@gmail.com>
-rw-r--r--misc/rarcrack/README7
-rw-r--r--misc/rarcrack/rarcrack.SlackBuild49
-rw-r--r--misc/rarcrack/rarcrack.info4
-rw-r--r--misc/rarcrack/slack-desc2
4 files changed, 39 insertions, 23 deletions
diff --git a/misc/rarcrack/README b/misc/rarcrack/README
index dc12ac636976f..356fbbf6c5087 100644
--- a/misc/rarcrack/README
+++ b/misc/rarcrack/README
@@ -1,8 +1,9 @@
-rarcrack (Password cracker for rar archives)
+rarcrack (password cracker for rar/7z/zip archives)
-rarcrack uses a brute force algorithm to guess your encrypted
+rarcrack uses a brute force algorithm to guess your encrypted
compressed file's password.
This program can crack zip, 7z and rar file passwords.
-NOTE: for work this require: p7zip, unrar.
+Optional (recommended) dependencies: At runtime, you'll need unrar to
+crack rar files, and/or p7zip to crack 7z files.
diff --git a/misc/rarcrack/rarcrack.SlackBuild b/misc/rarcrack/rarcrack.SlackBuild
index 310feb221613f..3ad78cc17ebcb 100644
--- a/misc/rarcrack/rarcrack.SlackBuild
+++ b/misc/rarcrack/rarcrack.SlackBuild
@@ -3,6 +3,7 @@
# Slackware build script for rarcrack.
#
# Copyright 2015-2020 Edinaldo P. Silva, Rio de Janeiro, Brazil.
+# Copyright 2020 B. Watson
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,14 +23,23 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20200304 bkw:
+# - take over maintenance
+# - i486 => i586
+# - strip binary, BUILD=3
+# - install test archives in doc dir
+# - patch to fix file type autodetection
+# - actually use SLKCFLAGS
+# - use 'make install'
+
PRGNAM=rarcrack
VERSION=${VERSION:-0.2}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -40,8 +50,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -63,23 +73,28 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# autodetection relies on file(1), but on the author's system it must
+# be an old version, or a non-gnu one.
+sed -i -e '/CMD_DETECT/s|"file[^"]*"|"file -b --mime-type %s"|' \
+ -e 's|"application/octet-stream"|"application/x-7z-compressed"|' \
+ -e 's|"application/x-zip"|"application/zip"|' \
+ $PRGNAM.h
-make prefix=/usr DESTDIR=$PKG
+sed -i "s|-O2|$SLKCFLAGS|" Makefile
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC $PKG/usr/bin
-install -d $PKG/usr/bin
-install -D -m755 rarcrack $PKG/usr/bin/rarcrack
+make
+make install PREFIX=$PKG/usr DOCDIR=$PKGDOC
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp CHANGELOG LICENSE README README.html RELEASE_NOTES $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# 20200305 bkw: the test archives are small and may be useful (if nothing
+# else, useful to me for testing).
+cp -a test.* $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
diff --git a/misc/rarcrack/rarcrack.info b/misc/rarcrack/rarcrack.info
index bb9e647cd365f..6a7fc5fd7957d 100644
--- a/misc/rarcrack/rarcrack.info
+++ b/misc/rarcrack/rarcrack.info
@@ -6,5 +6,5 @@ MD5SUM="e3838aaa384aaa0834d73914e182a628"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="orphaned - no maintainer"
-EMAIL="nobody@nowhere"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/misc/rarcrack/slack-desc b/misc/rarcrack/slack-desc
index 0d02039ca2226..1160d624a9f30 100644
--- a/misc/rarcrack/slack-desc
+++ b/misc/rarcrack/slack-desc
@@ -6,7 +6,7 @@
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
-rarcrack: rarcrack (Password cracker for rar archives)
+rarcrack: rarcrack (password cracker for rar/7z/zip archives)
rarcrack:
rarcrack: rarcrack uses a brute force algorithm to guess your encrypted
rarcrack: compressed file's password.