flpsed.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # Slackware build script for flpsed
  3. # Originally written by Jack Maddox <email removed>
  4. # Currently maintained by B. Watson <yalhcru@gmail.com>
  5. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  6. # 20201102 bkw: BUILD=2
  7. # - Include icons in the package
  8. # - Get rid of INSTALL in doc dir
  9. # - Homepage went away, use Fedora download and archive.org homepage.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=flpsed
  12. VERSION=${VERSION:-0.7.3}
  13. BUILD=${BUILD:-2}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) export ARCH=i586 ;;
  19. arm*) export ARCH=arm ;;
  20. *) export ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  24. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  25. exit 0
  26. fi
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. if [ "$ARCH" = "i586" ]; then
  31. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "i686" ]; then
  34. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "x86_64" ]; then
  37. SLKCFLAGS="-O2 -fPIC"
  38. LIBDIRSUFFIX="64"
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-$VERSION
  48. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  52. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  53. CFLAGS="$SLKCFLAGS" \
  54. CXXFLAGS="$SLKCFLAGS" \
  55. ./configure \
  56. --prefix=/usr \
  57. --libdir=/usr/lib${LIBDIRSUFFIX} \
  58. --sysconfdir=/etc \
  59. --localstatedir=/var \
  60. --mandir=/usr/man \
  61. --build=$ARCH-slackware-linux
  62. make
  63. make install-strip DESTDIR=$PKG
  64. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a README COPYING AUTHORS NEWS $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. # upstream ships icons but doesn't 'make install' them.
  69. mkdir -p $PKG/usr/share/pixmaps $PKG/usr/share/icons/hicolor/scalable/apps/
  70. cat $PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
  71. gzip -9c < $PRGNAM.svg > $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svgz
  72. mkdir -p $PKG/usr/share/applications
  73. sed "/^Icon=\$/s,\$,$PRGNAM," \
  74. $CWD/$PRGNAM.desktop > \
  75. $PKG/usr/share/applications/$PRGNAM.desktop
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE