slackbuilds

Personal Slackbuilds in the style of slackbuilds.org
git clone git://git.danielmoch.com/slackbuilds.git
Log | Files | Refs

hl3170cdw.SlackBuild (2686B)


      1 #!/bin/sh
      2 
      3 # Slackware build script for throttled
      4 #
      5 # Copyright 2020 Daniel Moch <daniel@danielmoch.com>
      6 #
      7 # Permission is hereby granted, free of charge, to any person obtaining a
      8 # copy of this software and associated documentation files (the "Software"),
      9 # to deal in the Software without restriction, including without limitation
     10 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
     11 # and/or sell copies of the Software, and to permit persons to whom the
     12 # Software is furnished to do so, subject to the following conditions:
     13 #
     14 # The above copyright notice and this permission notice shall be included
     15 # in all copies or substantial portions of the Software.
     16 #
     17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     18 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     19 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
     20 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
     21 # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     22 # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     23 # OTHER DEALINGS IN THE SOFTWARE.
     24 
     25 PRGNAM=hl3170cdw
     26 VERSION=${VERSION:-unknown}
     27 CWVERSION=${CWVERSION:-1.1.4-0}
     28 LPVERSION=${LPVERSION:-1.1.2-1}
     29 BUILD=${BUILD:-1}
     30 TAG=${TAG:-_djmoch}
     31 
     32 if [ -z "$ARCH" ]; then
     33   case "$( uname -m )" in
     34     i?86) ARCH=i586 ;;
     35     arm*) ARCH=arm ;;
     36        *) ARCH=$( uname -m ) ;;
     37   esac
     38 fi
     39 
     40 CWD=$(pwd)
     41 TMP=${TMP:-/tmp/djmoch}
     42 PKG=$TMP/package-$PRGNAM
     43 OUTPUT=${OUTPUT:-/tmp}
     44 
     45 if [ "$ARCH" = "i586" ]; then
     46   SLKCFLAGS="-O2 -march=i586 -mtune=i686"
     47   LIBDIRSUFFIX=""
     48 elif [ "$ARCH" = "i686" ]; then
     49   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
     50   LIBDIRSUFFIX=""
     51 elif [ "$ARCH" = "x86_64" ]; then
     52   SLKCFLAGS="-O2 -fPIC"
     53   LIBDIRSUFFIX="64"
     54 else
     55   SLKCFLAGS="-O2"
     56   LIBDIRSUFFIX=""
     57 fi
     58 
     59 set -e
     60 
     61 rm -rf $PKG
     62 mkdir -p $TMP $PKG $OUTPUT
     63 cd $TMP
     64 rm -rf $PRGNAM-$VERSION
     65 mkdir $PRGNAM-$VERSION
     66 cd $PRGNAM-$VERSION
     67 ar -x $CWD/${PRGNAM}cupswrapper-$CWVERSION.i386.deb
     68 tar -xzvf data.tar.gz
     69 ar -x $CWD/${PRGNAM}lpr-$LPVERSION.i386.deb
     70 tar -xzvf data.tar.gz
     71 chown -R root:root .
     72 find -L . \
     73  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
     74  -exec chmod 755 {} \; -o \
     75  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
     76  -exec chmod 644 {} \;
     77 
     78 install -Dm644 $CWD/slack-desc $PKG/install/slack-desc
     79 install -Dm644 $CWD/hl3170cdw.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/hl3170cdw.SlackBuild
     80 install -Dm755 usr/bin/brprintconf_hl3170cdw $PKG/usr/bin/brprintconf_hl3170cdw
     81 cp -r opt $PKG/
     82 
     83 cd $PKG
     84 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}