Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
3.0 KiB

  1. #!/bin/bash
  2. # Build script for Slackware
  3. # Copyright (C) 2017,2019,2020 Damien Goutte-Gattat
  4. #
  5. # Redistribution and use of this script, with or without modifications,
  6. # is permitted provided that the following conditions are met:
  7. #
  8. # 1. Redistributions of this script must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. #
  11. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
  12. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  13. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  14. # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  15. # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  16. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  17. # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  18. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  19. # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  20. # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  21. # POSSIBILITY OF SUCH DAMAGE.
  22. #
  23. # Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
  24. #
  25. # Latest django-pipeline sourcecode is available at:
  26. # <https://github.com/jazzband/django-pipeline>.
  27. #
  28. # Depends: d/Django
  29. #
  30. # Note: OMERO.web requires version 1.6.14 exactly.
  31. # Source package infos
  32. NAMESRC=${NAMESRC:-django-pipeline}
  33. VERSION=${VERSION:-1.6.14}
  34. ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
  35. # Build infos
  36. NAMEPKG=${NAMEPKG:-django-pipeline}
  37. BUILD=${BUILD:-1GGD}
  38. ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
  39. JOBS=${JOBS:-1}
  40. EXT=${EXT:-txz}
  41. # Directories
  42. TMP=${TMP:-/tmp}
  43. OUT=${OUT:-$TMP/build}
  44. PKG=${PKG:-$OUT/$NAMEPKG}
  45. CWD=$(pwd)
  46. set -e # Quit if a command returns non-zero
  47. # Sanity checks
  48. if [ $UID -eq 0 ]; then
  49. echo "You should NOT run this script as ROOT!"
  50. exit 1
  51. fi
  52. if [ ! -d $TMP ]; then
  53. echo "$TMP does not exists or is not a directory!"
  54. exit 1
  55. fi
  56. # Get and verify the source archive
  57. if [ ! -r $ARCHIVE ]; then
  58. pip3 download --no-binary :all: --no-deps $NAMESRC==$VERSION
  59. fi
  60. sha256sum -c $ARCHIVE.sha256
  61. NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
  62. # Compile
  63. cd $TMP
  64. echo "Building $ARCHIVE..."
  65. tar xf $CWD/$ARCHIVE
  66. cd $NAME
  67. python3 setup.py build
  68. python3 setup.py install --root=$PKG
  69. # Install the documentation
  70. mkdir -p $PKG/usr/doc/$NAME
  71. install -m 644 AUTHORS HISTORY.rst LICENSE README.rst $PKG/usr/doc/$NAME
  72. # Build HTML docs if Sphinx is available
  73. if sphinx-build -b html docs $PKG/usr/doc/$NAME/html ; then
  74. rm -rf $PKG/usr/doc/$NAME/html/.{buildinfo,doctrees}
  75. fi
  76. # Copy slack-desc file
  77. install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
  78. # Add dependency infos
  79. cat <<EOF > $PKG/install/slack-required
  80. Django
  81. EOF
  82. # Package the tree
  83. cd $PKG
  84. mkdir -p $OUT
  85. PACKAGING="
  86. chown root:root . -R
  87. /sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
  88. rm -rf $PKG
  89. rm -rf $TMP/$NAME
  90. "
  91. if type -p fakeroot ; then
  92. echo "$PACKAGING" | fakeroot
  93. else
  94. su -c "$PACKAGING"
  95. fi