aboutsummaryrefslogtreecommitdiff
path: root/system/mlocate/mlocate.SlackBuild
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2019-12-28 08:55:52 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-12-28 08:55:52 +0700
commit18ce54101fcedd1b595c1fcc53860a31e8f5c463 (patch)
tree3eb1db296fcdc5214e209c9756c4b196cdcd0f83 /system/mlocate/mlocate.SlackBuild
parentc3aed3486866289068e8b4c88c862b3a6deb8f24 (diff)
system/mlocate: Added (locate/updatedb implementation).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mlocate/mlocate.SlackBuild')
-rw-r--r--system/mlocate/mlocate.SlackBuild120
1 files changed, 120 insertions, 0 deletions
diff --git a/system/mlocate/mlocate.SlackBuild b/system/mlocate/mlocate.SlackBuild
new file mode 100644
index 0000000000000..9f213fbb5406e
--- /dev/null
+++ b/system/mlocate/mlocate.SlackBuild
@@ -0,0 +1,120 @@
+#!/bin/sh
+
+# Slackware build script for mlocate
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# Notes:
+# - This is intended to be 100% compatible with the mlocate in -current.
+# - mlocate and slocate can't read each others' database formats. Bummer.
+# - DOWNLOAD is upstream's site, but the file is identical to the one
+# from Pat's source/ dir. I used upstream so the file won't disappear if
+# Pat upgrades or changes his mind.
+# - mlocate on -current uses the slocate group (there's no mlocate group),
+# so I do the same here.
+# - mlocate's database is about 40% larger than slocate's, on my build box.
+# Not a real concern unless you're building a tiny embedded system.
+
+PRGNAM=mlocate
+VERSION=${VERSION:-0.26}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+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-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+cd $PRGNAM-$VERSION
+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 {} \+
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PRGNAM-$VERSION \
+ --build=$ARCH-slackware-linux
+
+make groupname=slocate
+make install-strip DESTDIR=$PKG
+
+gzip $PKG/usr/man/man?/*.?
+
+# This stuff comes straight from Pat's mlocate.SlackBuild:
+mkdir -p $PKG/etc
+cp -a $CWD/updatedb.conf.new $PKG/etc/updatedb.conf.new
+chown root:root $PKG/etc/updatedb.conf.new
+chmod 644 $PKG/etc/updatedb.conf.new
+
+mv $PKG/usr/bin/locate $PKG/usr/bin/mlocate
+( cd $PKG/usr/bin ; ln -sf mlocate locate )
+
+( cd $PKG/usr/man/man1
+ ln -sf locate.1 mlocate.1
+)
+
+mkdir -p $PKG/usr/libexec
+cp -a $CWD/mlocate-run-updatedb $PKG/usr/libexec/mlocate-run-updatedb
+chown root:root $PKG/usr/libexec/mlocate-run-updatedb
+chmod 755 $PKG/usr/libexec/mlocate-run-updatedb
+
+mkdir -p $PKG/etc/cron.daily
+cp -a $CWD/mlocate.cron $PKG/etc/cron.daily/mlocate
+chown root:root $PKG/etc/cron.daily/mlocate
+chmod 755 $PKG/etc/cron.daily/mlocate
+
+chown root:slocate $PKG/usr/bin/mlocate
+chmod 2711 $PKG/usr/bin/mlocate
+mkdir -p $PKG/var/lib/mlocate
+chown root:slocate $PKG/var/lib/mlocate
+chmod 750 $PKG/var/lib/mlocate
+# End of Pat's stuff.
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COPYING* ChangeLog NEWS README* \
+ $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
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}