summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2012-09-06 09:45:21 +0200
committerRobby Workman <rworkman@slackbuilds.org>2012-09-08 17:28:29 -0500
commitf1d0ad19330c134d7c41d1c56f240b7b50119b81 (patch)
treefda29edef08d61f1c94ab8575dbd9e883e1e16f8
parent111c0170c751d9ab8f8d2487ea5120dace824650 (diff)
downloadslackbuilds-f1d0ad19330c134d7c41d1c56f240b7b50119b81.tar.gz
system/udevil: Added (removable devices manager).
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--system/udevil/README19
-rw-r--r--system/udevil/doinst.sh14
-rw-r--r--system/udevil/slack-desc19
-rw-r--r--system/udevil/udevil.SlackBuild108
-rw-r--r--system/udevil/udevil.info10
5 files changed, 170 insertions, 0 deletions
diff --git a/system/udevil/README b/system/udevil/README
new file mode 100644
index 0000000000..a43b17a0ec
--- /dev/null
+++ b/system/udevil/README
@@ -0,0 +1,19 @@
+udevil (removable devices manager)
+
+udevil is a command line Linux program which mounts and unmounts
+removable devices without a password, shows device info, and monitors
+device changes. It can also mount ISO files, nfs://, smb://, ftp://,
+ssh:// URLs, and tmpfs/ramfs filesystems.
+udevil is highly configurable, requires no daemon running, and depends
+only on udev and glib. To use it, just prefix a normal mount command
+with 'udevil'.
+
+It's reccomended for proper autodetection of removable
+devices to enable kernel polling. You can do it adding
+this line to /etc/rc.d/rc.local (the value is in
+milliseconds, higher means slower detection but lower
+overhead)
+
+echo 3000 > /sys/module/block/parameters/events_dfl_poll_msecs
+
+zenity is an optional dependency.
diff --git a/system/udevil/doinst.sh b/system/udevil/doinst.sh
new file mode 100644
index 0000000000..e7044ad72d
--- /dev/null
+++ b/system/udevil/doinst.sh
@@ -0,0 +1,14 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/udevil/udevil.conf.new
diff --git a/system/udevil/slack-desc b/system/udevil/slack-desc
new file mode 100644
index 0000000000..d81c5b036f
--- /dev/null
+++ b/system/udevil/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------------------------------------------------------|
+udevil: udevil (removable devices manager)
+udevil:
+udevil: udevil is a command line Linux program which mounts and unmounts
+udevil: removable devices without a password, shows device info, and monitors
+udevil: device changes. It can also mount ISO files, nfs://, smb://, ftp://,
+udevil: ssh:// URLs, and tmpfs/ramfs filesystems.
+udevil: udevil is highly configurable, requires no daemon running, and depends
+udevil: only on udev and glib. To use it, just prefix a normal mount command
+udevil: with 'udevil'.
+udevil: homepage: http://ignorantguru.github.com/udevil/
+udevil:
diff --git a/system/udevil/udevil.SlackBuild b/system/udevil/udevil.SlackBuild
new file mode 100644
index 0000000000..be3580c52b
--- /dev/null
+++ b/system/udevil/udevil.SlackBuild
@@ -0,0 +1,108 @@
+#!/bin/sh
+
+# Slackware build script for udevil
+# Copyright Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy, 2012
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=udevil
+VERSION=${VERSION:-0.3.2}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -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
+
+DOCS="AUTHORS COPYING ChangeLog NEWS README"
+
+set -e # Exit on most errors
+
+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 . \
+ \( -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 {} \;
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --build=$ARCH-slackware-linux
+
+make
+make install DESTDIR=$PKG
+
+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
+
+mv $PKG/etc/udevil/udevil.conf{,.new}
+# Specify which system groups are allowed to use the suidded udevil
+sed -i "s|^allowed_groups.*|allowed_groups = plugdev|" $PKG/etc/udevil/udevil.conf.new
+chgrp plugdev $PKG/usr/bin/udevil
+chmod u+s,go-s,o-x $PKG/usr/bin/udevil
+
+# Specify which filesystems udevil is allowed to handle
+ALLOWED_FS="ext2, ext3, ext4, fat, vfat, ntfs, reiserfs, xfs, btrfs, fuse, fuseblk,"
+ALLOWED_FS=${ALLOWED_FS}" fusectl, file, cifs, nfs, curlftpfs, ftpfs, sshfs, tmpfs,"
+ALLOWED_FS=${ALLOWED_FS}" ramfs, iso9660, udf, msdos, umsdos"
+sed -i "s|^allowed_types.*|allowed_types = $ALLOWED_FS|" \
+ $PKG/etc/udevil/udevil.conf.new
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a $DOCS $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}
diff --git a/system/udevil/udevil.info b/system/udevil/udevil.info
new file mode 100644
index 0000000000..97dbaa8ab7
--- /dev/null
+++ b/system/udevil/udevil.info
@@ -0,0 +1,10 @@
+PRGNAM="udevil"
+VERSION="0.3.2"
+HOMEPAGE="http://ignorantguru.github.com/udevil/"
+DOWNLOAD="https://github.com/IgnorantGuru/udevil/raw/master/packages/0.3.2/udevil-0.3.2.tar.xz"
+MD5SUM="47b8f9334266d65020daa4679f71b504"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Matteo Bernardini"
+EMAIL="ponce@slackbuilds.org"