wok-next view zerobin/receipt @ rev 20496

Packages with tag "Xfce": fix (b)deps
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Mar 14 17:14:32 2018 +0200 (2018-03-14)
parents 139df21c10dd
children da9e80c5d4bb
line source
1 # SliTaz package receipt.
3 PACKAGE="zerobin"
4 GITHASH="8cae64d6eab99fb0d31868df77846285c0958ed0" # 6 feb 2014
5 VERSION="${GITHASH:0:7}"
6 CATEGORY="network"
7 SHORT_DESC="Online pastebin where the server has zero knowledge of pasted data."
8 MAINTAINER="pascal.bellard@slitaz.org"
9 LICENSE="zlib/libpng"
10 TARBALL="$PACKAGE-$VERSION.tar.gz"
11 WEB_SITE="http://sebsauvage.net/wiki/doku.php?id=php:zerobin"
12 WGET_URL="https://github.com/sebsauvage/ZeroBin/archive/$VERSION.tar.gz"
14 DEPENDS="php"
15 SUGGESTED="php-gd"
17 # Rules to configure and make the package.
18 compile_rules()
19 {
20 patch -p0 < $stuff/zerobin.u
21 }
23 # Rules to gen a SliTaz package suitable for Tazpkg.
24 genpkg_rules()
25 {
26 mkdir -p $fs/usr/share/zerobin
27 mkdir -p $fs/var/lib/zerobin/data $fs/var/lib/zerobin/tmp
28 cp -a $src/* $fs/usr/share/zerobin
29 cp $stuff/purge.sh $fs/var/lib/zerobin/data
30 ln -s /var/lib/zerobin/data $fs/usr/share/zerobin/data
31 ln -s /var/lib/zerobin/tmp $fs/usr/share/zerobin/tmp
32 chown -R www.www $fs/usr/share/zerobin $fs/var/lib/zerobin/*
33 }
35 # Post and pre install commands
36 post_install()
37 {
38 # Configure lighttpd server
39 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
40 if ! grep -q /usr/share/zerobin/ "$1/etc/lighttpd/lighttpd.conf"; then
41 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/paste/" => "/usr/share/zerobin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
42 if [ -z "$1" ]; then
43 # Start Web server.
44 /etc/init.d/lighttpd stop
45 /etc/init.d/lighttpd start
46 fi
47 fi
48 fi
49 # Configure apache server
50 if [ -f "$1/etc/apache/httpd.conf" ]; then
51 sed -i 's/lighttpd/apache/' "$1/etc/rcS.conf"
52 if [ ! -f "$1/etc/apache/conf.d/zerobin" ]; then
53 cat > "$1/etc/apache/conf.d/zerobin" <<EOT
54 <IfModule mod_alias.c>
55 Alias /paste /usr/share/zerobin/
56 </IfModule>
57 <DirectoryMatch /usr/share/zerobin/>
58 php_value upload_max_filesize 2147483647
59 DirectoryIndex index.php
60 AllowOverride None
61 Order allow,deny
62 Allow from all
63 </DirectoryMatch>
64 EOT
65 if [ -z "$1" ]; then
66 # Start Web server.
67 /etc/init.d/apache restart
68 fi
69 fi
70 fi
71 }