aboutsummaryrefslogtreecommitdiff
path: root/system/mmv
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2020-11-07 08:24:39 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-11-07 08:24:39 +0700
commit342e2017f2a339e436bfb1c763205b8daaea701b (patch)
treea6577af47aad06c3c2fa33d89c2509e86e151314 /system/mmv
parent4cbe86445404e1b24c8b5ea4295d8b0ae077cd4c (diff)
system/mmv: Added (multiple mv/rename).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mmv')
-rw-r--r--system/mmv/README10
-rw-r--r--system/mmv/compilefix.diff15
-rw-r--r--system/mmv/mmv.SlackBuild93
-rw-r--r--system/mmv/mmv.info12
-rw-r--r--system/mmv/slack-desc19
5 files changed, 149 insertions, 0 deletions
diff --git a/system/mmv/README b/system/mmv/README
new file mode 100644
index 000000000000..6f876d8eb489
--- /dev/null
+++ b/system/mmv/README
@@ -0,0 +1,10 @@
+mmv (move/copy/append/link multiple files by wildcard patterns)
+
+This is mmv, a program to move/copy/append/link multiple files
+according to a set of wildcard patterns. This multiple action is
+performed safely, i.e. without any unexpected deletion of files due
+to collisions of target names with existing filenames or with other
+target names. Furthermore, before doing anything, mmv attempts to
+detect any errors that would result from the entire set of actions
+specified and gives the user the choice of either aborting before
+beginning, or proceeding by avoiding the offending parts.
diff --git a/system/mmv/compilefix.diff b/system/mmv/compilefix.diff
new file mode 100644
index 000000000000..9a13a156dc9c
--- /dev/null
+++ b/system/mmv/compilefix.diff
@@ -0,0 +1,15 @@
+diff -Naur a/mmv.c b/mmv.c
+--- a/mmv.c 2020-07-01 18:55:50.961457418 -0400
++++ b/mmv.c 2020-07-01 19:00:17.724426386 -0400
+@@ -193,10 +193,7 @@
+ #ifdef IS_SYSV
+
+ /* for System V and Version 7*/
+-struct utimbuf {
+- time_t actime;
+- time_t modtime;
+-};
++#include <utime.h>
+ #define utimes(f, t) utime((f), &(t))
+
+ #ifndef HAS_RENAME
diff --git a/system/mmv/mmv.SlackBuild b/system/mmv/mmv.SlackBuild
new file mode 100644
index 000000000000..7ea0d50b3b09
--- /dev/null
+++ b/system/mmv/mmv.SlackBuild
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+# Slackware build script for mmv
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# This is ancient software (1.01b was released in 1990), but still
+# useful. We're treating Debian as upstream here, our version number
+# matches their patchlevel (with _ intead of -).
+
+PRGNAM=mmv
+VERSION=${VERSION:-1.01b_19}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+SRCVER="$( echo $VERSION | cut -d_ -f1 )"
+DEBVER="$( echo $VERSION | cut -d_ -f2 )"
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$SRCVER.orig
+tar xvf $CWD/${PRGNAM}_$SRCVER.orig.tar.gz
+cd $PRGNAM-$SRCVER.orig
+tar xvf $CWD/${PRGNAM}_$SRCVER-$DEBVER.debian.tar.xz
+chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# apply all Debian's patches:
+for i in $( cat debian/patches/series ); do
+ patch -p1 < debian/patches/$i
+done
+
+# one patch of our own:
+patch -p1 < $CWD/compilefix.diff
+
+# the default LDFLAGS cause the build to fail, override with "nothing".
+sed -i "s,-O2,$SLKCFLAGS -Wall," Makefile
+make LDFLAGS=
+
+# easier to do this manually (only 2 files):
+mkdir -p $PKG/usr/bin $PKG/usr/man/man1
+install -s -m0755 $PRGNAM $PKG/usr/bin
+gzip -9c < $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+# multi-named executable, uses its name to decide what action to take.
+LINKS="mcp mad mln"
+for i in $LINKS; do
+ ln -s $PRGNAM $PKG/usr/bin/$i
+ ln -s $PRGNAM.1.gz $PKG/usr/man/man1/$i.1.gz
+done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a ANNOUNCE READ.ME ARTICLE debian/changelog $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/mmv/mmv.info b/system/mmv/mmv.info
new file mode 100644
index 000000000000..c93d2e5da670
--- /dev/null
+++ b/system/mmv/mmv.info
@@ -0,0 +1,12 @@
+PRGNAM="mmv"
+VERSION="1.01b_19"
+HOMEPAGE="https://packages.debian.org/sid/mmv"
+DOWNLOAD="http://deb.debian.org/debian/pool/main/m/mmv/mmv_1.01b.orig.tar.gz \
+ http://deb.debian.org/debian/pool/main/m/mmv/mmv_1.01b-19.debian.tar.xz"
+MD5SUM="1b2135ab2f17bdfa9e08debbb3c46ad8 \
+ 5952faa99a610afdbba73d20d68c6d0f"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/system/mmv/slack-desc b/system/mmv/slack-desc
new file mode 100644
index 000000000000..063f2c6f514b
--- /dev/null
+++ b/system/mmv/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# 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 make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+mmv: mmv (multiple mv/rename)
+mmv:
+mmv: This is mmv, a program to move/copy/append/link multiple files
+mmv: according to a set of wildcard patterns. This multiple action is
+mmv: performed safely, i.e. without any unexpected deletion of files due to
+mmv: collisions of target names with existing filenames or with other
+mmv: target names.
+mmv:
+mmv:
+mmv:
+mmv: