xpe.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # Slackware build script for xpe:
  3. # the neXtgen Povray Editor
  4. # Written by Niels Horn - niels.horn@gmail.com
  5. # revision date 2009/10/07
  6. # 20220222 bkw: Modified by SlackBuilds.org, BUILD=2:
  7. # - fix build on 15.0 (-std=c++11).
  8. # - use correct version of wxPython, regardless of /usr/bin/wx-config.
  9. # - do not install useless INSTALL in doc dir.
  10. # - absolute path to icon in .desktop.
  11. cd $(dirname $0) ; CWD=$(pwd)
  12. PRGNAM=xpe
  13. VERSION=${VERSION:-0.9.5b}
  14. BUILD=${BUILD:-2}
  15. TAG=${TAG:-_SBo}
  16. PKGTYPE=${PKGTYPE:-tgz}
  17. # The tarballs come with the name "xpe_project" to distinguish them from
  18. # the "xpe_daily" svn snapshots
  19. SRCPRGNAM=xpe_project
  20. # The Source tarball has a different version numbering
  21. SRCVERSION="v$(echo $VERSION | tr . _)"
  22. if [ -z "$ARCH" ]; then
  23. case "$( uname -m )" in
  24. i?86) ARCH=i586 ;;
  25. arm*) ARCH=arm ;;
  26. *) ARCH=$( uname -m ) ;;
  27. esac
  28. fi
  29. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  30. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  31. exit 0
  32. fi
  33. TMP=${TMP:-/tmp/SBo}
  34. PKG=$TMP/package-$PRGNAM
  35. OUTPUT=${OUTPUT:-/tmp}
  36. if [ "$ARCH" = "i586" ]; then
  37. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "i686" ]; then
  40. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  41. LIBDIRSUFFIX=""
  42. elif [ "$ARCH" = "x86_64" ]; then
  43. SLKCFLAGS="-O2 -fPIC"
  44. LIBDIRSUFFIX="64"
  45. else
  46. SLKCFLAGS="-O2"
  47. LIBDIRSUFFIX=""
  48. fi
  49. set -e
  50. rm -rf $TMP/${SRCPRGNAM} $PKG
  51. mkdir -p $TMP $PKG $OUTPUT
  52. cd $TMP
  53. tar xvf $CWD/${SRCPRGNAM}_${SRCVERSION}.tar.gz
  54. cd ${SRCPRGNAM}
  55. chown -R root:root .
  56. find -L . \
  57. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  58. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  59. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  60. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  61. CFLAGS="$SLKCFLAGS" \
  62. CPPFLAGS="$SLKCFLAGS -std=c++11" \
  63. ./configure \
  64. --with-wx-config=/usr/lib$LIBDIRSUFFIX/wx/config/gtk2-unicode-release-2.8 \
  65. --prefix=/usr \
  66. --libdir=/usr/lib${LIBDIRSUFFIX} \
  67. --sysconfdir=/etc \
  68. --localstatedir=/var \
  69. --docdir=/usr/doc/$PRGNAM-$VERSION \
  70. --htmldir=/usr/doc/$PRGNAM-$VERSION/html \
  71. --mandir=/usr/man \
  72. --build=$ARCH-slackware-linux
  73. make
  74. make install DESTDIR=$PKG
  75. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  76. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  77. # Copy icon & desktop file to package
  78. mkdir -p $PKG/usr/share/{applications,pixmaps}
  79. cat $CWD/xpe.desktop > $PKG/usr/share/applications/xpe.desktop
  80. cat $CWD/xpe.png > $PKG/usr/share/pixmaps/xpe.png
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. cp -a AUTHORS COPYING TODO $PKG/usr/doc/$PRGNAM-$VERSION
  83. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  84. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
  85. mkdir -p $PKG/install
  86. cat $CWD/slack-desc > $PKG/install/slack-desc
  87. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  88. cd $PKG
  89. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE