ifchk: new tool

This commit is contained in:
Yury Martynov 2019-04-10 13:27:02 +03:00
parent 5afc1007e7
commit b0cff0fdba
No known key found for this signature in database
GPG key ID: EBE62DD0CCEAE19E
6 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1 @@
DIST ifchk-1.1.0.tar.gz 105026 BLAKE2B 5e8eeed13ef086e7939c6a96fd4a580992a9087590d063f73c92eb80cca667b4c3ca0c686e473cbfd1bf52c00851ddaef559fd64a3b0995254f0496d5bf17a46 SHA512 8d52b41d92cf12ea08184f0c8eb37db358f4658d1eb12afc7638bd66fa06ebba34a7a32ffbfa8e8685a7f651816c911a77a9b593399c3081f041ed04ca20846e

View file

@ -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=""

View file

@ -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 :

View file

@ -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

View file

@ -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}
}

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>email@linxon.ru</email>
<name>Yury Martynov</name>
</maintainer>
</pkgmetadata>