psad-2.2.5.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. #PERL_EXPORT_PHASE_FUNCTIONS=no
  5. inherit eutils perl-module toolchain-funcs
  6. DESCRIPTION="Port Scanning Attack Detection daemon"
  7. SRC_URI="http://www.cipherdyne.org/psad/download/${P}.tar.bz2"
  8. HOMEPAGE="http://www.cipherdyne.org/psad"
  9. SLOT="0"
  10. LICENSE="GPL-2"
  11. KEYWORDS="alpha amd64 ppc ~sparc x86"
  12. DEPEND="virtual/perl-ExtUtils-MakeMaker"
  13. RDEPEND="
  14. dev-perl/Bit-Vector
  15. dev-perl/Date-Calc
  16. dev-perl/NetAddr-IP
  17. dev-perl/Unix-Syslog
  18. net-firewall/iptables
  19. net-misc/whois
  20. virtual/logger
  21. virtual/mailx
  22. virtual/perl-Storable
  23. "
  24. src_prepare() {
  25. epatch "${FILESDIR}"/${PN}-2.2.4-var-run.patch
  26. sed -i \
  27. -e 's|/usr/bin/gcc|$(CC)|g' \
  28. -e 's|-O|$(CFLAGS) $(LDFLAGS)|g' \
  29. Makefile || die
  30. # Fix up default paths
  31. sed -i \
  32. -e "s:/usr/bin/whois_psad:/usr/bin/whois:g" \
  33. psad.conf || die
  34. }
  35. src_configure() {
  36. default
  37. local deps_subdir
  38. for deps_subdir in IPTables-Parse IPTables-ChainMgr; do
  39. cd "${S}"/deps/${deps_subdir} || die
  40. SRC_PREP="no" perl-module_src_configure
  41. done
  42. }
  43. src_compile() {
  44. tc-export CC
  45. default
  46. local deps_subdir
  47. for deps_subdir in IPTables-Parse IPTables-ChainMgr; do
  48. cd "${S}"/deps/${deps_subdir} || die
  49. perl-module_src_compile
  50. done
  51. }
  52. src_install() {
  53. newbin pscan psad-pscan
  54. insinto /usr
  55. dosbin kmsgsd psad psadwatchd
  56. newsbin fwcheck_psad.pl fwcheck_psad
  57. insinto /etc/psad
  58. doins \
  59. *.conf auto_dl icmp{,6}_types ip_options psad_* pf.os posf \
  60. protocols signatures
  61. newinitd init-scripts/psad-init.gentoo psad
  62. doman *.8
  63. dodoc BENCHMARK CREDITS Change* FW_EXAMPLE_RULES README SCAN_LOG
  64. insinto /etc/psad/snort_rules
  65. doins deps/snort_rules/*
  66. local deps_subdir
  67. for deps_subdir in IPTables-Parse IPTables-ChainMgr; do
  68. cd "${S}"/deps/${deps_subdir} || die
  69. perl-module_src_install
  70. done
  71. }