wok annotate tazwikiss/receipt @ rev 25073
Up dropbear (2022.82)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jun 11 11:22:52 2022 +0000 (2022-06-11) |
parents | 02c70d036ea0 |
children |
rev | line source |
---|---|
pascal@5859 | 1 # SliTaz package receipt. |
pascal@5859 | 2 |
pascal@5859 | 3 PACKAGE="tazwikiss" |
pascal@19414 | 4 VERSION="258" |
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" |
slaxemulator@8851 | 9 SOURCE="slitaz-dev-tools" |
pankso@10475 | 10 TARBALL="$SOURCE-$VERSION.tar.bz2" |
slaxemulator@10728 | 11 WGET_URL="http://hg.slitaz.org/slitaz-dev-tools/archive/$VERSION.tar.bz2" |
pascal@5859 | 12 WEB_SITE="http://www.slitaz.org/" |
al@18599 | 13 CONFIG_FILES="/var/www/wiki/config.sh /var/www/wiki/config-de.sh \ |
al@18599 | 14 /var/www/wiki/config-fr.sh" |
pascal@16264 | 15 HOST_ARCH="any" |
pascal@5859 | 16 |
pascal@24069 | 17 current_version() |
pascal@24069 | 18 { |
pascal@24069 | 19 wget -O - http://hg.slitaz.org/slitaz-dev-tools/ 2>/dev/null | \ |
pascal@24069 | 20 sed '/^Changeset/!d;s|.*">|http://hg.slitaz.org/slitaz-dev-tools/rev/|;s|<.*||' | \ |
pascal@24069 | 21 xargs wget -O - 2>/dev/null | sed '/rev /!d;s|.*rev ||;s| .*||' |
pascal@24069 | 22 } |
pascal@24069 | 23 |
pascal@10471 | 24 # Rules to configure and make the package. |
pascal@10471 | 25 compile_rules() |
pascal@10471 | 26 { |
al@18964 | 27 mkdir -p $DESTDIR 2>/dev/null |
pascal@10471 | 28 cp -a $src/$PACKAGE/rootfs/* $DESTDIR |
pascal@10471 | 29 } |
pascal@10471 | 30 |
pascal@5859 | 31 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@5859 | 32 genpkg_rules() |
pascal@5859 | 33 { |
pascal@15603 | 34 cp -a $install/* $fs |
pascal@5859 | 35 chown -R 80.80 $fs/var/www |
pascal@5859 | 36 } |
pascal@5859 | 37 |
pascal@5859 | 38 # Pre and post install commands for Tazpkg. |
pascal@5859 | 39 post_install() |
pascal@5859 | 40 { |
pascal@5859 | 41 server=busybox |
pascal@5859 | 42 # Configure lighttpd server |
pascal@18730 | 43 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then |
pascal@5859 | 44 server=lighttpd |
pascal@18730 | 45 if ! grep -q '"/wiki/"' "$1/etc/lighttpd/lighttpd.conf"; then |
pascal@5859 | 46 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\ |
pascal@5859 | 47 cgi.assign = (\ |
pascal@5859 | 48 ".sh" => "/bin/sh"\ |
pascal@5859 | 49 )\ |
pascal@5859 | 50 index-file.names = ( "index.sh" )\ |
pascal@18730 | 51 }\n\n&|' -i "$1/etc/lighttpd/lighttpd.conf" |
pascal@5859 | 52 if [ -z "$1" ]; then |
pascal@5859 | 53 # Start Web server. |
pascal@5859 | 54 /etc/init.d/lighttpd stop |
pascal@5859 | 55 /etc/init.d/lighttpd start |
pascal@5859 | 56 fi |
pascal@5859 | 57 fi |
pascal@5859 | 58 fi |
pascal@5859 | 59 # Configure apache server |
pascal@18730 | 60 if [ -f "$1/etc/apache/httpd.conf" ]; then |
pascal@5859 | 61 server=apache |
pascal@18730 | 62 if [ ! -f "$1/etc/apache/conf.d/tazwikiss" ]; then |
pascal@18730 | 63 cat > "$1/etc/apache/conf.d/tazwikiss" <<EOT |
pascal@5859 | 64 <DirectoryMatch /var/www/wiki/> |
pascal@5859 | 65 Options +ExecCGI |
pascal@5859 | 66 AddHandler cgi-script .sh |
pascal@5859 | 67 DirectoryIndex index.sh |
pascal@5859 | 68 AllowOverride None |
pascal@5859 | 69 Order allow,deny |
pascal@5859 | 70 Allow from all |
pascal@5859 | 71 </DirectoryMatch> |
pascal@5859 | 72 EOT |
pascal@5859 | 73 if [ -z "$1" ]; then |
al@18640 | 74 echo |
pascal@5859 | 75 # Start Web server. |
pascal@5859 | 76 /etc/init.d/apache stop |
pascal@5859 | 77 /etc/init.d/apache start |
pascal@5859 | 78 fi |
pascal@5859 | 79 fi |
pascal@5859 | 80 fi |
pascal@5859 | 81 # Configure busybox/httpd server by default |
pascal@20892 | 82 if [ "$server" = "busybox" ]; then |
pascal@18730 | 83 sed -i 's/lighttpd/httpd/' "$1/etc/rcS.conf" |
pascal@18730 | 84 if [ ! -s "$1/etc/httpd.conf" ]; then |
pascal@18730 | 85 cat > "$1/etc/httpd.conf" <<EOT |
pascal@5859 | 86 H:/var/www |
pascal@5859 | 87 A:0.0.0.0/0 |
pascal@9514 | 88 .xml:text/xml |
pascal@9514 | 89 .tgz:application/x-tgz |
pascal@9514 | 90 .tar.gz:application/x-tgz |
pascal@9514 | 91 .tazpkg:application/x-tazpkg |
pascal@5859 | 92 EOT |
pascal@5859 | 93 fi |
pascal@5859 | 94 while read line; do |
pascal@18730 | 95 grep -q "$line" "$1/etc/httpd.conf" && continue |
pascal@18730 | 96 echo "$line" >> "$1/etc/httpd.conf" |
pascal@5859 | 97 done <<EOT |
pascal@5859 | 98 *.sh:/bin/sh |
pascal@5859 | 99 EOT |
pascal@18730 | 100 grep -q ' httpd ' "$1/etc/rcS.conf" || |
pascal@18730 | 101 sed -i 's/ slim"/ httpd slim"/' "$1/etc/rcS.conf" |
pascal@5859 | 102 if [ -z "$1" ]; then |
al@18964 | 103 echo |
pascal@5859 | 104 # Start Web server. |
pascal@5859 | 105 /etc/init.d/httpd stop |
pascal@5859 | 106 /etc/init.d/httpd start |
pascal@5859 | 107 fi |
pascal@5859 | 108 fi |
pascal@5859 | 109 while read line; do |
pascal@18730 | 110 [ -x "$1/$line" ] && continue |
al@18964 | 111 echo "WARNING: $line not found, $PACKAGE will not work!" |
pascal@5859 | 112 done <<EOT |
pascal@5859 | 113 /usr/sbin/httpd |
mojo@17273 | 114 /usr/lib/slitaz/httphelper.sh |
pascal@5859 | 115 EOT |
pascal@5859 | 116 echo "The default password to edit pages is 'test'" |
al@18640 | 117 echo |
pascal@5859 | 118 } |