Lines 6-18
EAPI=5
Link Here
|
6 |
|
6 |
|
7 |
# Does work with python2_7, does not work with python3_3 on my machine |
7 |
# Does work with python2_7, does not work with python3_3 on my machine |
8 |
# More feedback is welcome, since setup.py does not provide any info |
8 |
# More feedback is welcome, since setup.py does not provide any info |
|
|
9 |
# See also https://github.com/mrash/fwknop/issues/167 |
9 |
PYTHON_COMPAT=( python2_7 ) |
10 |
PYTHON_COMPAT=( python2_7 ) |
10 |
DISTUTILS_OPTIONAL=1 |
11 |
DISTUTILS_OPTIONAL=1 |
11 |
DISTUTILS_SINGLE_IMPL=1 |
12 |
DISTUTILS_SINGLE_IMPL=1 |
12 |
AUTOTOOLS_AUTORECONF=1 |
13 |
AUTOTOOLS_AUTORECONF=1 |
13 |
AUTOTOOLS_IN_SOURCE_BUILD=1 |
14 |
AUTOTOOLS_IN_SOURCE_BUILD=1 |
|
|
15 |
DISABLE_AUTOFORMATTING=1 |
14 |
|
16 |
|
15 |
inherit autotools-utils distutils-r1 systemd |
17 |
inherit autotools-utils distutils-r1 linux-info readme.gentoo systemd |
16 |
|
18 |
|
17 |
DESCRIPTION="Single Packet Authorization and Port Knocking application" |
19 |
DESCRIPTION="Single Packet Authorization and Port Knocking application" |
18 |
HOMEPAGE="http://www.cipherdyne.org/fwknop/" |
20 |
HOMEPAGE="http://www.cipherdyne.org/fwknop/" |
Lines 21-27
SRC_URI="https://github.com/mrash/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
Link Here
|
21 |
LICENSE="GPL-2" |
23 |
LICENSE="GPL-2" |
22 |
SLOT="0" |
24 |
SLOT="0" |
23 |
KEYWORDS="~amd64 ~x86" |
25 |
KEYWORDS="~amd64 ~x86" |
24 |
IUSE="client extras gdbm gpg python server udp-server" |
26 |
IUSE="client extras firewalld gdbm gpg iptables python server udp-server" |
25 |
|
27 |
|
26 |
RDEPEND=" |
28 |
RDEPEND=" |
27 |
client? ( net-misc/wget[ssl] ) |
29 |
client? ( net-misc/wget[ssl] ) |
Lines 34-51
RDEPEND="
Link Here
|
34 |
DEPEND="${RDEPEND} |
36 |
DEPEND="${RDEPEND} |
35 |
gdbm? ( sys-libs/gdbm ) |
37 |
gdbm? ( sys-libs/gdbm ) |
36 |
gpg? ( app-crypt/gpgme ) |
38 |
gpg? ( app-crypt/gpgme ) |
37 |
server? ( |
39 |
firewalld? ( net-firewall/firewalld ) |
38 |
!udp-server? ( net-libs/libpcap ) |
40 |
iptables? ( net-firewall/iptables ) |
39 |
net-firewall/iptables |
41 |
server? ( !udp-server? ( net-libs/libpcap ) ) |
40 |
) |
|
|
41 |
" |
42 |
" |
42 |
|
43 |
|
43 |
REQUIRED_USE=" |
44 |
REQUIRED_USE=" |
44 |
python? ( ${PYTHON_REQUIRED_USE} ) |
45 |
python? ( ${PYTHON_REQUIRED_USE} ) |
|
|
46 |
firewalld? ( server ) |
47 |
iptables? ( server ) |
48 |
server? ( ^^ ( firewalld iptables ) ) |
45 |
udp-server? ( server ) |
49 |
udp-server? ( server ) |
46 |
" |
50 |
" |
47 |
|
51 |
|
48 |
DOCS=( ChangeLog README.md ) |
52 |
DOCS=( ChangeLog README.md ) |
|
|
53 |
DOC_CONTENTS=" |
54 |
Example configuration files were installed in /etc/fwknopd directory. |
55 |
Please edit them to fit your needs and then remove the .example suffix. |
56 |
|
57 |
fwknopd supports several backends: firewalld, iptables, ipfw, pf, ipf. |
58 |
You can set the desired backend via FIREWALL_EXE option in fwknopd.conf |
59 |
instead of the default one chosen at compile time. |
60 |
" |
61 |
|
62 |
pkg_pretend() { |
63 |
if use server; then |
64 |
if ! linux_config_exists || ! linux_chkconfig_present NETFILTER_XT_MATCH_COMMENT; then |
65 |
ewarn "fwknopd uses the iptables 'comment' match to expire SPA rules," |
66 |
ewarn "which is a major security feature and is enabled by default." |
67 |
ewarn "Please either enable NETFILTER_XT_MATCH_COMMENT support in your" |
68 |
ewarn "kernel, or set the appropriate ENABLE_{FIREWD,IPT}_COMMENT_OPTION" |
69 |
ewarn "to 'N' in your fwknopd.conf file." |
70 |
fi |
71 |
fi |
72 |
} |
49 |
|
73 |
|
50 |
src_prepare() { |
74 |
src_prepare() { |
51 |
# Install example configs with .example suffix |
75 |
# Install example configs with .example suffix |
Lines 71-76
src_configure() {
Link Here
|
71 |
$(use_enable udp-server) |
95 |
$(use_enable udp-server) |
72 |
$(use_with gpg gpgme) |
96 |
$(use_with gpg gpgme) |
73 |
) |
97 |
) |
|
|
98 |
use firewalld && myeconfargs+=(--with-firewalld=/usr/sbin/firewalld) |
99 |
use iptables && myeconfargs+=(--with-iptables=/sbin/iptables) |
100 |
|
74 |
autotools-utils_src_configure |
101 |
autotools-utils_src_configure |
75 |
} |
102 |
} |
76 |
|
103 |
|
Lines 90-97
src_install() {
Link Here
|
90 |
if use server; then |
117 |
if use server; then |
91 |
newinitd "${FILESDIR}/fwknopd.init" fwknopd |
118 |
newinitd "${FILESDIR}/fwknopd.init" fwknopd |
92 |
newconfd "${FILESDIR}/fwknopd.confd" fwknopd |
119 |
newconfd "${FILESDIR}/fwknopd.confd" fwknopd |
93 |
systemd_dounit "${FILESDIR}/fwknopd.service" |
120 |
systemd_dounit extras/systemd/fwknopd.service |
94 |
systemd_newtmpfilesd "${FILESDIR}/fwknopd.tmpfiles.conf" fwknopd.conf |
121 |
systemd_newtmpfilesd extras/systemd/fwknopd.tmpfiles.conf fwknopd.conf |
|
|
122 |
readme.gentoo_create_doc |
95 |
fi |
123 |
fi |
96 |
|
124 |
|
97 |
use extras && dodoc "${S}/extras/apparmor/usr.sbin.fwknopd" |
125 |
use extras && dodoc "${S}/extras/apparmor/usr.sbin.fwknopd" |
Lines 103-105
src_install() {
Link Here
|
103 |
distutils-r1_src_install |
131 |
distutils-r1_src_install |
104 |
fi |
132 |
fi |
105 |
} |
133 |
} |
|
|
134 |
|
135 |
pkg_postinst() { |
136 |
use server && readme.gentoo_print_elog |
137 |
} |