enpass.SlackBuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. #
  3. # Slackware build script for Enpass
  4. #
  5. # Copyright 2019 Justin Teague Houston, US
  6. #
  7. # Based loosely on Patrick J. Volkerding's google-chrome.SlackBuild
  8. #
  9. # All rights reserved.
  10. #
  11. # Redistribution and use of this script, with or without modification, is
  12. # permitted provided that the following conditions are met:
  13. #
  14. # 1. Redistributions of this script must retain the above copyright
  15. # notice, this list of conditions and the following disclaimer.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  18. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  20. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  23. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  25. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  26. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. cd $(dirname $0) ; CWD=$(pwd)
  28. PRGNAM=enpass
  29. VERSION=${VERSION:-6.2.0.537}
  30. BUILD=${BUILD:-1}
  31. TAG=${TAG:-_SBo}
  32. PKGTYPE=${PKGTYPE:-tgz}
  33. ARCH=${ARCH:-$(uname -m)}
  34. case "$ARCH" in
  35. x86_64) DEBARCH="amd64" ; LIBDIRSUFFIX="64" ; ARCH=x86_64 ;;
  36. *) echo "Package for $(uname -m) architecture is not available." ; exit 1 ;;
  37. esac
  38. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  39. # the name of the created package would be, and then exit. This information
  40. # could be useful to other scripts.
  41. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  42. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  43. exit 0
  44. fi
  45. TMP=${TMP:-/tmp/SBo}
  46. PKG=$TMP/package-$PRGNAM
  47. OUTPUT=${OUTPUT:-/tmp}
  48. set -e
  49. rm -rf $PKG
  50. mkdir -p $TMP $PKG $OUTPUT
  51. cd $PKG
  52. ar p $CWD/${PRGNAM}_${VERSION}_${DEBARCH}.deb data.tar.gz | tar xvz || exit 1
  53. chown -R root:root .
  54. chmod -R u+w,go+r-w,a-s .
  55. chmod 0755 .
  56. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  57. mv $PKG/usr/share/icons $PKG/usr/doc/
  58. mv $PKG/usr/share/doc/enpass/changelog.gz $PKG/usr/doc/$PRGNAM-$VERSION/
  59. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  60. mkdir -p $PKG/usr/bin
  61. ln -s $PKG/opt/enpass/Enpass $PKG/usr/bin/enpass
  62. mkdir -p $PKG/install
  63. cat $CWD/slack-desc > $PKG/install/slack-desc
  64. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  65. cd $PKG
  66. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE