wok annotate fail2ban/receipt @ rev 13206
fail2ban: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 06 14:55:22 2012 +0200 (2012-08-06) |
parents | fb8f84758977 |
children | 19fbe1c329d0 |
rev | line source |
---|---|
pascal@1809 | 1 # SliTaz package receipt. |
pascal@1809 | 2 |
pascal@1809 | 3 PACKAGE="fail2ban" |
slaxemulator@13197 | 4 VERSION="0.8.7.1" |
pascal@1809 | 5 CATEGORY="network" |
pascal@11341 | 6 SHORT_DESC="Scans log files to bans IP that makes too many password failures." |
pascal@1809 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
slaxemulator@13197 | 8 TARBALL="${PACKAGE}_${VERSION}.orig.tar.gz" |
pascal@1809 | 9 WEB_SITE="http://www.fail2ban.org/wiki/index.php/Main_Page" |
slaxemulator@13197 | 10 WGET_URL="https://github.com/downloads/$PACKAGE/$PACKAGE/$TARBALL" |
jozee@4936 | 11 TAGS="monitor network" |
pascal@11341 | 12 CONFIG_FILES="/etc/fail2ban" |
pascal@1809 | 13 |
pascal@13206 | 14 DEPENDS="iptables" |
pascal@13206 | 15 BUILD_DEPENDS="python wget" |
pascal@13206 | 16 |
pascal@1809 | 17 # Rules to configure and make the package. |
pascal@1809 | 18 compile_rules() |
pascal@1809 | 19 { |
pascal@1809 | 20 cd $src |
pascal@11341 | 21 python setup.py install --root=$DESTDIR |
pascal@1809 | 22 } |
pascal@1809 | 23 |
pascal@1809 | 24 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@1809 | 25 genpkg_rules() |
pascal@1809 | 26 { |
slaxemulator@13197 | 27 mkdir -p $fs/etc/logrotate.d $fs/etc/init.d |
slaxemulator@13197 | 28 cp -a $install/* $fs |
slaxemulator@11345 | 29 sed -i -e 's|127.0.0.1|& 192.168.0.0/16|;s|sshd.log|messages|' \ |
pascal@11341 | 30 -e '/ssh-iptables/{nn;s/false/true/}' $fs/etc/fail2ban/jail.conf |
pascal@11341 | 31 cat >> $fs/etc/fail2ban/jail.conf <<EOT |
pascal@11341 | 32 [ssh-ddos] |
pascal@11341 | 33 |
pascal@11341 | 34 enabled = true |
pascal@11341 | 35 port = ssh,sftp |
pascal@11341 | 36 filter = sshd-ddos |
pascal@11341 | 37 action = iptables-allports[name=SSHDDOS] |
pascal@11341 | 38 logpath = /var/log/messages |
pascal@11341 | 39 maxretry = 2 |
pascal@11341 | 40 |
pascal@11341 | 41 EOT |
pascal@11341 | 42 ln -s /usr/bin/fail2ban-client $fs/etc/init.d/fail2ban |
pascal@11341 | 43 cat > $fs/etc/logrotate.d/fail2ban <<EOT |
pascal@11341 | 44 /var/log/fail2ban.log { |
pascal@11341 | 45 weekly |
pascal@11341 | 46 rotate 10 |
pascal@11341 | 47 compress |
pascal@11341 | 48 postrotate |
pascal@11341 | 49 /etc/init.d/fail2ban reload >/dev/null || true |
pascal@11341 | 50 endscript |
pascal@1809 | 51 } |
pascal@11341 | 52 EOT |
pascal@11341 | 53 } |