wok annotate shell-detector/receipt @ rev 25361

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