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