wok-current view shell-detector/receipt @ rev 24497

Add some current_version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 19 14:19:02 2022 +0000 (2022-02-19)
parents 8dd8bab3f0ca
children
line source
1 # SliTaz package receipt.
3 PACKAGE="shell-detector"
4 VERSION="20140308"
5 CATEGORY="network"
6 SHORT_DESC="Web shell detection tool."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 LICENSE="MIT"
9 WEB_SITE="https://www.emposha.com/security/php-shell-detector-web-shell-detection-tool.html"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 #WGET_URL="https://github.com/emposha/PHP-Shell-Detector/tarball/master"
12 WGET_URL="git|git://github.com/emposha/PHP-Shell-Detector.git"
14 DEPENDS="php"
15 BUILD_DEPENDS="git"
17 # What is the latest version available today?
18 current_version()
19 {
20 wget -O - https://github.com/emposha/PHP-Shell-Detector/commits/master 2>/dev/null | \
21 sed '/Commits on/!d;s|.*on |"|;s|<.*|"|;q' | xargs date +%Y%m%d -d
22 }
24 # Rules to configure and make the package.
25 compile_rules()
26 {
27 cd $src
28 }
30 # Rules to gen a SliTaz package suitable for Tazpkg.
31 genpkg_rules()
32 {
33 mkdir -p $fs/usr/share/$PACKAGE
34 cp -a $src/* $fs/usr/share/$PACKAGE
35 ln -s shelldetect.php $fs/usr/share/$PACKAGE/index.php
36 chown -R www.www $fs/usr/share/$PACKAGE
37 }
39 post_install()
40 {
41 # Configure lighttpd server
42 if [ -f "$1/etc/lighttpd/lighttpd.conf" ]; then
43 if ! grep -q /usr/share/phpsysinfo/ "$1/etc/lighttpd/lighttpd.conf"; then
44 sed -e "s|.*\"/examples/\" => \"/usr/share/examples/\",| \"/examples/\" => \"/usr/share/examples/\",\\n \"/$PACKAGE/\" => \"/usr/share/$PACKAGE/\",|g" -i "$1/etc/lighttpd/lighttpd.conf"
45 if [ -z "$1" ]; then
46 # Start Web server.
47 /etc/init.d/lighttpd stop
48 /etc/init.d/lighttpd start
49 fi
50 fi
51 fi
52 # Configure apache server
53 if [ -f "$1/etc/apache/httpd.conf" ]; then
54 if [ ! -f "$1/etc/apache/conf.d/$PACKAGE" ]; then
55 cat > "$1/etc/apache/conf.d/$PACKAGE" <<EOT
56 <IfModule mod_alias.c>
57 Alias /$PACKAGE /usr/share/$PACKAGE
58 </IfModule>
59 <DirectoryMatch /usr/share/$PACKAGE/>
60 DirectoryIndex index.php
61 Options +FollowSymLinks
62 AllowOverride None
63 Order allow,deny
64 Allow from all
65 </DirectoryMatch>
66 EOT
67 if [ -z "$1" ]; then
68 # Start Web server.
69 /etc/init.d/apache stop
70 /etc/init.d/apache start
71 fi
72 fi
73 fi
74 }