echinus.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/bash
  2. # Slackware build script for echinus
  3. # Written by Charles E. Kauffman <email removed>.
  4. # Modified from Tom Canich's slackbuild for dwm.
  5. # Modified by B. Watson
  6. # Now maintained by B. Watson <yalhcru@gmail.com>. Original version
  7. # had no license; modified version is licensed under the WTFPL.
  8. # See http://www.wtfpl.net/txt/copying/ for details.
  9. # 20210907 bkw: BUILD=3, *actually* add the xinitrc. Nobody noticed
  10. # this build was broken for 1.5 years, so would anyone miss it if
  11. # it went away?
  12. # 20200101 bkw:
  13. # - take over maintenance
  14. # - BUILD=2
  15. # - add xinitrc
  16. # - simplify build
  17. cd $(dirname $0) ; CWD=$(pwd)
  18. PRGNAM=echinus
  19. VERSION=${VERSION:-0.4.9}
  20. BUILD=${BUILD:-3}
  21. TAG=${TAG:-_SBo}
  22. PKGTYPE=${PKGTYPE:-tgz}
  23. if [ -z "$ARCH" ]; then
  24. case "$( uname -m )" in
  25. i?86) ARCH=i586 ;;
  26. arm*) ARCH=arm ;;
  27. *) ARCH=$( uname -m ) ;;
  28. esac
  29. fi
  30. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  31. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  32. exit 0
  33. fi
  34. TMP=${TMP:-/tmp/SBo}
  35. PKG=$TMP/package-$PRGNAM
  36. OUTPUT=${OUTPUT:-/tmp}
  37. if [ "$ARCH" = "i586" ]; then
  38. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "i686" ]; then
  41. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  42. LIBDIRSUFFIX=""
  43. elif [ "$ARCH" = "x86_64" ]; then
  44. SLKCFLAGS="-O2 -fPIC"
  45. LIBDIRSUFFIX="64"
  46. else
  47. SLKCFLAGS="-O2"
  48. LIBDIRSUFFIX=""
  49. fi
  50. set -e
  51. rm -rf $PKG
  52. mkdir -p $TMP $PKG $OUTPUT
  53. cd $TMP
  54. rm -rf $PRGNAM-$VERSION
  55. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  56. cd $PRGNAM-$VERSION
  57. chown -R root:root .
  58. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  59. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  60. # use SLKCFLAGS
  61. sed -i "s/-Os/$SLKCFLAGS -Wl,-s/" config.mk
  62. # absolute paths for pixmaps
  63. sed -i "s,.pixmap: ,&/usr/share/$PRGNAM/," echinusrc
  64. # install docs in Slackware-compliant dir
  65. sed -i "s,DOCPREFIX}/$PRGNAM,&-$VERSION," Makefile
  66. # don't include $PKG in the path to the default config file
  67. # mentioned in the man page
  68. sed -i 's,\${DESTDIR}\(\${CONF}\),\1,' Makefile
  69. make install \
  70. PREFIX=/usr \
  71. DOCPREFIX=/usr/doc \
  72. CONFPREFIX=/usr/share \
  73. MANPREFIX=/usr/man \
  74. X11INC=/usr/include/X11 \
  75. X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 \
  76. CONF=/usr/share/$PRGNAM \
  77. DESTDIR=$PKG
  78. gzip -9 $PKG/usr/man/man1/$PRGNAM.1
  79. # xinitrc by B. Watson, modified from xinitrc.wmaker
  80. mkdir -p $PKG/etc/X11/xinit
  81. install -m0755 -oroot -groot $CWD/xinitrc.$PRGNAM $PKG/etc/X11/xinit
  82. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  83. cp -a LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
  84. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  85. mkdir -p $PKG/install
  86. cat $CWD/slack-desc > $PKG/install/slack-desc
  87. cd $PKG
  88. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE