spotlighter.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #!/bin/bash
  2. # Slackware build script for spotlighter
  3. # Written by Geoff Ritter < geoff dot ritter at gmail dot com >
  4. # Public Domain
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=spotlighter
  7. VERSION=${VERSION:-0.1}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM-$VERSION
  46. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. # If you are going to blindly reset permissions, this is a bit more readable.
  50. # However '-perm /111' may only be compatible with only gnu/find.
  51. find -L . \
  52. -type d -exec chmod 755 {} \; -o \
  53. -type f -perm /111 -exec chmod 755 {} \; -o \
  54. -type f -exec chmod 644 {} \;
  55. # Note, while there are no library files installed, the Make file apparently
  56. # uses --libdir to decided where to find some of the libraries.
  57. CFLAGS="$SLKCFLAGS" \
  58. CXXFLAGS="$SLKCFLAGS" \
  59. ./configure \
  60. --prefix=/usr \
  61. --libdir=/usr/lib$LIBDIRSUFFIX \
  62. --build=$ARCH-slackware-linux
  63. make
  64. make install DESTDIR=$PKG
  65. # Make sure the Icon parameter is set properly in .desktop file
  66. sed -i 's/Icon=.*/Icon=spotlighter/' $PKG/usr/share/applications/spotlighter.desktop
  67. # Copy the icon to the proper folder
  68. mkdir -p $PKG/usr/share/icons/hicolor/22x22/apps/
  69. cp $PKG/usr/share/pixmaps/spotlighter.png $PKG/usr/share/icons/hicolor/22x22/apps
  70. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  71. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  72. # No Manpages
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  79. # Make the package
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE