commit:     cc298cee81e631808e1aa9e530a6c50ca90d6a62
Author:     Dagg <daggs <AT> gmx <DOT> com>
AuthorDate: Sat Jan 10 14:21:02 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jan 31 21:24:26 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=cc298cee

www-misc/htdig: rresvport() not supported in musl

---
 .../0001-remove_rresvport_usage_on_musl.patch      | 20 +++++++
 .../htdig/files/htdig-3.2.0_beta6-as-needed.patch  | 61 +++++++++++++++++++
 www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch  | 15 +++++
 .../htdig/files/htdig-3.2.0_beta6-quoting.patch    | 26 +++++++++
 www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild        | 68 ++++++++++++++++++++++
 www-misc/htdig/metadata.xml                        |  5 ++
 6 files changed, 195 insertions(+)

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
new file mode 100644
index 0000000..ba9fab0
--- /dev/null
+++ b/www-misc/htdig/files/0001-remove_rresvport_usage_on_musl.patch
@@ -0,0 +1,20 @@
+--- htnet/Connection.cc.orig   2014-12-27 13:40:45.961149583 +0000
++++ htnet/Connection.cc        2014-12-27 13:45:45.967149583 +0000
+@@ -64,7 +64,7 @@
+ 
+ typedef void (*SIGNAL_HANDLER) (...);
+ 
+-#ifndef _MSC_VER /* _WIN32 */
++#if ! defined(_MSC_VER) && (defined(__GLIBC__) || defined(__UCLIBC__))
+ extern "C" {
+     int rresvport(int *);
+ }
+@@ -162,7 +162,7 @@ int Connection::Open(int priv)
+       int     aport = IPPORT_RESERVED - 1;
+ 
+ //  Native Windows (MSVC) has no rresvport
+-#ifndef _MSC_VER /* _WIN32 */
++#if ! defined(_MSC_VER) && (defined(__GLIBC__) || defined(__UCLIBC__))
+       sock = rresvport(&aport);
+ #else
+       return NOTOK;

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
new file mode 100644
index 0000000..bf455ea
--- /dev/null
+++ b/www-misc/htdig/files/htdig-3.2.0_beta6-as-needed.patch
@@ -0,0 +1,61 @@
+--- htdig-3.2.0b6/Makefile.config.orig 2006-11-19 08:49:57.000000000 -0800
++++ htdig-3.2.0b6/Makefile.config      2006-11-19 08:51:19.000000000 -0800
+@@ -22,10 +22,7 @@
+               $(LOCAL_DEFINES) $(PROFILING)
+ 
+ HTLIBS=               $(top_builddir)/htnet/libhtnet.la \
+-              $(top_builddir)/htcommon/libcommon.la \
+-              $(top_builddir)/htword/libhtword.la \
+               $(top_builddir)/htlib/libht.la \
+               $(top_builddir)/htcommon/libcommon.la \
+               $(top_builddir)/htword/libhtword.la \
+-              $(top_builddir)/db/libhtdb.la \
+-              $(top_builddir)/htlib/libht.la
++              $(top_builddir)/db/libhtdb.la 
+--- htdig-3.2.0b6/htlib/Makefile.am.orig       2006-11-19 09:13:47.000000000 
-0800
++++ htdig-3.2.0b6/htlib/Makefile.am    2006-11-19 09:17:50.000000000 -0800
+@@ -1,7 +1,8 @@
+ include $(top_srcdir)/Makefile.config
+ 
+ pkglib_LTLIBRARIES = libht.la
+-
++libht_la_DEPENDENCIES = $(top_builddir)/db/libhtdb.la
++libht_la_LIBADD= $(top_builddir)/db/libhtdb.la
+ libht_la_SOURCES = Configuration.cc Database.cc Dictionary.cc \
+       DB2_db.cc IntObject.cc List.cc Object.cc \
+       ParsedString.cc Queue.cc QuotedStringList.cc Stack.cc \
+@@ -17,9 +18,6 @@
+       myqsort.c \
+       md5.cc mhash_md5.c 
+ 
+-libht_la_LIBADD=@LTLIBOBJS@
+-# this includes regex.c
+-
+ libht_la_LDFLAGS = -release 
$(HTDIG_MAJOR_VERSION).$(HTDIG_MINOR_VERSION).$(HTDIG_MICRO_VERSION) 
${extra_ldflags}
+ 
+ pkginclude_HEADERS = \
+--- htdig-3.2.0b6/htword/Makefile.am.orig      2006-11-19 08:55:08.000000000 
-0800
++++ htdig-3.2.0b6/htword/Makefile.am   2006-11-19 08:56:51.000000000 -0800
+@@ -10,7 +10,8 @@
+ LOCAL_DEFINES = 
+ 
+ pkglib_LTLIBRARIES = libhtword.la
+-
++libhtword_la_DEPENDENCIES = $(top_builddir)/htlib/libht.la
++libhtword_la_LIBADD = $(top_builddir)/htlib/libht.la
+ libhtword_la_SOURCES = \
+       WordBitCompress.cc \
+       WordContext.cc \
+
+--- htdig-3.2.0b6/htcommon/Makefile.am.orig    2006-11-19 09:32:39.000000000 
-0800
++++ htdig-3.2.0b6/htcommon/Makefile.am 2006-11-19 09:33:42.000000000 -0800
+@@ -12,7 +12,8 @@
+ EXTRA_DIST=conf_lexer.cxx conf_parser.cxx
+ 
+ pkglib_LTLIBRARIES = libcommon.la
+-
++libcommon_la_DEPENDENCIES = $(top_builddir)/htword/libhtword.la
++libcommon_la_LIBADD = $(top_builddir)/htword/libhtword.la
+ libcommon_la_SOURCES = DocumentDB.cc DocumentRef.cc \
+       HtWordReference.cc HtWordList.cc defaults.cc \
+       HtURLCodec.cc URL.cc URLTrans.cc \

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
new file mode 100644
index 0000000..58dec13
--- /dev/null
+++ b/www-misc/htdig/files/htdig-3.2.0_beta6-gcc4.patch
@@ -0,0 +1,15 @@
+diff -Naurp htdig-3.2.0b6.orig/htsearch/Collection.h 
htdig-3.2.0b6/htsearch/Collection.h
+--- htdig-3.2.0b6.orig/htsearch/Collection.h   2004-05-28 06:15:24.000000000 
-0700
++++ htdig-3.2.0b6/htsearch/Collection.h        2006-03-22 11:35:40.000000000 
-0800
+@@ -36,9 +36,9 @@ public:
+                const char *docExcerpt);
+     ~Collection();
+ 
+-    void Collection::Open();
++    void Open();
+ 
+-    void Collection::Close(); 
++    void Close(); 
+ 
+     char *getWordFile() { return wordFile.get(); }
+     DocumentRef         *getDocumentRef(int id);

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
new file mode 100644
index 0000000..57b0e3b
--- /dev/null
+++ b/www-misc/htdig/files/htdig-3.2.0_beta6-quoting.patch
@@ -0,0 +1,26 @@
+Index: htdig-3.2.0b6/htsearch/Display.cc
+===================================================================
+--- htdig-3.2.0b6.orig/htsearch/Display.cc
++++ htdig-3.2.0b6/htsearch/Display.cc
+@@ -137,7 +137,7 @@ Display::display(int pageNumber)
+       // Must temporarily stash the message in a String, since
+       // displaySyntaxError will overwrite the static temp used in form.
+ 
+-      String s(form("No such sort method: `%s'", (const 
char*)config->Find("sort")));
++      String s("invalid sort method");
+ 
+       displaySyntaxError(s);
+       return;
+Index: htdig-3.2.0b6/libhtdig/ResultFetch.cc
+===================================================================
+--- htdig-3.2.0b6.orig/libhtdig/ResultFetch.cc
++++ htdig-3.2.0b6/libhtdig/ResultFetch.cc
+@@ -142,7 +142,7 @@ ResultFetch::fetch()
+         // Must temporarily stash the message in a String, since
+         // displaySyntaxError will overwrite the static temp used in form.
+ 
+-        String s(form("No such sort method: `%s'", (const char *) 
config->Find("sort")));
++        String s("invalid sort method");
+ 
+         displaySyntaxError(s);
+         //return;

diff --git a/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild 
b/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild
new file mode 100644
index 0000000..97bda54
--- /dev/null
+++ b/www-misc/htdig/htdig-3.2.0_beta6-r99.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $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 $
+
+inherit eutils autotools
+
+MY_PV=${PV/_beta/b}
+S=${WORKDIR}/${PN}-${MY_PV}
+
+DESCRIPTION="HTTP/HTML indexing and searching system"
+HOMEPAGE="http://www.htdig.org";
+SRC_URI="http://www.htdig.org/files/${PN}-${MY_PV}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd 
~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux"
+IUSE="ssl"
+
+DEPEND=">=sys-libs/zlib-1.1.3
+       app-arch/unzip
+       ssl? ( dev-libs/openssl )"
+
+src_unpack() {
+       unpack ${A}
+
+       cd "${S}"
+       epatch "${FILESDIR}"/${P}-gcc4.patch
+       epatch "${FILESDIR}"/${P}-as-needed.patch
+       epatch "${FILESDIR}"/${P}-quoting.patch
+       epatch "${FILESDIR}"/0001-remove_rresvport_usage_on_musl.patch
+       epatch_user
+       sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.in 
db/configure.in || die
+       eautoreconf
+}
+
+src_compile() {
+       use prefix || EPREFIX=
+
+       econf \
+               --with-config-dir="${EPREFIX}"/etc/${PN} \
+               --with-default-config-file="${EPREFIX}"/etc/${PN}/${PN}.conf \
+               --with-database-dir="${EPREFIX}"/var/lib/${PN}/db \
+               --with-cgi-bin-dir="${EPREFIX}"/var/www/localhost/cgi-bin \
+               --with-search-dir="${EPREFIX}"/var/www/localhost/htdocs/${PN} \
+               --with-image-dir="${EPREFIX}"/var/www/localhost/htdocs/${PN} \
+               $(use_with ssl)
+
+#              
--with-image-url-prefix="file://${EPREFIX}/var/www/localhost/htdocs/${PN}" \
+
+       emake || die "emake failed"
+}
+
+src_install () {
+       use prefix || ED="${D}"
+
+       emake DESTDIR="${D}" install || die "make install failed"
+
+       dodoc ChangeLog README
+       dohtml -r htdoc
+
+       sed -i "s:${D}::g" \
+               "${ED}"/etc/${PN}/${PN}.conf \
+               "${ED}"/usr/bin/rundig \
+               || die "sed failed (removing \${D} from installed files)"
+
+       # symlink htsearch so it can be easily found. see bug #62087
+       dosym ../../var/www/localhost/cgi-bin/htsearch /usr/bin/htsearch
+}

diff --git a/www-misc/htdig/metadata.xml b/www-misc/htdig/metadata.xml
new file mode 100644
index 0000000..95c06f0
--- /dev/null
+++ b/www-misc/htdig/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<herd>web-apps</herd>
+</pkgmetadata>

Reply via email to