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