Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: www-misc/htdig/files/, www-misc/htdig/
Date: Sat, 31 Jan 2015 21:22:37
Message-Id: 1422739466.cc298cee81e631808e1aa9e530a6c50ca90d6a62.blueness@gentoo
1 commit: cc298cee81e631808e1aa9e530a6c50ca90d6a62
2 Author: Dagg <daggs <AT> gmx <DOT> com>
3 AuthorDate: Sat Jan 10 14:21:02 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 31 21:24:26 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=cc298cee
7
8 www-misc/htdig: rresvport() not supported in musl
9
10 ---
11 .../0001-remove_rresvport_usage_on_musl.patch | 20 +++++++
12 .../htdig/files/htdig-3.2.0_beta6-as-needed.patch | 61 +++++++++++++++++++
13 www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch | 15 +++++
14 .../htdig/files/htdig-3.2.0_beta6-quoting.patch | 26 +++++++++
15 www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild | 68 ++++++++++++++++++++++
16 www-misc/htdig/metadata.xml | 5 ++
17 6 files changed, 195 insertions(+)
18
19 diff --git a/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch b/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch
20 new file mode 100644
21 index 0000000..ba9fab0
22 --- /dev/null
23 +++ b/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch
24 @@ -0,0 +1,20 @@
25 +--- htnet/Connection.cc.orig 2014-12-27 13:40:45.961149583 +0000
26 ++++ htnet/Connection.cc 2014-12-27 13:45:45.967149583 +0000
27 +@@ -64,7 +64,7 @@
28 +
29 + typedef void (*SIGNAL_HANDLER) (...);
30 +
31 +-#ifndef _MSC_VER /* _WIN32 */
32 ++#if ! defined(_MSC_VER) && (defined(__GLIBC__) || defined(__UCLIBC__))
33 + extern "C" {
34 + int rresvport(int *);
35 + }
36 +@@ -162,7 +162,7 @@ int Connection::Open(int priv)
37 + int aport = IPPORT_RESERVED - 1;
38 +
39 + // Native Windows (MSVC) has no rresvport
40 +-#ifndef _MSC_VER /* _WIN32 */
41 ++#if ! defined(_MSC_VER) && (defined(__GLIBC__) || defined(__UCLIBC__))
42 + sock = rresvport(&aport);
43 + #else
44 + return NOTOK;
45
46 diff --git a/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch b/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch
47 new file mode 100644
48 index 0000000..bf455ea
49 --- /dev/null
50 +++ b/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch
51 @@ -0,0 +1,61 @@
52 +--- htdig-3.2.0b6/Makefile.config.orig 2006-11-19 08:49:57.000000000 -0800
53 ++++ htdig-3.2.0b6/Makefile.config 2006-11-19 08:51:19.000000000 -0800
54 +@@ -22,10 +22,7 @@
55 + $(LOCAL_DEFINES) $(PROFILING)
56 +
57 + HTLIBS= $(top_builddir)/htnet/libhtnet.la \
58 +- $(top_builddir)/htcommon/libcommon.la \
59 +- $(top_builddir)/htword/libhtword.la \
60 + $(top_builddir)/htlib/libht.la \
61 + $(top_builddir)/htcommon/libcommon.la \
62 + $(top_builddir)/htword/libhtword.la \
63 +- $(top_builddir)/db/libhtdb.la \
64 +- $(top_builddir)/htlib/libht.la
65 ++ $(top_builddir)/db/libhtdb.la
66 +--- htdig-3.2.0b6/htlib/Makefile.am.orig 2006-11-19 09:13:47.000000000 -0800
67 ++++ htdig-3.2.0b6/htlib/Makefile.am 2006-11-19 09:17:50.000000000 -0800
68 +@@ -1,7 +1,8 @@
69 + include $(top_srcdir)/Makefile.config
70 +
71 + pkglib_LTLIBRARIES = libht.la
72 +-
73 ++libht_la_DEPENDENCIES = $(top_builddir)/db/libhtdb.la
74 ++libht_la_LIBADD= $(top_builddir)/db/libhtdb.la
75 + libht_la_SOURCES = Configuration.cc Database.cc Dictionary.cc \
76 + DB2_db.cc IntObject.cc List.cc Object.cc \
77 + ParsedString.cc Queue.cc QuotedStringList.cc Stack.cc \
78 +@@ -17,9 +18,6 @@
79 + myqsort.c \
80 + md5.cc mhash_md5.c
81 +
82 +-libht_la_LIBADD=@LTLIBOBJS@
83 +-# this includes regex.c
84 +-
85 + libht_la_LDFLAGS = -release $(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) ${extra_ldflags}
86 +
87 + pkginclude_HEADERS = \
88 +--- htdig-3.2.0b6/htword/Makefile.am.orig 2006-11-19 08:55:08.000000000 -0800
89 ++++ htdig-3.2.0b6/htword/Makefile.am 2006-11-19 08:56:51.000000000 -0800
90 +@@ -10,7 +10,8 @@
91 + LOCAL_DEFINES =
92 +
93 + pkglib_LTLIBRARIES = libhtword.la
94 +-
95 ++libhtword_la_DEPENDENCIES = $(top_builddir)/htlib/libht.la
96 ++libhtword_la_LIBADD = $(top_builddir)/htlib/libht.la
97 + libhtword_la_SOURCES = \
98 + WordBitCompress.cc \
99 + WordContext.cc \
100 +
101 +--- htdig-3.2.0b6/htcommon/Makefile.am.orig 2006-11-19 09:32:39.000000000 -0800
102 ++++ htdig-3.2.0b6/htcommon/Makefile.am 2006-11-19 09:33:42.000000000 -0800
103 +@@ -12,7 +12,8 @@
104 + EXTRA_DIST=conf_lexer.cxx conf_parser.cxx
105 +
106 + pkglib_LTLIBRARIES = libcommon.la
107 +-
108 ++libcommon_la_DEPENDENCIES = $(top_builddir)/htword/libhtword.la
109 ++libcommon_la_LIBADD = $(top_builddir)/htword/libhtword.la
110 + libcommon_la_SOURCES = DocumentDB.cc DocumentRef.cc \
111 + HtWordReference.cc HtWordList.cc defaults.cc \
112 + HtURLCodec.cc URL.cc URLTrans.cc \
113
114 diff --git a/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch b/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch
115 new file mode 100644
116 index 0000000..58dec13
117 --- /dev/null
118 +++ b/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch
119 @@ -0,0 +1,15 @@
120 +diff -Naurp htdig-3.2.0b6.orig/htsearch/Collection.h htdig-3.2.0b6/htsearch/Collection.h
121 +--- htdig-3.2.0b6.orig/htsearch/Collection.h 2004-05-28 06:15:24.000000000 -0700
122 ++++ htdig-3.2.0b6/htsearch/Collection.h 2006-03-22 11:35:40.000000000 -0800
123 +@@ -36,9 +36,9 @@ public:
124 + const char *docExcerpt);
125 + ~Collection();
126 +
127 +- void Collection::Open();
128 ++ void Open();
129 +
130 +- void Collection::Close();
131 ++ void Close();
132 +
133 + char *getWordFile() { return wordFile.get(); }
134 + DocumentRef *getDocumentRef(int id);
135
136 diff --git a/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch b/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch
137 new file mode 100644
138 index 0000000..57b0e3b
139 --- /dev/null
140 +++ b/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch
141 @@ -0,0 +1,26 @@
142 +Index: htdig-3.2.0b6/htsearch/Display.cc
143 +===================================================================
144 +--- htdig-3.2.0b6.orig/htsearch/Display.cc
145 ++++ htdig-3.2.0b6/htsearch/Display.cc
146 +@@ -137,7 +137,7 @@ Display::display(int pageNumber)
147 + // Must temporarily stash the message in a String, since
148 + // displaySyntaxError will overwrite the static temp used in form.
149 +
150 +- String s(form("No such sort method: `%s'", (const char*)config->Find("sort")));
151 ++ String s("invalid sort method");
152 +
153 + displaySyntaxError(s);
154 + return;
155 +Index: htdig-3.2.0b6/libhtdig/ResultFetch.cc
156 +===================================================================
157 +--- htdig-3.2.0b6.orig/libhtdig/ResultFetch.cc
158 ++++ htdig-3.2.0b6/libhtdig/ResultFetch.cc
159 +@@ -142,7 +142,7 @@ ResultFetch::fetch()
160 + // Must temporarily stash the message in a String, since
161 + // displaySyntaxError will overwrite the static temp used in form.
162 +
163 +- String s(form("No such sort method: `%s'", (const char *) config->Find("sort")));
164 ++ String s("invalid sort method");
165 +
166 + displaySyntaxError(s);
167 + //return;
168
169 diff --git a/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild b/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild
170 new file mode 100644
171 index 0000000..97bda54
172 --- /dev/null
173 +++ b/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild
174 @@ -0,0 +1,68 @@
175 +# Copyright 1999-2013 Gentoo Foundation
176 +# Distributed under the terms of the GNU General Public License v2
177 +# $Header: /var/cvsroot/gentoo-x86/www-misc/htdig/htdig-3.2.0_beta6-r3.ebuild,v 1.12 2013/05/02 04:13:35 patrick Exp $
178 +
179 +inherit eutils autotools
180 +
181 +MY_PV=${PV/_beta/b}
182 +S=${WORKDIR}/${PN}-${MY_PV}
183 +
184 +DESCRIPTION="HTTP/HTML indexing and searching system"
185 +HOMEPAGE="http://www.htdig.org"
186 +SRC_URI="http://www.htdig.org/files/${PN}-${MY_PV}.tar.gz"
187 +
188 +LICENSE="GPL-2"
189 +SLOT="0"
190 +KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
191 +IUSE="ssl"
192 +
193 +DEPEND=">=sys-libs/zlib-1.1.3
194 + app-arch/unzip
195 + ssl? ( dev-libs/openssl )"
196 +
197 +src_unpack() {
198 + unpack ${A}
199 +
200 + cd "${S}"
201 + epatch "${FILESDIR}"/${P}-gcc4.patch
202 + epatch "${FILESDIR}"/${P}-as-needed.patch
203 + epatch "${FILESDIR}"/${P}-quoting.patch
204 + epatch "${FILESDIR}"/0001-remove_rresvport_usage_on_musl.patch
205 + epatch_user
206 + sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.in db/configure.in || die
207 + eautoreconf
208 +}
209 +
210 +src_compile() {
211 + use prefix || EPREFIX=
212 +
213 + econf \
214 + --with-config-dir="${EPREFIX}"/etc/${PN} \
215 + --with-default-config-file="${EPREFIX}"/etc/${PN}/${PN}.conf \
216 + --with-database-dir="${EPREFIX}"/var/lib/${PN}/db \
217 + --with-cgi-bin-dir="${EPREFIX}"/var/www/localhost/cgi-bin \
218 + --with-search-dir="${EPREFIX}"/var/www/localhost/htdocs/${PN} \
219 + --with-image-dir="${EPREFIX}"/var/www/localhost/htdocs/${PN} \
220 + $(use_with ssl)
221 +
222 +# --with-image-url-prefix="file://${EPREFIX}/var/www/localhost/htdocs/${PN}" \
223 +
224 + emake || die "emake failed"
225 +}
226 +
227 +src_install () {
228 + use prefix || ED="${D}"
229 +
230 + emake DESTDIR="${D}" install || die "make install failed"
231 +
232 + dodoc ChangeLog README
233 + dohtml -r htdoc
234 +
235 + sed -i "s:${D}::g" \
236 + "${ED}"/etc/${PN}/${PN}.conf \
237 + "${ED}"/usr/bin/rundig \
238 + || die "sed failed (removing \${D} from installed files)"
239 +
240 + # symlink htsearch so it can be easily found. see bug #62087
241 + dosym ../../var/www/localhost/cgi-bin/htsearch /usr/bin/htsearch
242 +}
243
244 diff --git a/www-misc/htdig/metadata.xml b/www-misc/htdig/metadata.xml
245 new file mode 100644
246 index 0000000..95c06f0
247 --- /dev/null
248 +++ b/www-misc/htdig/metadata.xml
249 @@ -0,0 +1,5 @@
250 +<?xml version="1.0" encoding="UTF-8"?>
251 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
252 +<pkgmetadata>
253 +<herd>web-apps</herd>
254 +</pkgmetadata>