treeviewx.SlackBuild 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #!/bin/bash
  2. # Slackware build script for treeviewx
  3. # Renamed to from "treeview" to "treeviewx" in 2018 to avoid confusion
  4. # with Michael Eisen's TreeView for matrix-like display of expression data.
  5. # Copyright 2011-2021 Petar Petrov slackalaxy@gmail.com
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  15. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  17. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=treeviewx
  26. SRCNAM=tv
  27. SRCVER=0.5
  28. VERSION=${VERSION:-0.5.1_20100723}
  29. SRCDATE=20100823
  30. BUILD=${BUILD:-1}
  31. TAG=${TAG:-_SBo}
  32. PKGTYPE=${PKGTYPE:-tgz}
  33. if [ -z "$ARCH" ]; then
  34. case "$( uname -m )" in
  35. i?86) export ARCH=i586 ;;
  36. arm*) export ARCH=arm ;;
  37. *) export ARCH=$( uname -m ) ;;
  38. esac
  39. fi
  40. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  41. # the name of the created package would be, and then exit. This information
  42. # could be useful to other scripts.
  43. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  44. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  45. exit 0
  46. fi
  47. TMP=${TMP:-/tmp/SBo}
  48. PKG=$TMP/package-$PRGNAM
  49. OUTPUT=${OUTPUT:-/tmp}
  50. if [ "$ARCH" = "i586" ]; then
  51. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "i686" ]; then
  54. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  55. LIBDIRSUFFIX=""
  56. elif [ "$ARCH" = "x86_64" ]; then
  57. SLKCFLAGS="-O2 -fPIC"
  58. LIBDIRSUFFIX="64"
  59. else
  60. SLKCFLAGS="-O2"
  61. LIBDIRSUFFIX=""
  62. fi
  63. set -e
  64. rm -rf $PKG
  65. mkdir -p $TMP $PKG $OUTPUT
  66. cd $TMP
  67. rm -rf $SRCNAM-$SRCVER
  68. tar xvf $CWD/${PRGNAM}_${SRCVER}.1+${SRCDATE}.orig.tar.gz
  69. cd $SRCNAM-$SRCVER
  70. chown -R root:root .
  71. find -L . \
  72. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  73. -o -perm 511 \) -exec chmod 755 {} \; -o \
  74. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  75. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  76. # Disable SVG support. If you want it, you should build
  77. # wxGTK or wxPython including svg from contrib/src/svg
  78. # Then, of course comment the next line.
  79. sed "s:USE_SVG=1:USE_SVG=0:" -i configure
  80. CFLAGS="$SLKCFLAGS" \
  81. CXXFLAGS="$SLKCFLAGS -fpermissive" \
  82. ./configure \
  83. --prefix=/usr \
  84. --libdir=/usr/lib${LIBDIRSUFFIX} \
  85. --sysconfdir=/etc \
  86. --localstatedir=/var \
  87. --mandir=/usr/man \
  88. --build=$ARCH-slackware-linux
  89. make
  90. make install DESTDIR=$PKG
  91. # Let's rename the executable
  92. cd $PKG/usr/bin
  93. mv $SRCNAM $PRGNAM
  94. cd -
  95. # Thanks Debian for the man page
  96. install -D -m644 $CWD/$PRGNAM.1 $PKG/usr/man/man1/$PRGNAM.1
  97. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  98. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  99. find $PKG/usr/man -type f -exec gzip -9 {} \;
  100. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  101. mkdir -p $PKG/usr/share/{applications,pixmaps}
  102. cp $CWD/$PRGNAM.desktop $PKG/usr/share/applications
  103. cp $CWD/$PRGNAM.png $PKG/usr/share/pixmaps
  104. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  105. cp -a COPYING INSTALL $PKG/usr/doc/$PRGNAM-$VERSION
  106. cat $CWD/References > $PKG/usr/doc/$PRGNAM-$VERSION/References
  107. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  108. mkdir -p $PKG/install
  109. cat $CWD/slack-desc > $PKG/install/slack-desc
  110. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  111. cd $PKG
  112. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE