slackbuilds

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

xss-lock.SlackBuild (2285B)


      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 SRCNAM=raymonad-xss-lock
     26 PRGNAM=xss-lock
     27 GITHASH=1e158fb20108058dbd62bd51d8e8c003c0a48717
     28 SHORTHASH=1e158fb20108
     29 VERSION=${VERSION:-0.3.0}
     30 BUILD=${BUILD:-1}
     31 TAG=${TAG:-_djmoch}
     32 
     33 if [ -z "$ARCH" ]; then
     34   case "$( uname -m )" in
     35     i?86) ARCH=i586 ;;
     36     arm*) ARCH=arm ;;
     37        *) ARCH=$( uname -m ) ;;
     38   esac
     39 fi
     40 
     41 CWD=$(pwd)
     42 TMP=${TMP:-/tmp/djmoch_slackbuilds}
     43 PKG=$TMP/package-$PRGNAM
     44 OUTPUT=${OUTPUT:-/tmp}
     45 
     46 set -e
     47 
     48 rm -rf $PKG
     49 mkdir -p $TMP $PKG $OUTPUT
     50 cd $TMP
     51 rm -rf $SRCNAM-$SHORTHASH
     52 tar xvf $CWD/$GITHASH.tar.gz
     53 cd $SRCNAM-$SHORTHASH
     54 chown -R root:root .
     55 find -L . \
     56  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
     57  -exec chmod 755 {} \; -o \
     58  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
     59  -exec chmod 644 {} \;
     60 
     61 cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
     62 make
     63 make DESTDIR=$PKG install
     64 
     65 install -Dm644 $CWD/slack-desc $PKG/install/slack-desc
     66 install -Dm644 $CWD/xss-lock.SlackBuild $PKG/usr/share/doc/$PRGNAM/xss-lock.SlackBuild
     67 
     68 cd $PKG
     69 /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}