1 |
commit: f3042e074b7763c09bf274d366bbe31f0e55e417 |
2 |
Author: Vladimir Pavljuchenkov (SpiderX) <spiderx <AT> spiderx <DOT> dp <DOT> ua> |
3 |
AuthorDate: Sat Jan 20 17:05:13 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 30 10:28:43 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3042e07 |
7 |
|
8 |
net-misc/pingu: new ebuild |
9 |
|
10 |
Pingu is a daemon that takes care of policy routing and |
11 |
fail-over in multi ISP setups. |
12 |
|
13 |
Signed-off-by: Vladimir Pavljuchenkov <spiderx <AT> spiderx.dp.ua> |
14 |
Package-Manager: Portage-2.3.49, Repoman-2.3.11 |
15 |
Closes: https://github.com/gentoo/gentoo/pull/10194 |
16 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
17 |
|
18 |
net-misc/pingu/Manifest | 1 + |
19 |
net-misc/pingu/files/pingu-1.5-makefile.patch | 21 ++++++++++ |
20 |
net-misc/pingu/files/pingu.confd | 5 +++ |
21 |
net-misc/pingu/files/pingu.initd | 13 ++++++ |
22 |
net-misc/pingu/files/pingu.service | 11 ++++++ |
23 |
net-misc/pingu/files/pingu.tmpfile | 1 + |
24 |
net-misc/pingu/metadata.xml | 19 +++++++++ |
25 |
net-misc/pingu/pingu-1.5.ebuild | 57 +++++++++++++++++++++++++++ |
26 |
net-misc/pingu/pingu-9999.ebuild | 50 +++++++++++++++++++++++ |
27 |
9 files changed, 178 insertions(+) |
28 |
|
29 |
diff --git a/net-misc/pingu/Manifest b/net-misc/pingu/Manifest |
30 |
new file mode 100644 |
31 |
index 00000000000..dff3f8cd1f8 |
32 |
--- /dev/null |
33 |
+++ b/net-misc/pingu/Manifest |
34 |
@@ -0,0 +1 @@ |
35 |
+DIST pingu-1.5.tar.gz 31565 BLAKE2B 13d1fa075f32d5a32cece55c5292cda08f72e711a8567cc8b25ce0e2bb0325395f1346e9feb96eb266c93d10d04609d87562192f7b7d0c22730fd4a8561c6c1a SHA512 71e5fbe93f831f24d168957cdeaff2817a22f407575316d6515755bec760d10724821070549eaab562924237b96976a1a776ca903d5fe0cd9f9b69a38eadd8c9 |
36 |
|
37 |
diff --git a/net-misc/pingu/files/pingu-1.5-makefile.patch b/net-misc/pingu/files/pingu-1.5-makefile.patch |
38 |
new file mode 100644 |
39 |
index 00000000000..a4c04aac31f |
40 |
--- /dev/null |
41 |
+++ b/net-misc/pingu/files/pingu-1.5-makefile.patch |
42 |
@@ -0,0 +1,21 @@ |
43 |
+--- a/src/Makefile 2017-11-25 18:39:32.667570139 +0200 |
44 |
++++ b/src/Makefile 2017-11-25 18:41:29.285573031 +0200 |
45 |
+@@ -17,7 +17,7 @@ |
46 |
+ |
47 |
+ rundir ?= $(localstatedir)/run |
48 |
+ |
49 |
+-pingustatedir = $(rundir)/pingu |
50 |
++pingustatedir = /run/pingu |
51 |
+ |
52 |
+ DESTDIR ?= |
53 |
+ |
54 |
+@@ -93,8 +93,7 @@ |
55 |
+ $(MAKE) -C $@ |
56 |
+ |
57 |
+ install: $(TARGETS) $(INSTALL_LUA_TARGET) |
58 |
+- $(INSTALLDIR) $(DESTDIR)/$(bindir) $(DESTDIR)/$(sbindir) \ |
59 |
+- $(DESTDIR)/$(pingustatedir) |
60 |
++ $(INSTALLDIR) $(DESTDIR)/$(bindir) $(DESTDIR)/$(sbindir) |
61 |
+ $(INSTALL) $(BIN_TARGETS) $(DESTDIR)/$(bindir) |
62 |
+ $(INSTALL) $(SBIN_TARGETS) $(DESTDIR)/$(sbindir) |
63 |
+ for dir in $(SUBDIRS); do \ |
64 |
|
65 |
diff --git a/net-misc/pingu/files/pingu.confd b/net-misc/pingu/files/pingu.confd |
66 |
new file mode 100644 |
67 |
index 00000000000..ae4ae8603fd |
68 |
--- /dev/null |
69 |
+++ b/net-misc/pingu/files/pingu.confd |
70 |
@@ -0,0 +1,5 @@ |
71 |
+# Config file for /etc/init.d/pingu |
72 |
+ |
73 |
+# Various options. |
74 |
+# run `pingu -h` for valid cmdline options |
75 |
+OPTS="" |
76 |
|
77 |
diff --git a/net-misc/pingu/files/pingu.initd b/net-misc/pingu/files/pingu.initd |
78 |
new file mode 100644 |
79 |
index 00000000000..c4de6a754c3 |
80 |
--- /dev/null |
81 |
+++ b/net-misc/pingu/files/pingu.initd |
82 |
@@ -0,0 +1,13 @@ |
83 |
+#!/sbin/openrc-run |
84 |
+# Copyright 1999-2018 Gentoo Authors |
85 |
+# Distributed under the terms of the GNU General Public License v2 |
86 |
+ |
87 |
+command=/usr/sbin/pingu |
88 |
+command_args="-d ${OPTS}" |
89 |
+description="Policy routing daemon" |
90 |
+name="Policy routing daemon" |
91 |
+pidfile=/run/pingu/pingu.pid |
92 |
+ |
93 |
+depend() { |
94 |
+ need net |
95 |
+} |
96 |
|
97 |
diff --git a/net-misc/pingu/files/pingu.service b/net-misc/pingu/files/pingu.service |
98 |
new file mode 100644 |
99 |
index 00000000000..6677e9b8efd |
100 |
--- /dev/null |
101 |
+++ b/net-misc/pingu/files/pingu.service |
102 |
@@ -0,0 +1,11 @@ |
103 |
+[Unit] |
104 |
+Description="Policy routing daemon" |
105 |
+After=network.target |
106 |
+ |
107 |
+[Service] |
108 |
+Type=simple |
109 |
+ExecStart=/usr/sbin/pingu -d |
110 |
+Restart=on-abort |
111 |
+ |
112 |
+[Install] |
113 |
+WantedBy=multi-user.target |
114 |
|
115 |
diff --git a/net-misc/pingu/files/pingu.tmpfile b/net-misc/pingu/files/pingu.tmpfile |
116 |
new file mode 100644 |
117 |
index 00000000000..c48124d1e47 |
118 |
--- /dev/null |
119 |
+++ b/net-misc/pingu/files/pingu.tmpfile |
120 |
@@ -0,0 +1 @@ |
121 |
+d /run/pingu 0755 root root |
122 |
|
123 |
diff --git a/net-misc/pingu/metadata.xml b/net-misc/pingu/metadata.xml |
124 |
new file mode 100644 |
125 |
index 00000000000..4a306e8d361 |
126 |
--- /dev/null |
127 |
+++ b/net-misc/pingu/metadata.xml |
128 |
@@ -0,0 +1,19 @@ |
129 |
+<?xml version="1.0" encoding="UTF-8"?> |
130 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
131 |
+<pkgmetadata> |
132 |
+ <maintainer type="person"> |
133 |
+ <email>spiderx@××××××××××.ua</email> |
134 |
+ <name>Vladimir Pavljuchenkov</name> |
135 |
+ </maintainer> |
136 |
+ <maintainer type="project"> |
137 |
+ <email>proxy-maint@g.o</email> |
138 |
+ <name>Proxy Maintainers</name> |
139 |
+ </maintainer> |
140 |
+ <longdescription lang="en"> |
141 |
+ Pingu is a daemon that takes care of policy routing and |
142 |
+ fail-over in multi ISP setups. |
143 |
+ </longdescription> |
144 |
+ <upstream> |
145 |
+ <remote-id type="github">ncopa/pingu</remote-id> |
146 |
+ </upstream> |
147 |
+</pkgmetadata> |
148 |
|
149 |
diff --git a/net-misc/pingu/pingu-1.5.ebuild b/net-misc/pingu/pingu-1.5.ebuild |
150 |
new file mode 100644 |
151 |
index 00000000000..1d074daa34e |
152 |
--- /dev/null |
153 |
+++ b/net-misc/pingu/pingu-1.5.ebuild |
154 |
@@ -0,0 +1,57 @@ |
155 |
+# Copyright 1999-2018 Gentoo Authors |
156 |
+# Distributed under the terms of the GNU General Public License v2 |
157 |
+ |
158 |
+EAPI=6 |
159 |
+ |
160 |
+inherit systemd tmpfiles toolchain-funcs |
161 |
+ |
162 |
+DESCRIPTION="Policy routing daemon with failover and load-balancing" |
163 |
+HOMEPAGE="https://github.com/ncopa/pingu" |
164 |
+SRC_URI="https://github.com/ncopa/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
165 |
+ |
166 |
+LICENSE="GPL-2+" |
167 |
+SLOT="0" |
168 |
+KEYWORDS="~amd64 ~x86" |
169 |
+IUSE="debug doc" |
170 |
+ |
171 |
+RDEPEND="dev-libs/libev:=" |
172 |
+DEPEND="${RDEPEND} |
173 |
+ sys-kernel/linux-headers |
174 |
+ virtual/pkgconfig |
175 |
+ doc? ( app-text/asciidoc )" |
176 |
+ |
177 |
+# Fix QA with install into path /run/pingu must be created at runtime |
178 |
+PATCHES=( "${FILESDIR}"/"${P}"-makefile.patch ) |
179 |
+ |
180 |
+src_prepare() { |
181 |
+ default |
182 |
+ |
183 |
+ # Fix compilation issue |
184 |
+ sed -i '/icp->un.frag.__unused = 0;/d' src/icmp.c \ |
185 |
+ || die "sed failed for src/icmp.c" |
186 |
+} |
187 |
+ |
188 |
+src_configure() { |
189 |
+ ./configure "$(use_enable debug)" "$(use_enable doc)" \ |
190 |
+ --prefix=/usr || die "configure failed" |
191 |
+} |
192 |
+ |
193 |
+src_compile() { |
194 |
+ emake CC="$(tc-getCC)" |
195 |
+} |
196 |
+ |
197 |
+src_install() { |
198 |
+ default |
199 |
+ |
200 |
+ newtmpfiles "${FILESDIR}"/pingu.tmpfile pingu.conf |
201 |
+ newinitd "${FILESDIR}"/pingu.initd pingu |
202 |
+ newconfd "${FILESDIR}"/pingu.confd pingu |
203 |
+ systemd_dounit "${FILESDIR}"/pingu.service |
204 |
+ keepdir /var/lib/pingu |
205 |
+ insinto /etc/pingu |
206 |
+ newins pingu.conf pingu.conf.example |
207 |
+} |
208 |
+ |
209 |
+pkg_postinst() { |
210 |
+ tmpfiles_process pingu.conf |
211 |
+} |
212 |
|
213 |
diff --git a/net-misc/pingu/pingu-9999.ebuild b/net-misc/pingu/pingu-9999.ebuild |
214 |
new file mode 100644 |
215 |
index 00000000000..30ea3b2eab7 |
216 |
--- /dev/null |
217 |
+++ b/net-misc/pingu/pingu-9999.ebuild |
218 |
@@ -0,0 +1,50 @@ |
219 |
+# Copyright 1999-2018 Gentoo Authors |
220 |
+# Distributed under the terms of the GNU General Public License v2 |
221 |
+ |
222 |
+EAPI=6 |
223 |
+ |
224 |
+inherit git-r3 systemd tmpfiles toolchain-funcs |
225 |
+ |
226 |
+DESCRIPTION="Policy routing daemon with failover and load-balancing" |
227 |
+HOMEPAGE="https://github.com/ncopa/pingu" |
228 |
+SRC_URI="" |
229 |
+EGIT_REPO_URI="https://github.com/ncopa/${PN}.git" |
230 |
+ |
231 |
+LICENSE="GPL-2+" |
232 |
+SLOT="0" |
233 |
+KEYWORDS="" |
234 |
+IUSE="debug doc" |
235 |
+ |
236 |
+RDEPEND="dev-libs/libev:=" |
237 |
+DEPEND="${RDEPEND} |
238 |
+ sys-kernel/linux-headers |
239 |
+ virtual/pkgconfig |
240 |
+ doc? ( app-text/asciidoc )" |
241 |
+ |
242 |
+# Fix QA with install into path /run/pingu must be created at runtime |
243 |
+PATCHES=( "${FILESDIR}"/"${PN}"-1.5-makefile.patch ) |
244 |
+ |
245 |
+src_configure() { |
246 |
+ ./configure "$(use_enable debug)" "$(use_enable doc)" \ |
247 |
+ --prefix=/usr || die "configure failed" |
248 |
+} |
249 |
+ |
250 |
+src_compile() { |
251 |
+ emake CC="$(tc-getCC)" |
252 |
+} |
253 |
+ |
254 |
+src_install() { |
255 |
+ default |
256 |
+ |
257 |
+ newtmpfiles "${FILESDIR}"/pingu.tmpfile pingu.conf |
258 |
+ newinitd "${FILESDIR}"/pingu.initd pingu |
259 |
+ newconfd "${FILESDIR}"/pingu.confd pingu |
260 |
+ systemd_dounit "${FILESDIR}"/pingu.service |
261 |
+ keepdir /var/lib/pingu |
262 |
+ insinto /etc/pingu |
263 |
+ newins pingu.conf pingu.conf.example |
264 |
+} |
265 |
+ |
266 |
+pkg_postinst() { |
267 |
+ tmpfiles_process pingu.conf |
268 |
+} |