summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Pavljuchenkov (SpiderX) <spiderx@spiderx.dp.ua>2018-01-20 19:05:13 +0200
committerMichał Górny <mgorny@gentoo.org>2018-10-30 11:28:43 +0100
commitf3042e074b7763c09bf274d366bbe31f0e55e417 (patch)
tree6d9418d88a49f6f4a7c8b84a0d1a8a8dd349002e /net-misc
parentnet-analyzer/ossec-hids: open source HIDS (new package) (diff)
downloadgentoo-f3042e074b7763c09bf274d366bbe31f0e55e417.tar.gz
gentoo-f3042e074b7763c09bf274d366bbe31f0e55e417.tar.bz2
gentoo-f3042e074b7763c09bf274d366bbe31f0e55e417.zip
net-misc/pingu: new ebuild
Pingu is a daemon that takes care of policy routing and fail-over in multi ISP setups. Signed-off-by: Vladimir Pavljuchenkov <spiderx@spiderx.dp.ua> Package-Manager: Portage-2.3.49, Repoman-2.3.11 Closes: https://github.com/gentoo/gentoo/pull/10194 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/pingu/Manifest1
-rw-r--r--net-misc/pingu/files/pingu-1.5-makefile.patch21
-rw-r--r--net-misc/pingu/files/pingu.confd5
-rw-r--r--net-misc/pingu/files/pingu.initd13
-rw-r--r--net-misc/pingu/files/pingu.service11
-rw-r--r--net-misc/pingu/files/pingu.tmpfile1
-rw-r--r--net-misc/pingu/metadata.xml19
-rw-r--r--net-misc/pingu/pingu-1.5.ebuild57
-rw-r--r--net-misc/pingu/pingu-9999.ebuild50
9 files changed, 178 insertions, 0 deletions
diff --git a/net-misc/pingu/Manifest b/net-misc/pingu/Manifest
new file mode 100644
index 000000000000..dff3f8cd1f88
--- /dev/null
+++ b/net-misc/pingu/Manifest
@@ -0,0 +1 @@
+DIST pingu-1.5.tar.gz 31565 BLAKE2B 13d1fa075f32d5a32cece55c5292cda08f72e711a8567cc8b25ce0e2bb0325395f1346e9feb96eb266c93d10d04609d87562192f7b7d0c22730fd4a8561c6c1a SHA512 71e5fbe93f831f24d168957cdeaff2817a22f407575316d6515755bec760d10724821070549eaab562924237b96976a1a776ca903d5fe0cd9f9b69a38eadd8c9
diff --git a/net-misc/pingu/files/pingu-1.5-makefile.patch b/net-misc/pingu/files/pingu-1.5-makefile.patch
new file mode 100644
index 000000000000..a4c04aac31f2
--- /dev/null
+++ b/net-misc/pingu/files/pingu-1.5-makefile.patch
@@ -0,0 +1,21 @@
+--- a/src/Makefile 2017-11-25 18:39:32.667570139 +0200
++++ b/src/Makefile 2017-11-25 18:41:29.285573031 +0200
+@@ -17,7 +17,7 @@
+
+ rundir ?= $(localstatedir)/run
+
+-pingustatedir = $(rundir)/pingu
++pingustatedir = /run/pingu
+
+ DESTDIR ?=
+
+@@ -93,8 +93,7 @@
+ $(MAKE) -C $@
+
+ install: $(TARGETS) $(INSTALL_LUA_TARGET)
+- $(INSTALLDIR) $(DESTDIR)/$(bindir) $(DESTDIR)/$(sbindir) \
+- $(DESTDIR)/$(pingustatedir)
++ $(INSTALLDIR) $(DESTDIR)/$(bindir) $(DESTDIR)/$(sbindir)
+ $(INSTALL) $(BIN_TARGETS) $(DESTDIR)/$(bindir)
+ $(INSTALL) $(SBIN_TARGETS) $(DESTDIR)/$(sbindir)
+ for dir in $(SUBDIRS); do \
diff --git a/net-misc/pingu/files/pingu.confd b/net-misc/pingu/files/pingu.confd
new file mode 100644
index 000000000000..ae4ae8603fd0
--- /dev/null
+++ b/net-misc/pingu/files/pingu.confd
@@ -0,0 +1,5 @@
+# Config file for /etc/init.d/pingu
+
+# Various options.
+# run `pingu -h` for valid cmdline options
+OPTS=""
diff --git a/net-misc/pingu/files/pingu.initd b/net-misc/pingu/files/pingu.initd
new file mode 100644
index 000000000000..c4de6a754c31
--- /dev/null
+++ b/net-misc/pingu/files/pingu.initd
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+command=/usr/sbin/pingu
+command_args="-d ${OPTS}"
+description="Policy routing daemon"
+name="Policy routing daemon"
+pidfile=/run/pingu/pingu.pid
+
+depend() {
+ need net
+}
diff --git a/net-misc/pingu/files/pingu.service b/net-misc/pingu/files/pingu.service
new file mode 100644
index 000000000000..6677e9b8efd8
--- /dev/null
+++ b/net-misc/pingu/files/pingu.service
@@ -0,0 +1,11 @@
+[Unit]
+Description="Policy routing daemon"
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/pingu -d
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/pingu/files/pingu.tmpfile b/net-misc/pingu/files/pingu.tmpfile
new file mode 100644
index 000000000000..c48124d1e470
--- /dev/null
+++ b/net-misc/pingu/files/pingu.tmpfile
@@ -0,0 +1 @@
+d /run/pingu 0755 root root
diff --git a/net-misc/pingu/metadata.xml b/net-misc/pingu/metadata.xml
new file mode 100644
index 000000000000..4a306e8d3616
--- /dev/null
+++ b/net-misc/pingu/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>spiderx@spiderx.dp.ua</email>
+ <name>Vladimir Pavljuchenkov</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ Pingu is a daemon that takes care of policy routing and
+ fail-over in multi ISP setups.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">ncopa/pingu</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-misc/pingu/pingu-1.5.ebuild b/net-misc/pingu/pingu-1.5.ebuild
new file mode 100644
index 000000000000..1d074daa34ea
--- /dev/null
+++ b/net-misc/pingu/pingu-1.5.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit systemd tmpfiles toolchain-funcs
+
+DESCRIPTION="Policy routing daemon with failover and load-balancing"
+HOMEPAGE="https://github.com/ncopa/pingu"
+SRC_URI="https://github.com/ncopa/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc"
+
+RDEPEND="dev-libs/libev:="
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers
+ virtual/pkgconfig
+ doc? ( app-text/asciidoc )"
+
+# Fix QA with install into path /run/pingu must be created at runtime
+PATCHES=( "${FILESDIR}"/"${P}"-makefile.patch )
+
+src_prepare() {
+ default
+
+ # Fix compilation issue
+ sed -i '/icp->un.frag.__unused = 0;/d' src/icmp.c \
+ || die "sed failed for src/icmp.c"
+}
+
+src_configure() {
+ ./configure "$(use_enable debug)" "$(use_enable doc)" \
+ --prefix=/usr || die "configure failed"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ default
+
+ newtmpfiles "${FILESDIR}"/pingu.tmpfile pingu.conf
+ newinitd "${FILESDIR}"/pingu.initd pingu
+ newconfd "${FILESDIR}"/pingu.confd pingu
+ systemd_dounit "${FILESDIR}"/pingu.service
+ keepdir /var/lib/pingu
+ insinto /etc/pingu
+ newins pingu.conf pingu.conf.example
+}
+
+pkg_postinst() {
+ tmpfiles_process pingu.conf
+}
diff --git a/net-misc/pingu/pingu-9999.ebuild b/net-misc/pingu/pingu-9999.ebuild
new file mode 100644
index 000000000000..30ea3b2eab70
--- /dev/null
+++ b/net-misc/pingu/pingu-9999.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit git-r3 systemd tmpfiles toolchain-funcs
+
+DESCRIPTION="Policy routing daemon with failover and load-balancing"
+HOMEPAGE="https://github.com/ncopa/pingu"
+SRC_URI=""
+EGIT_REPO_URI="https://github.com/ncopa/${PN}.git"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug doc"
+
+RDEPEND="dev-libs/libev:="
+DEPEND="${RDEPEND}
+ sys-kernel/linux-headers
+ virtual/pkgconfig
+ doc? ( app-text/asciidoc )"
+
+# Fix QA with install into path /run/pingu must be created at runtime
+PATCHES=( "${FILESDIR}"/"${PN}"-1.5-makefile.patch )
+
+src_configure() {
+ ./configure "$(use_enable debug)" "$(use_enable doc)" \
+ --prefix=/usr || die "configure failed"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ default
+
+ newtmpfiles "${FILESDIR}"/pingu.tmpfile pingu.conf
+ newinitd "${FILESDIR}"/pingu.initd pingu
+ newconfd "${FILESDIR}"/pingu.confd pingu
+ systemd_dounit "${FILESDIR}"/pingu.service
+ keepdir /var/lib/pingu
+ insinto /etc/pingu
+ newins pingu.conf pingu.conf.example
+}
+
+pkg_postinst() {
+ tmpfiles_process pingu.conf
+}