-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsnetmanmon-9999.ebuild
78 lines (63 loc) · 1.83 KB
/
snetmanmon-9999.ebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Ebuild written by Alexander Holler
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
# cmake-utils eclass modifies CMakeLists.txt which would make the
# version dirty. Therefor it isn't used.
inherit git-r3
KEYWORDS="arm amd64 x86"
EGIT_REPO_URI="git://github.com/aholler/snetmanmon.git"
[[ ${PV} == "9999" ]] || EGIT_COMMIT="v${PV}"
DESCRIPTION="A simple network manager and monitor for Linux"
HOMEPAGE="https://github.com/aholler/snetmanmon"
LICENSE="GPL-2"
SLOT="0"
IUSE=""
RDEPEND="dev-libs/boost"
DEPEND="${RDEPEND}
dev-util/cmake"
src_configure() {
cd "$S"
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/usr || die
}
src_compile() {
VERBOSE=1 default
}
src_install() {
VERBOSE=1 default
dodoc snetmanmon.conf.log_example snetmanmon.conf.klog_example snetmanmon.conf.simple_example snetmanmon.conf.debug_example ipv6_rpc.txt
insinto /etc
newins snetmanmon.conf.full_example snetmanmon.conf
cat > snetmanmon.init << END
#!/sbin/runscript
extra_started_commands="reload"
depend() {
after bootmisc
# uncomment this if you've configured snetmanmon as a network manager
#provide net
}
start() {
ebegin "Starting snetmanmon"
/usr/bin/snetmanmon -t /etc/snetmanmon.conf >/dev/null
local rc=\$?
start-stop-daemon --start --background --quiet \\
--pidfile /run/snetmanmon.pid \\
--exec /usr/bin/snetmanmon -- /etc/snetmanmon.conf
eend \$rc "Failed to start snetmanmon"
}
stop() {
ebegin "Stopping snetmanmon"
start-stop-daemon --stop --quiet \\
--pidfile /run/snetmanmon.pid \\
--exec /usr/bin/snetmanmon
eend \$? "Failed to stop snetmanmon"
}
reload() {
ebegin "Reloading snetmanmon"
/usr/bin/snetmanmon -t /etc/snetmanmon.conf >/dev/null
local rc=\$?
kill -HUP \$(cat /run/snetmanmon.pid) >/dev/null 2>&1
eend \$rc "Failed to reload snetmanmon"
}
END
newinitd snetmanmon.init snetmanmon
}