app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / net-misc / samplicator / samplicator-1.3.6.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit user
7
8 DESCRIPTION="UDP packets forwarder and duplicator"
9 HOMEPAGE="https://github.com/sleinen/${PN}"
10 SRC_URI="https://github.com/sleinen/${PN}/releases/download/v${PV}/${P}.tar.gz"
11
12 LICENSE="Artistic GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15
16 pkg_setup() {
17         # Add samplicator group and user to system
18         enewgroup ${PN}
19         enewuser ${PN} -1 -1 /etc/${PN} ${PN}
20 }
21
22 src_install() {
23         # Install and copy documentation
24         default
25
26         # Install Gentoo init script and its config
27         newinitd "${FILESDIR}"/${PN}.initd ${PN}
28         newconfd "${FILESDIR}"/${PN}.confd ${PN}
29
30         # Install manual page
31         doman "${FILESDIR}"/${PN}.8
32 }
33
34 pkg_postinst() {
35         ewarn ""
36         ewarn "Don't specify the receiver on the command line, because it will get all packets."
37         ewarn "Instead of this, specify it in a config file; defined in such way it will only get packets with a matching source."
38         ewarn ""
39
40         einfo "For every receiver type create a file in directory /etc/${PN} (see example below)"
41         einfo "and specify the path to it in variable CONFIG of the corresponding initscript config file in /etc/conf.d/"
42         einfo ""
43         einfo "Receiver config examples: "
44         einfo ""
45         einfo "    /etc/${PN}/netflow:"
46         einfo "    10.0.0.0/255.0.0.0:1.1.1.1/9996 2.2.2.2/9996 3.3.3.3/9996"
47         einfo ""
48         einfo "    /etc/${PN}/syslog:"
49         einfo "    10.0.0.0/255.255.0.0:2.2.2.2/514 3.3.3.3/514"
50         einfo ""
51         einfo "    /etc/${PN}/snmp:"
52         einfo "    10.0.0.0/255.255.255.255:3.3.3.3/162"
53 }