wok-undigest view zerobin/receipt @ rev 684

zerobin: shared keys support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Apr 13 09:36:37 2012 +0200 (2012-04-13)
parents 7005e0e1bf22
children 7a644e6e7b18
line source
1 # SliTaz package receipt.
3 PACKAGE="zerobin"
4 VERSION="0.11_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"
14 # Rules to configure and make the package.
15 compile_rules()
16 {
17 cd $src
18 patch -p0 < $stuff/zerobin.u
19 }
21 # Rules to gen a SliTaz package suitable for Tazpkg.
22 genpkg_rules()
23 {
24 mkdir -p $fs/usr/share/zerobin
25 cp -a $src/* $fs/usr/share/zerobin
26 chown -R www.www $fs/usr/share/zerobin
27 }
29 # Post and pre install commands
30 post_install()
31 {
32 # Configure lighttpd server
33 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then
34 if ! grep -q /usr/share/zerobin/ $1/etc/lighttpd/lighttpd.conf; then
35 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/paste/" => "/usr/share/zerobin/",|g' -i $1/etc/lighttpd/lighttpd.conf
36 if [ -z "$1" ]; then
37 # Start Web server.
38 /etc/init.d/lighttpd stop
39 /etc/init.d/lighttpd start
40 fi
41 fi
42 fi
43 # Configure apache server
44 if [ -f $1/etc/apache/httpd.conf ]; then
45 sed -i 's/lighttpd/apache/' $1/etc/rcS.conf
46 if [ ! -f $1/etc/apache/conf.d/zerobin ]; then
47 cat > $1/etc/apache/conf.d/zerobin <<EOT
48 <IfModule mod_alias.c>
49 Alias /paste /usr/share/zerobin/
50 </IfModule>
51 <DirectoryMatch /usr/share/zerobin/>
52 php_value upload_max_filesize 2147483647
53 DirectoryIndex index.php
54 AllowOverride None
55 Order allow,deny
56 Allow from all
57 </DirectoryMatch>
58 EOT
59 if [ -z "$1" ]; then
60 # Start Web server.
61 /etc/init.d/apache restart
62 fi
63 fi
64 fi
65 }