psad-2.4.4.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. #PERL_EXPORT_PHASE_FUNCTIONS=no
  5. inherit 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. PATCHES=(
  25. "${FILESDIR}"/${PN}-2.2.4-var-run.patch
  26. )
  27. src_prepare() {
  28. default
  29. sed -i \
  30. -e 's|/usr/bin/gcc|$(CC)|g' \
  31. -e 's|-O|$(CFLAGS) $(LDFLAGS)|g' \
  32. Makefile || die
  33. # Fix up default paths
  34. sed -i \
  35. -e "s:/usr/bin/whois_psad:/usr/bin/whois:g" \
  36. psad.conf || die
  37. }
  38. src_configure() {
  39. default
  40. local deps_subdir
  41. for deps_subdir in IPTables-Parse IPTables-ChainMgr; do
  42. cd "${S}"/deps/${deps_subdir} || die
  43. SRC_PREP="no" perl-module_src_configure
  44. done
  45. }
  46. src_compile() {
  47. tc-export CC
  48. default
  49. local deps_subdir
  50. for deps_subdir in IPTables-Parse IPTables-ChainMgr; do
  51. cd "${S}"/deps/${deps_subdir} || die
  52. perl-module_src_compile
  53. done
  54. }
  55. src_install() {
  56. newbin pscan psad-pscan
  57. insinto /usr
  58. dosbin kmsgsd psad psadwatchd
  59. newsbin fwcheck_psad.pl fwcheck_psad
  60. insinto /etc/psad
  61. doins \
  62. *.conf auto_dl icmp{,6}_types ip_options psad_* pf.os posf \
  63. protocols signatures
  64. newinitd init-scripts/psad-init.gentoo psad
  65. doman *.8
  66. dodoc BENCHMARK CREDITS Change* FW_EXAMPLE_RULES FW_HELP README \
  67. README.SYSLOG SCAN_LOG
  68. insinto /etc/psad/snort_rules
  69. doins deps/snort_rules/*
  70. local deps_subdir
  71. for deps_subdir in IPTables-Parse IPTables-ChainMgr; do
  72. cd "${S}"/deps/${deps_subdir} || die
  73. perl-module_src_install
  74. done
  75. }