Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/bopm/files/, net-misc/bopm/
Date: Mon, 29 Aug 2016 19:08:01
Message-Id: 1472497666.7676b5d33e6611f855d249fb8fdeb11e467cdb77.soap@gentoo
1 commit: 7676b5d33e6611f855d249fb8fdeb11e467cdb77
2 Author: Raymond Jennings <shentino <AT> gmail <DOT> com>
3 AuthorDate: Sat Aug 27 20:40:33 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 29 19:07:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7676b5d3
7
8 net-misc/bopm: revbump, patch config file, and huge cleanup
9
10 Fix these issues with r1:
11
12 * Upgrade to EAPI 6
13 * Update the homepage
14 * Formatting cleanups in the ebuild
15 * Remove a redundant inherit
16 * Use fowners and fperms instead of raw chown and chperm
17 * Nix an unneeded "|| die" call
18 * Use einstalldocs instead of dodoc
19 * Use ED instead of D
20 * Document usage of datadir to store example config file
21 * Move various operations to the proper ebuild functions
22
23 And finally:
24
25 * Add patch to remove njabl from example config file
26 Closes: https://github.com/gentoo/gentoo/pull/2151
27
28 Signed-off-by: David Seifert <soap <AT> gentoo.org>
29
30 net-misc/bopm/bopm-3.1.3-r2.ebuild | 64 +++++++++++
31 net-misc/bopm/files/bopm-3.1.3-autotools.patch | 130 ++++++++++++++++++++++
32 net-misc/bopm/files/bopm-3.1.3-remove-njabl.patch | 28 +++++
33 3 files changed, 222 insertions(+)
34
35 diff --git a/net-misc/bopm/bopm-3.1.3-r2.ebuild b/net-misc/bopm/bopm-3.1.3-r2.ebuild
36 new file mode 100644
37 index 00000000..75d5f68
38 --- /dev/null
39 +++ b/net-misc/bopm/bopm-3.1.3-r2.ebuild
40 @@ -0,0 +1,64 @@
41 +# Copyright 1999-2016 Gentoo Foundation
42 +# Distributed under the terms of the GNU General Public License v2
43 +# $Id$
44 +
45 +EAPI=6
46 +
47 +inherit autotools user
48 +
49 +DESCRIPTION="Blitzed Open Proxy Monitor"
50 +HOMEPAGE="http://github.com/blitzed-org/bopm"
51 +SRC_URI="http://static.blitzed.org/www.blitzed.org/${PN}/files/${P}.tar.gz"
52 +
53 +LICENSE="GPL-2"
54 +SLOT="0"
55 +KEYWORDS="~alpha ~amd64 ~ppc ~x86"
56 +IUSE=""
57 +
58 +RDEPEND=""
59 +DEPEND="${RDEPEND}"
60 +
61 +PATCHES=(
62 + "${FILESDIR}"/${P}-remove-njabl.patch
63 + "${FILESDIR}"/${P}-autotools.patch
64 +)
65 +
66 +pkg_setup() {
67 + enewuser bopm
68 +}
69 +
70 +src_prepare() {
71 + mv bopm.conf{.sample,} || die
72 + mv configure.{in,ac} || die
73 + mv src/libopm/configure.{in,ac} || die
74 +
75 + sed -i \
76 + -e "s!/some/path/bopm.pid!/run/${PN}/${PN}.pid!" \
77 + -e "s!/some/path/scan.log!/var/log/${PN}/scan.log!" \
78 + bopm.conf || die
79 +
80 + default
81 + eautoreconf
82 +}
83 +
84 +src_configure() {
85 + econf --localstatedir="${EPREFIX}"/var/log/${PN}
86 +}
87 +
88 +src_install() {
89 + default
90 +
91 + # Remove libopm related files, because bopm links statically to it
92 + # If anybody wants libopm, please install net-libs/libopm
93 + rm -r "${ED}"usr/$(get_libdir) "${ED}"usr/include || die
94 +
95 + newinitd "${FILESDIR}"/bopm.init.d-r1 ${PN}
96 + newconfd "${FILESDIR}"/bopm.conf.d-r1 ${PN}
97 +
98 + dodir /var/log/bopm
99 + fperms 700 /var/log/bopm
100 + fowners bopm:root /var/log/bopm
101 +
102 + fperms 600 /etc/bopm.conf
103 + fowners bopm:root /etc/bopm.conf
104 +}
105
106 diff --git a/net-misc/bopm/files/bopm-3.1.3-autotools.patch b/net-misc/bopm/files/bopm-3.1.3-autotools.patch
107 new file mode 100644
108 index 00000000..992a1ff
109 --- /dev/null
110 +++ b/net-misc/bopm/files/bopm-3.1.3-autotools.patch
111 @@ -0,0 +1,130 @@
112 +--- bopm-3.1.3/configure.ac
113 ++++ bopm-3.1.3/configure.ac
114 +@@ -1,5 +1,6 @@
115 + dnl Process this file with autoconf to produce a configure script.
116 + AC_INIT(bopm, [3.1.3])
117 ++AC_CONFIG_MACRO_DIR([src/libopm/m4])
118 + AC_CONFIG_SRCDIR(src/opercmd.h)
119 + AM_CONFIG_HEADER(src/setup.h)
120 + AM_INIT_AUTOMAKE()
121 +--- bopm-3.1.3/Makefile.am
122 ++++ bopm-3.1.3/Makefile.am
123 +@@ -2,22 +2,9 @@
124 +
125 + SUBDIRS = src
126 +
127 +-data_DATA = bopm.conf.sample bopm.conf.blitzed
128 ++dist_doc_DATA = bopm.conf.blitzed
129 +
130 +-EXTRA_DIST = ChangeLog contrib INSTALL README bopm.conf.sample bopm.conf.blitzed network-bopm
131 ++EXTRA_DIST = ChangeLog contrib INSTALL README network-bopm
132 +
133 +-install-data-local:
134 +- @if test -f $(sysconfdir)/bopm.conf ; then \
135 +- echo "$@ will not overwrite existing $(sysconfdir)/bopm.conf"; \
136 +- else \
137 +- $(mkinstalldirs) $(sysconfdir); \
138 +- echo "$(INSTALL_DATA) bopm.conf.sample $(sysconfdir)/bopm.conf"; \
139 +- $(INSTALL_DATA) bopm.conf.sample $(sysconfdir)/bopm.conf; \
140 +- fi
141 +- $(mkinstalldirs) $(localstatedir)
142 ++dist_sysconf_DATA = bopm.conf
143 +
144 +-uninstall-local:
145 +- @if test -f $(sysconfdir)/bopm.conf ; then \
146 +- echo "rm -f $(sysconfdir)/bopm.conf"; \
147 +- $(RM) -f $(sysconfdir)/bopm.conf; \
148 +- fi
149 +--- bopm-3.1.3/src/libopm/configure.ac
150 ++++ bopm-3.1.3/src/libopm/configure.ac
151 +@@ -1,5 +1,6 @@
152 + dnl Process this file with autoconf to produce a configure script.
153 + AC_INIT(libopm, [0.1])
154 ++AC_CONFIG_MACRO_DIR([m4])
155 + AC_CONFIG_SRCDIR(src/libopm.h)
156 + AM_CONFIG_HEADER(src/setup.h)
157 + AM_INIT_AUTOMAKE()
158 +--- bopm-3.1.3/src/libopm/m4/etr_socket_nsl.m4
159 ++++ bopm-3.1.3/src/libopm/m4/etr_socket_nsl.m4
160 +@@ -0,0 +1,81 @@
161 ++dnl @synopsis ETR_SOCKET_NSL
162 ++dnl
163 ++dnl @obsoleted Use LIB_SOCKET_NSL instead.
164 ++dnl
165 ++dnl This macro figures out what libraries are required on this platform
166 ++dnl to link sockets programs. It's usually -lsocket and/or -lnsl or
167 ++dnl neither. We test for all three combinations.
168 ++dnl
169 ++dnl @category Obsolete
170 ++dnl @author Warren Young <warren@×××××××.com>
171 ++dnl @version 2005-09-02
172 ++dnl @license AllPermissive
173 ++
174 ++AC_DEFUN([ETR_SOCKET_NSL],
175 ++[
176 ++AC_CACHE_CHECK(for libraries containing socket functions,
177 ++ac_cv_socket_libs, [
178 ++ oCFLAGS=$CFLAGS
179 ++
180 ++ AC_TRY_LINK([
181 ++ #include <sys/types.h>
182 ++ #include <sys/socket.h>
183 ++ #include <netinet/in.h>
184 ++ #include <arpa/inet.h>
185 ++ ],
186 ++ [
187 ++ struct in_addr add;
188 ++ int sd = socket(AF_INET, SOCK_STREAM, 0);
189 ++ inet_ntoa(add);
190 ++ ],
191 ++ ac_cv_socket_libs=-lc, ac_cv_socket_libs=no)
192 ++
193 ++ if test x"$ac_cv_socket_libs" = "xno"
194 ++ then
195 ++ CFLAGS="$oCFLAGS -lsocket"
196 ++ AC_TRY_LINK([
197 ++ #include <sys/types.h>
198 ++ #include <sys/socket.h>
199 ++ #include <netinet/in.h>
200 ++ #include <arpa/inet.h>
201 ++ ],
202 ++ [
203 ++ struct in_addr add;
204 ++ int sd = socket(AF_INET, SOCK_STREAM, 0);
205 ++ inet_ntoa(add);
206 ++ ],
207 ++ ac_cv_socket_libs=-lsocket, ac_cv_socket_libs=no)
208 ++ fi
209 ++
210 ++ if test x"$ac_cv_socket_libs" = "xno"
211 ++ then
212 ++ CFLAGS="$oCFLAGS -lsocket -lnsl"
213 ++ AC_TRY_LINK([
214 ++ #include <sys/types.h>
215 ++ #include <sys/socket.h>
216 ++ #include <netinet/in.h>
217 ++ #include <arpa/inet.h>
218 ++ ],
219 ++ [
220 ++ struct in_addr add;
221 ++ int sd = socket(AF_INET, SOCK_STREAM, 0);
222 ++ inet_ntoa(add);
223 ++ ],
224 ++ ac_cv_socket_libs="-lsocket -lnsl", ac_cv_socket_libs=no)
225 ++ fi
226 ++
227 ++ CFLAGS=$oCFLAGS
228 ++])
229 ++
230 ++ if test x"$ac_cv_socket_libs" = "xno"
231 ++ then
232 ++ AC_MSG_ERROR([Cannot find socket libraries])
233 ++ elif test x"$ac_cv_socket_libs" = "x-lc"
234 ++ then
235 ++ ETR_SOCKET_LIBS=""
236 ++ else
237 ++ ETR_SOCKET_LIBS="$ac_cv_socket_libs"
238 ++ fi
239 ++
240 ++ AC_SUBST(ETR_SOCKET_LIBS)
241 ++]) dnl ETR_SOCKET_NSL
242
243 diff --git a/net-misc/bopm/files/bopm-3.1.3-remove-njabl.patch b/net-misc/bopm/files/bopm-3.1.3-remove-njabl.patch
244 new file mode 100644
245 index 00000000..588ccd6
246 --- /dev/null
247 +++ b/net-misc/bopm/files/bopm-3.1.3-remove-njabl.patch
248 @@ -0,0 +1,28 @@
249 +Remove NJABL as an example blacklist.
250 +
251 +NJABL has been shut down and bopm upstream still lists it in its default
252 +configuration.
253 +---
254 +diff --git a/bopm.conf b/bopm.conf
255 +index 74483e1..bc05bf4 100644
256 +--- a/bopm.conf
257 ++++ b/bopm.conf
258 +@@ -363,18 +363,6 @@ OPM {
259 + # };
260 +
261 +
262 +- /* example: NJABL - please read http://www.njabl.org/use.html before
263 +- * uncommenting */
264 +-# blacklist {
265 +-# name = "dnsbl.njabl.org";
266 +-# type = "A record reply";
267 +-# reply {
268 +-# 9 = "Open proxy";
269 +-# };
270 +-# ban_unknown = no;
271 +-# kline = "KLINE *@%h :Open proxy found on your host, please visit www.njabl.org/cgi-bin/lookup.cgi?query=%i";
272 +-# };
273 +-
274 + /*
275 + * You can report the insecure proxies you find to a DNSBL also!
276 + * The remaining directives in this section are only needed if you