wok-current annotate tazwikiss/receipt @ rev 18599
dropbear, slitaz-tools, tazwikiss, wpa_supplicant: touch missing "official" config files
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Nov 16 00:25:42 2015 +0200 (2015-11-16) |
parents | 5e26ab6bd360 |
children | f9743cf20afc |
rev | line source |
---|---|
pascal@5859 | 1 # SliTaz package receipt. |
pascal@5859 | 2 |
pascal@5859 | 3 PACKAGE="tazwikiss" |
al@18545 | 4 VERSION="250" |
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@10471 | 17 # Rules to configure and make the package. |
pascal@10471 | 18 compile_rules() |
pascal@10471 | 19 { |
pascal@10471 | 20 mkdir -p $DESTDIR 2> /dev/null |
pascal@10471 | 21 cp -a $src/$PACKAGE/rootfs/* $DESTDIR |
pascal@10471 | 22 } |
pascal@10471 | 23 |
pascal@5859 | 24 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@5859 | 25 genpkg_rules() |
pascal@5859 | 26 { |
pascal@15603 | 27 cp -a $install/* $fs |
pascal@5859 | 28 chown -R 80.80 $fs/var/www |
pascal@5859 | 29 } |
pascal@5859 | 30 |
pascal@5859 | 31 # Pre and post install commands for Tazpkg. |
pascal@5859 | 32 post_install() |
pascal@5859 | 33 { |
pascal@5859 | 34 server=busybox |
pascal@5859 | 35 # Configure lighttpd server |
pascal@5859 | 36 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
pascal@5859 | 37 server=lighttpd |
pascal@5859 | 38 if ! grep -q '"/wiki/"' $1/etc/lighttpd/lighttpd.conf; then |
pascal@5859 | 39 sed -e 's|# Fast CGI|$HTTP["url"] =~ "/wiki/" {\ |
pascal@5859 | 40 cgi.assign = (\ |
pascal@5859 | 41 ".sh" => "/bin/sh"\ |
pascal@5859 | 42 )\ |
pascal@5859 | 43 index-file.names = ( "index.sh" )\ |
pascal@5859 | 44 }\n\n&|' -i $1/etc/lighttpd/lighttpd.conf |
pascal@5859 | 45 if [ -z "$1" ]; then |
pascal@5859 | 46 # Start Web server. |
pascal@5859 | 47 /etc/init.d/lighttpd stop |
pascal@5859 | 48 /etc/init.d/lighttpd start |
pascal@5859 | 49 fi |
pascal@5859 | 50 fi |
pascal@5859 | 51 fi |
pascal@5859 | 52 # Configure apache server |
pascal@5859 | 53 if [ -f $1/etc/apache/httpd.conf ]; then |
pascal@5859 | 54 server=apache |
pascal@5859 | 55 if [ ! -f $1/etc/apache/conf.d/tazwikiss ]; then |
pascal@5859 | 56 cat > $1/etc/apache/conf.d/tazwikiss <<EOT |
pascal@5859 | 57 <DirectoryMatch /var/www/wiki/> |
pascal@5859 | 58 Options +ExecCGI |
pascal@5859 | 59 AddHandler cgi-script .sh |
pascal@5859 | 60 DirectoryIndex index.sh |
pascal@5859 | 61 AllowOverride None |
pascal@5859 | 62 Order allow,deny |
pascal@5859 | 63 Allow from all |
pascal@5859 | 64 </DirectoryMatch> |
pascal@5859 | 65 EOT |
pascal@5859 | 66 if [ -z "$1" ]; then |
pascal@5859 | 67 # Start Web server. |
pascal@5859 | 68 /etc/init.d/apache stop |
pascal@5859 | 69 /etc/init.d/apache start |
pascal@5859 | 70 fi |
pascal@5859 | 71 fi |
pascal@5859 | 72 fi |
pascal@5859 | 73 # Configure busybox/httpd server by default |
pascal@5859 | 74 if [ "$server" == "busybox" ]; then |
pascal@5859 | 75 sed -i 's/lighttpd/httpd/' $1/etc/rcS.conf |
pascal@5859 | 76 if [ ! -s $1/etc/httpd.conf ]; then |
pascal@5859 | 77 cat > $1/etc/httpd.conf <<EOT |
pascal@5859 | 78 H:/var/www |
pascal@5859 | 79 A:0.0.0.0/0 |
pascal@9514 | 80 .xml:text/xml |
pascal@9514 | 81 .tgz:application/x-tgz |
pascal@9514 | 82 .tar.gz:application/x-tgz |
pascal@9514 | 83 .tazpkg:application/x-tazpkg |
pascal@5859 | 84 EOT |
pascal@5859 | 85 fi |
pascal@5859 | 86 while read line; do |
pascal@7124 | 87 grep -q "$line" $1/etc/httpd.conf && continue |
pascal@5859 | 88 echo "$line" >> $1/etc/httpd.conf |
pascal@5859 | 89 done <<EOT |
pascal@5859 | 90 *.sh:/bin/sh |
pascal@5859 | 91 EOT |
pascal@7124 | 92 grep -q ' httpd ' $1/etc/rcS.conf || |
pascal@7124 | 93 sed -i 's/ slim"/ httpd slim"/' $1/etc/rcS.conf |
pascal@5859 | 94 if [ -z "$1" ]; then |
pascal@5859 | 95 # Start Web server. |
pascal@5859 | 96 /etc/init.d/httpd stop |
pascal@5859 | 97 /etc/init.d/httpd start |
pascal@5859 | 98 fi |
pascal@5859 | 99 fi |
pascal@5859 | 100 while read line; do |
pascal@5859 | 101 [ -x $1/$line ] && continue |
pascal@5859 | 102 echo "WARNING: $line not found, $PACKAGE will not work !" |
pascal@5859 | 103 done <<EOT |
pascal@5859 | 104 /usr/sbin/httpd |
mojo@17273 | 105 /usr/lib/slitaz/httphelper.sh |
pascal@5859 | 106 EOT |
pascal@5859 | 107 echo "The default password to edit pages is 'test'" |
pascal@5859 | 108 } |