diff --git a/net-analyzer/ifchk/Manifest b/net-analyzer/ifchk/Manifest new file mode 100644 index 000000000..06f2117ee --- /dev/null +++ b/net-analyzer/ifchk/Manifest @@ -0,0 +1 @@ +DIST ifchk-1.1.0.tar.gz 105026 BLAKE2B 5e8eeed13ef086e7939c6a96fd4a580992a9087590d063f73c92eb80cca667b4c3ca0c686e473cbfd1bf52c00851ddaef559fd64a3b0995254f0496d5bf17a46 SHA512 8d52b41d92cf12ea08184f0c8eb37db358f4658d1eb12afc7638bd66fa06ebba34a7a32ffbfa8e8685a7f651816c911a77a9b593399c3081f041ed04ca20846e diff --git a/net-analyzer/ifchk/files/ifchkboot.confd b/net-analyzer/ifchk/files/ifchkboot.confd new file mode 100644 index 000000000..6a70cff22 --- /dev/null +++ b/net-analyzer/ifchk/files/ifchkboot.confd @@ -0,0 +1,8 @@ +# /etc/conf.d/ifchkboot: config file for /etc/init.d/ifchkboot + +# Configuration (needs to be absolute path) +# You can get example from /usr/share/doc/ifchk*/ifchk.conf.example +IFCHK_CONFIGFILE="/etc/ifchk.conf" + +# See more: ifchk -h +IFCHK_OPTS="" diff --git a/net-analyzer/ifchk/files/ifchkboot.initd b/net-analyzer/ifchk/files/ifchkboot.initd new file mode 100644 index 000000000..fa834ee91 --- /dev/null +++ b/net-analyzer/ifchk/files/ifchkboot.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="A network interface promiscuous mode detection tool" +command="/usr/sbin/ifchk" +command_args="-f ${IFCHK_CONFIGFILE} ${IFCHK_OPTS}" +retry="TERM/25/KILL/5" + +depend() { + after net +} + +# vim: set ft=gentoo-init-d ts=4 : diff --git a/net-analyzer/ifchk/files/ifchkboot.service b/net-analyzer/ifchk/files/ifchkboot.service new file mode 100644 index 000000000..d58e39894 --- /dev/null +++ b/net-analyzer/ifchk/files/ifchkboot.service @@ -0,0 +1,13 @@ +[Unit] +Description=A network interface promiscuous mode detection tool +After=network.target +Documentation=man:ifchk(1) man:ifchk.conf(5) + +[Service] +Type=forking +ExecStart=/usr/sbin/ifchk -f /etc/ifchk.conf +PIDFile=/var/run/ifchk.pid +ExecStop=/usr/bin/pkill -TERM ifchk + +[Install] +WantedBy=multi-user.target diff --git a/net-analyzer/ifchk/ifchk-1.1.0.ebuild b/net-analyzer/ifchk/ifchk-1.1.0.ebuild new file mode 100644 index 000000000..1d560d29a --- /dev/null +++ b/net-analyzer/ifchk/ifchk-1.1.0.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs systemd + +DESCRIPTION="A network interface promiscuous mode detection tool" +HOMEPAGE="https://www.noorg.org/ifchk/" +SRC_URI="https://www.noorg.org/ifchk/dist/${P}.tar.gz" +KEYWORDS="~amd64 ~arm ~x86" +RESTRICT="mirror" +LICENSE="GPL-2" +SLOT="0" + +IUSE="doc" + +RDEPEND="sys-fs/sysfsutils" +DEPEND="${RDEPEND}" + +src_prepare() { + # Enable append *FLAGS + sed -e "s/CFLAGS=/CFLAGS+=/" \ + -e "s/LDFLAGS=/LDFLAGS+=/" \ + -i Makefile || die 'sed failed!' + + mv -v ifchk.conf ifchk.conf.example || die + + eapply_user +} + +src_compile() { + filter-ldflags -Wl,--as-needed + emake \ + BIN=${PN} \ + CC=$(tc-getCC) +} + +src_install() { + doman docs/*.{1,5} + dodoc \ + CHANGES \ + README* \ + ifchk.conf.example \ + $(use doc && echo papers/*.{pdf,ps}) + + newinitd "${FILESDIR}"/ifchkboot.initd ifchkboot + newconfd "${FILESDIR}"/ifchkboot.confd ifchkboot + systemd_dounit "${FILESDIR}"/ifchkboot.service + + insinto /etc + newins ifchk.conf.example ifchk.conf + + dosbin ${PN} +} diff --git a/net-analyzer/ifchk/metadata.xml b/net-analyzer/ifchk/metadata.xml new file mode 100644 index 000000000..ebc718e70 --- /dev/null +++ b/net-analyzer/ifchk/metadata.xml @@ -0,0 +1,8 @@ + + + + + email@linxon.ru + Yury Martynov + +