dokuwiki.SlackBuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. # Slackware build script for dokuwiki
  3. # Copyright 2016 Giorgio Peron <giorgio.peron@gmail.com>, Belluno, Italy
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. PRGNAM=${PRGNAM:-dokuwiki}
  23. VERSION=${VERSION:-20180422a}
  24. UNPACK=${UNPACK:-stable}
  25. SRCVERSION=${SRCVERSION:-2018-04-22a}
  26. BUILD=${BUILD:-1}
  27. TAG=${TAG:-_SBo}
  28. ARCH=noarch
  29. CWD=$(pwd)
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. set -e
  34. mv ${PRGNAM}-${UNPACK}.tgz ${PRGNAM}-${SRCVERSION}.tgz
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG $OUTPUT
  37. cd $TMP
  38. rm -rf $PRGNAM-$SRCVERSION
  39. tar xvzf $CWD/$PRGNAM-$SRCVERSION.tgz
  40. mkdir -p $PKG/var/www/$PRGNAM
  41. mv $TMP/$PRGNAM-$SRCVERSION/* $PKG/var/www/$PRGNAM/
  42. chown -R apache:apache $PKG/var/www/$PRGNAM/
  43. mkdir -p $PKG/etc/httpd/extra
  44. cat > $PKG/etc/httpd/extra/httpd-dokuwiki.conf <<'EOF'
  45. Alias /dokuwiki /var/www/htdocs/dokuwiki
  46. <Directory /var/www/htdocs/dokuwiki/>
  47. DirectoryIndex index.php
  48. Options +FollowSymLinks
  49. AllowOverride All
  50. Require all granted
  51. php_admin_value open_basedir "/var/www/:/var/www/htdocs/dokuwiki/lib/"
  52. </Directory>
  53. <LocationMatch "/var/www/htdocs/dokuwiki/(data|conf|bin|inc)/">
  54. order allow,deny
  55. deny from all
  56. satisfy all
  57. </LocationMatch>
  58. EOF
  59. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  60. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  61. mkdir -p $PKG/install
  62. cat $CWD/slack-desc > $PKG/install/slack-desc
  63. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  64. cd $PKG
  65. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}