system/mmv: Added (multiple mv/rename).

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2020-11-07 08:24:39 +07:00 committed by Willy Sudiarto Raharjo
parent 4cbe864454
commit 342e2017f2
5 changed files with 149 additions and 0 deletions

10
system/mmv/README Normal file
View file

@ -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.

View file

@ -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

93
system/mmv/mmv.SlackBuild Normal file
View file

@ -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}

12
system/mmv/mmv.info Normal file
View file

@ -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"

19
system/mmv/slack-desc Normal file
View file

@ -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: