wok-current view zerobin/receipt @ rev 24416
thunar: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Feb 10 19:39:21 2022 +0000 (2022-02-10) |
parents | a78610b2eb47 |
children |
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="https://sebsauvage.net/wiki/doku.php?id=php:zerobin"
12 WGET_URL="https://github.com/sebsauvage/ZeroBin/archive/$VERSION.tar.gz"
13 HOST_ARCH="any"
15 DEPENDS="php"
16 SUGGESTED="php-gd"
18 # What is the latest version available today?
19 current_version()
20 {
21 wget -O - https://github.com/sebsauvage/ZeroBin/tags 2>/dev/null | \
22 sed '/archive.*tar/!d;s|.*/v*\(.*\).tar.*|\1|;q'
23 }
25 # Rules to configure and make the package.
26 compile_rules()
27 {
28 patch -p0 < $stuff/zerobin.u
29 }
31 # Rules to gen a SliTaz package suitable for Tazpkg.
32 genpkg_rules()
33 {
34 mkdir -p $fs/usr/share/zerobin
35 mkdir -p $fs/var/lib/zerobin/data $fs/var/lib/zerobin/tmp
36 cp -a $src/* $fs/usr/share/zerobin
37 cp $stuff/purge.sh $fs/var/lib/zerobin/data
38 ln -s /var/lib/zerobin/data $fs/usr/share/zerobin/data
39 ln -s /var/lib/zerobin/tmp $fs/usr/share/zerobin/tmp
40 chown -R www.www $fs/usr/share/zerobin $fs/var/lib/zerobin/*
41 }
43 # Post and pre install commands
44 post_install()
45 {
46 # Configure lighttpd server
47 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
48 if ! grep -q /usr/share/zerobin/ "$1/etc/lighttpd/lighttpd.conf"; then
49 sed -e 's|.*"/examples/" => "/usr/share/examples/",| "/examples/" => "/usr/share/examples/",\n "/paste/" => "/usr/share/zerobin/",|g' -i "$1/etc/lighttpd/lighttpd.conf"
50 if [ -z "$1" ]; then
51 # Start Web server.
52 /etc/init.d/lighttpd stop
53 /etc/init.d/lighttpd start
54 fi
55 fi
56 fi
57 # Configure apache server
58 if [ -f "$1/etc/apache/httpd.conf" ]; then
59 sed -i 's/lighttpd/apache/' "$1/etc/rcS.conf"
60 if [ ! -f "$1/etc/apache/conf.d/zerobin" ]; then
61 cat > "$1/etc/apache/conf.d/zerobin" <<EOT
62 <IfModule mod_alias.c>
63 Alias /paste /usr/share/zerobin/
64 </IfModule>
65 <DirectoryMatch /usr/share/zerobin/>
66 php_value upload_max_filesize 2147483647
67 DirectoryIndex index.php
68 AllowOverride None
69 Order allow,deny
70 Allow from all
71 </DirectoryMatch>
72 EOT
73 if [ -z "$1" ]; then
74 # Start Web server.
75 /etc/init.d/apache restart
76 fi
77 fi
78 fi
79 }