wok-current annotate shell-detector/receipt @ rev 13248
Up safecopy (1.7)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Aug 14 14:15:38 2012 +0200 (2012-08-14) |
parents | |
children | 3b4e4318134e |
rev | line source |
---|---|
pascal@13243 | 1 # SliTaz package receipt. |
pascal@13243 | 2 |
pascal@13243 | 3 PACKAGE="shell-detector" |
pascal@13243 | 4 VERSION="current" |
pascal@13243 | 5 CATEGORY="network" |
pascal@13243 | 6 SHORT_DESC="Web shell detection tool." |
pascal@13243 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@13243 | 8 WEB_SITE="http://www.emposha.com/security/php-shell-detector-web-shell-detection-tool.html" |
pascal@13243 | 9 TARBALL="$PACKAGE-$VERSION.tar.bz2" |
pascal@13243 | 10 #WGET_URL="https://github.com/emposha/PHP-Shell-Detector/tarball/master" |
pascal@13243 | 11 WGET_URL="git|git://github.com/emposha/PHP-Shell-Detector.git" |
pascal@13243 | 12 |
pascal@13243 | 13 DEPENDS="php" |
pascal@13243 | 14 BUILD_DEPENDS="git" |
pascal@13243 | 15 |
pascal@13243 | 16 # Rules to configure and make the package. |
pascal@13243 | 17 compile_rules() |
pascal@13243 | 18 { |
pascal@13243 | 19 cd $src |
pascal@13243 | 20 } |
pascal@13243 | 21 |
pascal@13243 | 22 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@13243 | 23 genpkg_rules() |
pascal@13243 | 24 { |
pascal@13243 | 25 mkdir -p $fs/usr/share/$PACKAGE |
pascal@13243 | 26 cp -a $src/* $fs/usr/share/$PACKAGE |
pascal@13243 | 27 ln -s shelldetect.php $fs/usr/share/$PACKAGE/index.php |
pascal@13243 | 28 chown -R www.www $fs/usr/share/$PACKAGE |
pascal@13243 | 29 } |
pascal@13243 | 30 |
pascal@13243 | 31 post_install() |
pascal@13243 | 32 { |
pascal@13243 | 33 # Configure lighttpd server |
pascal@13243 | 34 if [ -f $1/etc/lighttpd/lighttpd.conf ]; then |
pascal@13243 | 35 if ! grep -q /usr/share/phpsysinfo/ $1/etc/lighttpd/lighttpd.conf; then |
pascal@13243 | 36 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 | 37 if [ -z "$1" ]; then |
pascal@13243 | 38 # Start Web server. |
pascal@13243 | 39 /etc/init.d/lighttpd stop |
pascal@13243 | 40 /etc/init.d/lighttpd start |
pascal@13243 | 41 fi |
pascal@13243 | 42 fi |
pascal@13243 | 43 fi |
pascal@13243 | 44 # Configure apache server |
pascal@13243 | 45 if [ -f $1/etc/apache/httpd.conf ]; then |
pascal@13243 | 46 if [ ! -f $1/etc/apache/conf.d/$PACKAGE ]; then |
pascal@13243 | 47 cat > $1/etc/apache/conf.d/$PACKAGE <<EOT |
pascal@13243 | 48 <IfModule mod_alias.c> |
pascal@13243 | 49 Alias /$PACKAGE /usr/share/$PACKAGE |
pascal@13243 | 50 </IfModule> |
pascal@13243 | 51 <DirectoryMatch /usr/share/$PACKAGE/> |
pascal@13243 | 52 DirectoryIndex index.php |
pascal@13243 | 53 Options +FollowSymLinks |
pascal@13243 | 54 AllowOverride None |
pascal@13243 | 55 Order allow,deny |
pascal@13243 | 56 Allow from all |
pascal@13243 | 57 </DirectoryMatch> |
pascal@13243 | 58 EOT |
pascal@13243 | 59 if [ -z "$1" ]; then |
pascal@13243 | 60 # Start Web server. |
pascal@13243 | 61 /etc/init.d/apache stop |
pascal@13243 | 62 /etc/init.d/apache start |
pascal@13243 | 63 fi |
pascal@13243 | 64 fi |
pascal@13243 | 65 fi |
pascal@13243 | 66 } |