Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/apachetop/, app-admin/apachetop/files/
Date: Fri, 29 Dec 2017 22:33:40
Message-Id: 1514586743.da532d475a2b5bcca6eed2dedcd4758fd535054f.soap@gentoo
1 commit: da532d475a2b5bcca6eed2dedcd4758fd535054f
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 29 19:50:09 2017 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 29 22:32:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da532d47
7
8 app-admin/apachetop: Port to EAPI 6
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 app-admin/apachetop/apachetop-0.12.6-r2.ebuild | 30 ++--
13 .../apachetop/files/apachetop-0.12.6-gcc41.patch | 4 +-
14 .../apachetop/files/apachetop-0.12.6-ncurses.patch | 166 +++++++++++++++++++++
15 3 files changed, 187 insertions(+), 13 deletions(-)
16
17 diff --git a/app-admin/apachetop/apachetop-0.12.6-r2.ebuild b/app-admin/apachetop/apachetop-0.12.6-r2.ebuild
18 index bb433b83e58..bff79f6bb3b 100644
19 --- a/app-admin/apachetop/apachetop-0.12.6-r2.ebuild
20 +++ b/app-admin/apachetop/apachetop-0.12.6-r2.ebuild
21 @@ -1,8 +1,9 @@
22 -# Copyright 1999-2015 Gentoo Foundation
23 +# Copyright 1999-2017 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25
26 -EAPI=5
27 -inherit eutils autotools
28 +EAPI=6
29 +
30 +inherit autotools
31
32 DESCRIPTION="A realtime Apache log analyzer"
33 HOMEPAGE="http://www.webta.org/projects/apachetop"
34 @@ -14,22 +15,29 @@ KEYWORDS="amd64 hppa ~mips ppc sparc x86"
35 IUSE="fam pcre"
36
37 RDEPEND="
38 + sys-libs/ncurses:0=
39 + sys-libs/readline:0=
40 fam? ( virtual/fam )
41 - pcre? ( dev-libs/libpcre )
42 -"
43 -DEPEND="${RDEPEND}"
44 + pcre? ( dev-libs/libpcre )"
45 +DEPEND="${RDEPEND}
46 + virtual/pkgconfig"
47 +
48 +PATCHES=(
49 + "${FILESDIR}"/${P}-gcc41.patch
50 + "${FILESDIR}"/${P}-configure.patch
51 + "${FILESDIR}"/${P}-maxpathlen.patch
52 + "${FILESDIR}"/${P}-ac_config_header.patch
53 + "${FILESDIR}"/${P}-ncurses.patch
54 +)
55
56 src_prepare() {
57 - epatch "${FILESDIR}"/${P}-gcc41.patch
58 - epatch "${FILESDIR}"/${P}-configure.patch
59 - epatch "${FILESDIR}"/${P}-maxpathlen.patch
60 - epatch "${FILESDIR}"/${P}-ac_config_header.patch
61 + default
62 eautoreconf
63 }
64
65 src_configure() {
66 econf \
67 - --with-logfile=/var/log/apache2/access_log \
68 + --with-logfile="${EPREFIX}"/var/log/apache2/access_log \
69 --without-adns \
70 $(use_with fam) \
71 $(use_with pcre)
72
73 diff --git a/app-admin/apachetop/files/apachetop-0.12.6-gcc41.patch b/app-admin/apachetop/files/apachetop-0.12.6-gcc41.patch
74 index 566c9226a3f..6bfb49d9f9d 100644
75 --- a/app-admin/apachetop/files/apachetop-0.12.6-gcc41.patch
76 +++ b/app-admin/apachetop/files/apachetop-0.12.6-gcc41.patch
77 @@ -1,5 +1,5 @@
78 ---- src/resolver.h
79 -+++ src/resolver.h
80 +--- a/src/resolver.h
81 ++++ b/src/resolver.h
82 @@ -10,8 +10,8 @@
83 class Resolver
84 {
85
86 diff --git a/app-admin/apachetop/files/apachetop-0.12.6-ncurses.patch b/app-admin/apachetop/files/apachetop-0.12.6-ncurses.patch
87 new file mode 100644
88 index 00000000000..f12c989c340
89 --- /dev/null
90 +++ b/app-admin/apachetop/files/apachetop-0.12.6-ncurses.patch
91 @@ -0,0 +1,166 @@
92 +--- a/configure.ac
93 ++++ b/configure.ac
94 +@@ -4,7 +4,7 @@
95 + AC_CONFIG_SRCDIR(src/apachetop.cc)
96 +
97 + AC_CONFIG_AUX_DIR(config)
98 +-#AC_CONFIG_MACRO_DIR(m4) # 2.58
99 ++AC_CONFIG_MACRO_DIR(m4)
100 +
101 + AC_CONFIG_HEADER(config.h)
102 + AM_INIT_AUTOMAKE(apachetop, 0.12.6) # 2.53 only?
103 +@@ -29,7 +29,6 @@
104 + #AC_PROG_CC
105 + #AC_PROG_CPP
106 + AC_PROG_CXX
107 +-AC_LANG_CPLUSPLUS
108 +
109 + # Checks for header files.
110 + AC_HEADER_STDC
111 +@@ -120,24 +119,9 @@
112 +
113 + AC_SEARCH_LIBS([socket], [socket])
114 + AC_SEARCH_LIBS([inet_addr], [nsl])
115 +-AC_SEARCH_LIBS([attron], [ncurses])
116 +-AC_SEARCH_LIBS([tgetstr], [termcap])
117 +-AC_SEARCH_LIBS([mvprintw], [curses ncurses] ,
118 +- [] ,
119 +- [
120 +- AC_MSG_ERROR([No useful curses library found!])
121 +- ]
122 +-)
123 +
124 +-AC_SEARCH_LIBS([readline], [readline],
125 +- [
126 +- AC_DEFINE(HAVE_READLINE,1,[Define if you have readline library])
127 +- AC_SUBST(HAVE_READLINE)
128 +- ] ,
129 +- [
130 +- AC_MSG_ERROR(readline library not found)
131 +- ]
132 +-)
133 ++PKG_CHECK_MODULES([NCURSES], [ncurses])
134 ++AX_LIB_READLINE
135 +
136 +
137 + # everything is in CPPFLAGS up to this point, now we move to CXXFLAGS
138 +--- a/m4/ax_lib_readline.m4
139 ++++ b/m4/ax_lib_readline.m4
140 +@@ -0,0 +1,107 @@
141 ++# ===========================================================================
142 ++# https://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
143 ++# ===========================================================================
144 ++#
145 ++# SYNOPSIS
146 ++#
147 ++# AX_LIB_READLINE
148 ++#
149 ++# DESCRIPTION
150 ++#
151 ++# Searches for a readline compatible library. If found, defines
152 ++# `HAVE_LIBREADLINE'. If the found library has the `add_history' function,
153 ++# sets also `HAVE_READLINE_HISTORY'. Also checks for the locations of the
154 ++# necessary include files and sets `HAVE_READLINE_H' or
155 ++# `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
156 ++# 'HAVE_HISTORY_H' if the corresponding include files exists.
157 ++#
158 ++# The libraries that may be readline compatible are `libedit',
159 ++# `libeditline' and `libreadline'. Sometimes we need to link a termcap
160 ++# library for readline to work, this macro tests these cases too by trying
161 ++# to link with `libtermcap', `libcurses' or `libncurses' before giving up.
162 ++#
163 ++# Here is an example of how to use the information provided by this macro
164 ++# to perform the necessary includes or declarations in a C file:
165 ++#
166 ++# #ifdef HAVE_LIBREADLINE
167 ++# # if defined(HAVE_READLINE_READLINE_H)
168 ++# # include <readline/readline.h>
169 ++# # elif defined(HAVE_READLINE_H)
170 ++# # include <readline.h>
171 ++# # else /* !defined(HAVE_READLINE_H) */
172 ++# extern char *readline ();
173 ++# # endif /* !defined(HAVE_READLINE_H) */
174 ++# char *cmdline = NULL;
175 ++# #else /* !defined(HAVE_READLINE_READLINE_H) */
176 ++# /* no readline */
177 ++# #endif /* HAVE_LIBREADLINE */
178 ++#
179 ++# #ifdef HAVE_READLINE_HISTORY
180 ++# # if defined(HAVE_READLINE_HISTORY_H)
181 ++# # include <readline/history.h>
182 ++# # elif defined(HAVE_HISTORY_H)
183 ++# # include <history.h>
184 ++# # else /* !defined(HAVE_HISTORY_H) */
185 ++# extern void add_history ();
186 ++# extern int write_history ();
187 ++# extern int read_history ();
188 ++# # endif /* defined(HAVE_READLINE_HISTORY_H) */
189 ++# /* no history */
190 ++# #endif /* HAVE_READLINE_HISTORY */
191 ++#
192 ++# LICENSE
193 ++#
194 ++# Copyright (c) 2008 Ville Laurikari <vl@×××.fi>
195 ++#
196 ++# Copying and distribution of this file, with or without modification, are
197 ++# permitted in any medium without royalty provided the copyright notice
198 ++# and this notice are preserved. This file is offered as-is, without any
199 ++# warranty.
200 ++
201 ++#serial 7
202 ++
203 ++AU_ALIAS([VL_LIB_READLINE], [AX_LIB_READLINE])
204 ++AC_DEFUN([AX_LIB_READLINE], [
205 ++ AC_CACHE_CHECK([for a readline compatible library],
206 ++ ax_cv_lib_readline, [
207 ++ ORIG_LIBS="$LIBS"
208 ++ for readline_lib in readline edit editline; do
209 ++ for termcap_lib in "" termcap curses ncurses; do
210 ++ if test -z "$termcap_lib"; then
211 ++ TRY_LIB="-l$readline_lib"
212 ++ else
213 ++ TRY_LIB="-l$readline_lib -l$termcap_lib"
214 ++ fi
215 ++ LIBS="$ORIG_LIBS $TRY_LIB"
216 ++ AC_TRY_LINK_FUNC(readline, ax_cv_lib_readline="$TRY_LIB")
217 ++ if test -n "$ax_cv_lib_readline"; then
218 ++ break
219 ++ fi
220 ++ done
221 ++ if test -n "$ax_cv_lib_readline"; then
222 ++ break
223 ++ fi
224 ++ done
225 ++ if test -z "$ax_cv_lib_readline"; then
226 ++ ax_cv_lib_readline="no"
227 ++ fi
228 ++ LIBS="$ORIG_LIBS"
229 ++ ])
230 ++
231 ++ if test "$ax_cv_lib_readline" != "no"; then
232 ++ LIBS="$LIBS $ax_cv_lib_readline"
233 ++ AC_DEFINE(HAVE_LIBREADLINE, 1,
234 ++ [Define if you have a readline compatible library])
235 ++ AC_CHECK_HEADERS(readline.h readline/readline.h)
236 ++ AC_CACHE_CHECK([whether readline supports history],
237 ++ ax_cv_lib_readline_history, [
238 ++ ax_cv_lib_readline_history="no"
239 ++ AC_TRY_LINK_FUNC(add_history, ax_cv_lib_readline_history="yes")
240 ++ ])
241 ++ if test "$ax_cv_lib_readline_history" = "yes"; then
242 ++ AC_DEFINE(HAVE_READLINE_HISTORY, 1,
243 ++ [Define if your readline library has \`add_history'])
244 ++ AC_CHECK_HEADERS(history.h readline/history.h)
245 ++ fi
246 ++ fi
247 ++])dnl
248 +--- a/src/Makefile.am
249 ++++ b/src/Makefile.am
250 +@@ -6,6 +6,7 @@
251 + display.cc hits_circle.cc timed_circle.cc filters.cc \
252 + resolver.cc
253 +
254 ++apachetop_LDADD = $(NCURSES_LIBS)
255 +
256 + noinst_HEADERS = apachetop.h log.h ohtbl.h map.h queue.h \
257 + display.h hits_circle.h circle.h timed_circle.h filters.h \