diff options
author | Robby Workman <rworkman@slackbuilds.org> | 2014-08-03 09:33:27 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2014-08-03 09:33:27 +0700 |
commit | eab461e1a9391a3d83834a3acb53a55a5269a6c1 (patch) | |
tree | 03b578c7aaa09df8309fdad6599d24dbcd78b98e /system | |
parent | 552452bcdaaafa4cbe444e235378bfbc2be231e1 (diff) | |
download | slackbuilds-eab461e1a9391a3d83834a3acb53a55a5269a6c1.tar.gz |
system/samsung-mfp-drivers: Added (Samsung Multi Printer Drivers).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/samsung-mfp-drivers/README | 14 | ||||
-rw-r--r-- | system/samsung-mfp-drivers/doinst.sh | 14 | ||||
-rw-r--r-- | system/samsung-mfp-drivers/samsung-mfp-drivers.SlackBuild | 121 | ||||
-rw-r--r-- | system/samsung-mfp-drivers/samsung-mfp-drivers.info | 10 | ||||
-rw-r--r-- | system/samsung-mfp-drivers/slack-desc | 19 |
5 files changed, 178 insertions, 0 deletions
diff --git a/system/samsung-mfp-drivers/README b/system/samsung-mfp-drivers/README new file mode 100644 index 0000000000..166dabe38d --- /dev/null +++ b/system/samsung-mfp-drivers/README @@ -0,0 +1,14 @@ +The samsung-mfp-drivers package contains a set of drivers for +various Samsung printers and multifunction devices. + +Given that the maintainer of this build script only possesses +a Samsung ML-2955ND laser printer, results may vary with other +devices (and fixes for those are certainly welcome). + +After the package is installed, if you plan to use the scanner +function of your device (assuming it's present), you'll need to +add a line containing "smfp-samsung" to /etc/sane.d/dll.conf +It's also possible that the line should read only "smfp" instead, +as that's what the terrible install script appends to the file, +but given how they name the config file, it's not immediately +obvious how it would work. Best wishes :-) diff --git a/system/samsung-mfp-drivers/doinst.sh b/system/samsung-mfp-drivers/doinst.sh new file mode 100644 index 0000000000..82eeb0e03f --- /dev/null +++ b/system/samsung-mfp-drivers/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/sane.d/smfp-samsung.conf.new diff --git a/system/samsung-mfp-drivers/samsung-mfp-drivers.SlackBuild b/system/samsung-mfp-drivers/samsung-mfp-drivers.SlackBuild new file mode 100644 index 0000000000..64cb89ec87 --- /dev/null +++ b/system/samsung-mfp-drivers/samsung-mfp-drivers.SlackBuild @@ -0,0 +1,121 @@ +#!/bin/sh + +# Slackware build script for samsung-mfp-drivers + +# Copyright 2014 Robby Workman, Northport, Alabama, USA +# 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=samsung-mfp-drivers +VERSION=${VERSION:-1.00.06} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +TARNAM="ULD_Linux" +SRCNAM="uld" + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i386 ;; + 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 + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM +tar xvf $CWD/${TARNAM}_V${VERSION}.tar.gz +cd $SRCNAM +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 {} \; + +mkdir -p $PKG/usr/bin +cp -a $ARCH/smfpnetdiscovery $PKG/usr/bin + +mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/cups/filter/ +cp -a $ARCH/libsane-smfp.so* $ARCH/libscmssc.so \ + $PKG/usr/lib${LIBDIRSUFFIX} +cp -a $ARCH/pstospl $ARCH/pstosplc $ARCH/rastertospl $ARCH/rastertosplc \ + $PKG/usr/lib${LIBDIRSUFFIX}/cups/filter/ + +mkdir -p $PKG/usr/share/cups/model/Samsung +cp -a noarch/share/locale $PKG/usr/share +# This will possibly need to be in /usr/share/ppd/ for cups-1.7.x +cp -a noarch/share/ppd/* $PKG/usr/share/cups/model/Samsung + +# Well, this is braindead, but the libsane-smfp library has this directory +# location compiled into it, so not much we can do about that. +# Hey Samsung, how about releasing some source code under a sane license so +# that this and other crap (like below wrt udev rules) isn't necessary? +mkdir -p $PKG/opt/smfp-common/scanner/share +cat noarch/libsane-smfp.cfg > $PKG/opt/smfp-common/scanner/share/libsane-smfp.cfg +cat noarch/pagesize.xml > $PKG/opt/smfp-common/scanner/share/pagesize.xml + +# Generate udev rules file with a sane(r) version of that awful mess +# in their install scripts :/ +mkdir -p $PKG/lib/udev/rules.d +VID="$(grep "^VID=" "noarch/oem.conf" 2>/dev/null | sed 's/\"//g' | sed "s/VID=\(.*\)/\1/")" +PIDS="$(grep "^PIDS=" "noarch/oem.conf" 2>/dev/null | sed 's/\"//g' | sed "s/PIDS=\(.*\)/\1/")" +while read line; do + eval echo \"$line\" >> "$PKG/lib/udev/rules.d/60-samsung-smfp.rules" +done < "noarch/etc/smfp.rules.in" + +mkdir -p $PKG/etc/sane.d/ +cat noarch/etc/smfp.conf > $PKG/etc/sane.d/smfp-samsung.conf.new + +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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a noarch/license/* $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/samsung-mfp-drivers/samsung-mfp-drivers.info b/system/samsung-mfp-drivers/samsung-mfp-drivers.info new file mode 100644 index 0000000000..f6242a661a --- /dev/null +++ b/system/samsung-mfp-drivers/samsung-mfp-drivers.info @@ -0,0 +1,10 @@ +PRGNAM="samsung-mfp-drivers" +VERSION="1.00.06" +HOMEPAGE="https://www.samsung.com/us/support/" +DOWNLOAD="http://downloadcenter.samsung.com/content/DR/201308/20130806093305468/ULD_Linux_V1.00.06.tar.gz" +MD5SUM="94ee35696ddad334a53f76c9606607a5" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Robby Workman" +EMAIL="rworkman@slackbuilds.org" diff --git a/system/samsung-mfp-drivers/slack-desc b/system/samsung-mfp-drivers/slack-desc new file mode 100644 index 0000000000..d05f1f0490 --- /dev/null +++ b/system/samsung-mfp-drivers/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------------------------------------------------------| +samsung-mfp-drivers: samsung-mfp-driver (Samsung Multifunction Printer Drivers) +samsung-mfp-drivers: +samsung-mfp-drivers: The samsung-mfp-drivers package contains a set of drivers for +samsung-mfp-drivers: various Samsung printers and multifunction devices. +samsung-mfp-drivers: +samsung-mfp-drivers: Given that the maintainer of this build script only possesses +samsung-mfp-drivers: a Samsung ML-2955ND laser printer, results may vary with other +samsung-mfp-drivers: devices (and fixes for those are certainly welcome). +samsung-mfp-drivers: +samsung-mfp-drivers: Homepage: https://www.samsung.com/us/support/ +samsung-mfp-drivers: |