superkey-launch.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/bin/bash
  2. # Slackware build script for superkey-launch
  3. # Copyright 2014-2017 Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  4. # Copyright 2017 Jeremy Hansen <jebrhansen+SBo -at- gmail.com>
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version, with the following exception:
  9. # the text of the GPL license may be omitted.
  10. # This program is distributed in the hope that it will be useful, but
  11. # without any warranty; without even the implied warranty of
  12. # merchantability or fitness for a particular purpose. Compiling,
  13. # interpreting, executing or merely reading the text of the program
  14. # may result in lapses of consciousness and/or very being, up to and
  15. # including the end of all existence and the Universe as we know it.
  16. # See the GNU General Public License for more details.
  17. # You may have received a copy of the GNU General Public License along
  18. # with this program (most likely, a file named COPYING). If not, see
  19. # <http://www.gnu.org/licenses/>.
  20. cd $(dirname $0) ; CWD=$(pwd)
  21. PRGNAM=superkey-launch
  22. VERSION=${VERSION:-1.6.3}
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. if [ "$ARCH" = "i586" ]; then
  44. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  45. LIBDIRSUFFIX=""
  46. elif [ "$ARCH" = "i686" ]; then
  47. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  48. LIBDIRSUFFIX=""
  49. elif [ "$ARCH" = "x86_64" ]; then
  50. SLKCFLAGS="-O2 -fPIC"
  51. LIBDIRSUFFIX="64"
  52. else
  53. SLKCFLAGS="-O2"
  54. LIBDIRSUFFIX=""
  55. fi
  56. set -e
  57. rm -rf $PKG
  58. mkdir -p $TMP $PKG $OUTPUT
  59. mkdir -p $PKG/etc/xdg/autostart/
  60. cd $TMP
  61. rm -rf $PRGNAM-$VERSION
  62. if [ -e $CWD/$PRGNAM-$VERSION.tar.gz ]; then
  63. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  64. else
  65. tar xvf $CWD/$VERSION.tar.gz
  66. fi
  67. cd $PRGNAM-$VERSION
  68. sed -i "s|MANDIR?=/local/man/man1|MANDIR?=/man/man1|" Makefile
  69. make \
  70. OPTS="$SLKCFLAGS" \
  71. PREFIX=/usr \
  72. MANPREFIX=/usr/man \
  73. X11INC=/usr/include \
  74. X11LIB=/usr/lib${LIBDIRSUFFIX}/X11
  75. make install \
  76. OPTS="$SLKCFLAGS" \
  77. PREFIX=/usr \
  78. MANPREFIX=/usr/man \
  79. X11INC=/usr/include \
  80. X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 \
  81. DESTDIR=$PKG
  82. install -m644 $PRGNAM.desktop $PKG/etc/xdg/autostart/
  83. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  84. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  85. find $PKG/usr/man -type f -exec gzip -9 {} \;
  86. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  87. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  88. cp $CWD/README $PKG/usr/doc/$PRGNAM-$VERSION
  89. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  90. mkdir -p $PKG/install
  91. cat $CWD/slack-desc > $PKG/install/slack-desc
  92. cd $PKG
  93. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE