wok-next annotate tazwikiss/receipt @ rev 19972
Up copyq (3.1.1), qedit (2.8.1)
author | Xander Ziiryanoff <psychomaniak@xakep.ru> |
---|---|
date | Tue Oct 17 19:29:54 2017 +0200 (2017-10-17) |
parents | 7ae7ca392d9e |
children | c4e53a39395a |
rev | line source |
---|---|
pascal@5859 | 1 # SliTaz package receipt. |
pascal@5859 | 2 |
pascal@5859 | 3 PACKAGE="tazwikiss" |
al@19866 | 4 VERSION="306" |
pascal@5859 | 5 CATEGORY="office" |
pascal@5859 | 6 SHORT_DESC="Tiny SliTaz Wiki" |
pascal@5859 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@15363 | 8 LICENSE="BSD" |
pascal@5859 | 9 WEB_SITE="http://www.slitaz.org/" |
al@18599 | 10 CONFIG_FILES="/var/www/wiki/config.sh /var/www/wiki/config-de.sh \ |
al@18599 | 11 /var/www/wiki/config-fr.sh" |
pascal@16264 | 12 HOST_ARCH="any" |
pascal@5859 | 13 |
al@19588 | 14 TARBALL="slitaz-dev-tools-$VERSION.tar.bz2" |
al@19588 | 15 WGET_URL="http://hg.slitaz.org/slitaz-dev-tools/archive/$VERSION.tar.bz2" |
al@19588 | 16 |
al@19588 | 17 DEPENDS="busybox slitaz-base-files" |
al@19588 | 18 SIBLINGS="mirror-tools qemu-box slitaz-dev-tools slitaz-mercurial-style \ |
al@19588 | 19 tazchroot tazdev yaff" |
al@19588 | 20 |
pascal@10471 | 21 # Rules to configure and make the package. |
pascal@10471 | 22 compile_rules() |
pascal@10471 | 23 { |
al@18964 | 24 mkdir -p $DESTDIR 2>/dev/null |
pascal@10471 | 25 cp -a $src/$PACKAGE/rootfs/* $DESTDIR |
pascal@10471 | 26 } |
pascal@10471 | 27 |
pascal@5859 | 28 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@5859 | 29 genpkg_rules() |
pascal@5859 | 30 { |
pascal@15603 | 31 cp -a $install/* $fs |
pascal@5859 | 32 chown -R 80.80 $fs/var/www |
pascal@5859 | 33 } |
pascal@5859 | 34 |
pascal@5859 | 35 # Pre and post install commands for Tazpkg. |
pascal@5859 | 36 post_install() |
pascal@5859 | 37 { |
pascal@5859 | 38 server=busybox |
pascal@5859 | 39 # Configure lighttpd server |
pascal@18730 | 40 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then |
pascal@5859 | 41 server=lighttpd |
pascal@18730 | 42 if ! grep -q '"/wiki/"' "$1/etc/lighttpd/lighttpd.conf"; then |
pascal@5859 | 43 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\ |
pascal@5859 | 44 cgi.assign = (\ |
pascal@5859 | 45 ".sh" => "/bin/sh"\ |
pascal@5859 | 46 )\ |
pascal@5859 | 47 index-file.names = ( "index.sh" )\ |
al@19850 | 48 }\n\n&|' -i "$1/etc/lighttpd/lighttpd.conf" |
pascal@5859 | 49 if [ -z "$1" ]; then |
pascal@5859 | 50 # Start Web server. |
pascal@5859 | 51 /etc/init.d/lighttpd stop |
pascal@5859 | 52 /etc/init.d/lighttpd start |
pascal@5859 | 53 fi |
pascal@5859 | 54 fi |
pascal@5859 | 55 fi |
pascal@5859 | 56 # Configure apache server |
pascal@18730 | 57 if [ -f "$1/etc/apache/httpd.conf" ]; then |
pascal@5859 | 58 server=apache |
pascal@18730 | 59 if [ ! -f "$1/etc/apache/conf.d/tazwikiss" ]; then |
pascal@18730 | 60 cat > "$1/etc/apache/conf.d/tazwikiss" <<EOT |
pascal@5859 | 61 <DirectoryMatch /var/www/wiki/> |
pascal@5859 | 62 Options +ExecCGI |
pascal@5859 | 63 AddHandler cgi-script .sh |
pascal@5859 | 64 DirectoryIndex index.sh |
pascal@5859 | 65 AllowOverride None |
pascal@5859 | 66 Order allow,deny |
pascal@5859 | 67 Allow from all |
pascal@5859 | 68 </DirectoryMatch> |
pascal@5859 | 69 EOT |
pascal@5859 | 70 if [ -z "$1" ]; then |
al@18640 | 71 echo |
pascal@5859 | 72 # Start Web server. |
pascal@5859 | 73 /etc/init.d/apache stop |
pascal@5859 | 74 /etc/init.d/apache start |
pascal@5859 | 75 fi |
pascal@5859 | 76 fi |
pascal@5859 | 77 fi |
pascal@5859 | 78 # Configure busybox/httpd server by default |
pascal@5859 | 79 if [ "$server" == "busybox" ]; then |
pascal@18730 | 80 sed -i 's/lighttpd/httpd/' "$1/etc/rcS.conf" |
pascal@18730 | 81 if [ ! -s "$1/etc/httpd.conf" ]; then |
pascal@18730 | 82 cat > "$1/etc/httpd.conf" <<EOT |
pascal@5859 | 83 H:/var/www |
pascal@5859 | 84 A:0.0.0.0/0 |
pascal@9514 | 85 .xml:text/xml |
pascal@9514 | 86 .tgz:application/x-tgz |
pascal@9514 | 87 .tar.gz:application/x-tgz |
pascal@9514 | 88 .tazpkg:application/x-tazpkg |
pascal@5859 | 89 EOT |
pascal@5859 | 90 fi |
pascal@5859 | 91 while read line; do |
pascal@18730 | 92 grep -q "$line" "$1/etc/httpd.conf" && continue |
pascal@18730 | 93 echo "$line" >> "$1/etc/httpd.conf" |
pascal@5859 | 94 done <<EOT |
pascal@5859 | 95 *.sh:/bin/sh |
pascal@5859 | 96 EOT |
pascal@18730 | 97 grep -q ' httpd ' "$1/etc/rcS.conf" || |
pascal@18730 | 98 sed -i 's/ slim"/ httpd slim"/' "$1/etc/rcS.conf" |
pascal@5859 | 99 if [ -z "$1" ]; then |
al@18964 | 100 echo |
pascal@5859 | 101 # Start Web server. |
pascal@5859 | 102 /etc/init.d/httpd stop |
pascal@5859 | 103 /etc/init.d/httpd start |
pascal@5859 | 104 fi |
pascal@5859 | 105 fi |
al@19588 | 106 |
al@19858 | 107 [ -n "$quiet" ] && return |
al@19858 | 108 echo -e "The default password to edit pages is 'test'\n" |
pascal@5859 | 109 } |