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