app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / net-misc / knock / knock-0.6.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=4
5
6 DESCRIPTION="A simple port-knocking daemon"
7 HOMEPAGE="http://www.zeroflux.org/projects/knock"
8 SRC_URI="http://www.zeroflux.org/proj/knock/files/${P}.tar.gz"
9
10 LICENSE="GPL-2"
11 SLOT="0"
12 KEYWORDS="amd64 ppc sparc x86"
13 IUSE="+server"
14
15 DEPEND="server? ( net-libs/libpcap )"
16 RDEPEND="${DEPEND}
17         server? ( sys-apps/openrc )"
18
19 src_prepare() {
20         sed -e "/^AM_CFLAGS/s: -g : :" \
21                 -e "/dist_doc_DATA/s:COPYING::" \
22                 -i Makefile.in || die
23         sed -e "s:/usr/sbin/iptables:/sbin/iptables:g" \
24                 -i knockd.conf || die
25 }
26
27 src_configure() {
28         econf $(use_enable server knockd)
29 }
30
31 src_install() {
32         emake DESTDIR="${D}" docdir="${EROOT}/usr/share/doc/${PF}" install
33
34         if use server ; then
35                 newinitd "${FILESDIR}"/knockd.initd.2 knock
36                 newconfd "${FILESDIR}"/knockd.confd.2 knock
37         fi
38 }
39
40 pkg_postinst() {
41         if use server && ! has_version net-firewall/iptables ; then
42                 einfo
43                 elog "You're really encouraged to install net-firewall/iptables to"
44                 elog "actually modify your firewall and use the example configuration."
45                 einfo
46         fi
47 }