wok annotate zerobin/receipt @ rev 12906

move zerobin from undigest
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 29 17:26:27 2012 +0200 (2012-05-29)
parents
children 2eb82e8dc17d
rev   line source
pascal@12906 1 # SliTaz package receipt.
pascal@12906 2
pascal@12906 3 PACKAGE="zerobin"
pascal@12906 4 VERSION="0.15_alpha"
pascal@12906 5 CATEGORY="network"
pascal@12906 6 SHORT_DESC="Online pastebin where the server has zero knowledge of pasted data."
pascal@12906 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@12906 8 TARBALL="${PACKAGE}_$VERSION.zip"
pascal@12906 9 WEB_SITE="http://sebsauvage.net/wiki/doku.php?id=php:zerobin"
pascal@12906 10 WGET_URL="http://sebsauvage.net/files/$TARBALL"
pascal@12906 11
pascal@12906 12 DEPENDS="php"
pascal@12906 13 SUGGESTED="php-gd"
pascal@12906 14
pascal@12906 15 # Rules to configure and make the package.
pascal@12906 16 compile_rules()
pascal@12906 17 {
pascal@12906 18 cd $src
pascal@12906 19 patch -p0 < $stuff/zerobin.u
pascal@12906 20 dos2unix *.txt *.php tpl/*.html lib/*.js lib/*.php lib/*.css
pascal@12906 21 }
pascal@12906 22
pascal@12906 23 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@12906 24 genpkg_rules()
pascal@12906 25 {
pascal@12906 26 mkdir -p $fs/usr/share/zerobin
pascal@12906 27 cp -a $src/* $fs/usr/share/zerobin
pascal@12906 28 chown -R www.www $fs/usr/share/zerobin
pascal@12906 29 }
pascal@12906 30
pascal@12906 31 # Post and pre install commands
pascal@12906 32 post_install()
pascal@12906 33 {
pascal@12906 34 # Configure lighttpd server
pascal@12906 35 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
pascal@12906 36 if ! grep -q /usr/share/zerobin/ $1/etc/lighttpd/lighttpd.conf; then
pascal@12906 37 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/paste/" => "/usr/share/zerobin/",|g' -i $1/etc/lighttpd/lighttpd.conf
pascal@12906 38 if [ -z "$1" ]; then
pascal@12906 39 # Start Web server.
pascal@12906 40 /etc/init.d/lighttpd stop
pascal@12906 41 /etc/init.d/lighttpd start
pascal@12906 42 fi
pascal@12906 43 fi
pascal@12906 44 fi
pascal@12906 45 # Configure apache server
pascal@12906 46 if [ -f $1/etc/apache/httpd.conf ]; then
pascal@12906 47 sed -i 's/lighttpd/apache/' $1/etc/rcS.conf
pascal@12906 48 if [ ! -f $1/etc/apache/conf.d/zerobin ]; then
pascal@12906 49 cat > $1/etc/apache/conf.d/zerobin <<EOT
pascal@12906 50 <IfModule mod_alias.c>
pascal@12906 51 Alias /paste /usr/share/zerobin/
pascal@12906 52 </IfModule>
pascal@12906 53 <DirectoryMatch /usr/share/zerobin/>
pascal@12906 54 php_value upload_max_filesize 2147483647
pascal@12906 55 DirectoryIndex index.php
pascal@12906 56 AllowOverride None
pascal@12906 57 Order allow,deny
pascal@12906 58 Allow from all
pascal@12906 59 </DirectoryMatch>
pascal@12906 60 EOT
pascal@12906 61 if [ -z "$1" ]; then
pascal@12906 62 # Start Web server.
pascal@12906 63 /etc/init.d/apache restart
pascal@12906 64 fi
pascal@12906 65 fi
pascal@12906 66 fi
pascal@12906 67 }