From 28cbd71fcbaf9fc25408a92874a19c1a3e4113b0 Mon Sep 17 00:00:00 2001
From: Matsuu Takuto <matsuu@gentoo.org>
Date: Sat, 15 Nov 2008 00:03:50 +0000
Subject: Fixed to work with old versions, bug #239594. (Portage version:
 2.2_rc13/cvs/Linux 2.6.27-gentoo x86_64)

---
 dev-db/pgmecab/ChangeLog                           |  8 +++-
 .../pgmecab/files/pgmecab-1.1-r3-postgres83.patch  | 20 ++++++++++
 dev-db/pgmecab/pgmecab-1.1-r3.ebuild               | 43 ++++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 dev-db/pgmecab/files/pgmecab-1.1-r3-postgres83.patch
 create mode 100644 dev-db/pgmecab/pgmecab-1.1-r3.ebuild

(limited to 'dev-db')

diff --git a/dev-db/pgmecab/ChangeLog b/dev-db/pgmecab/ChangeLog
index f29f5b8fd123..61f76742f58e 100644
--- a/dev-db/pgmecab/ChangeLog
+++ b/dev-db/pgmecab/ChangeLog
@@ -1,6 +1,12 @@
 # ChangeLog for dev-db/pgmecab
 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgmecab/ChangeLog,v 1.4 2008/11/02 08:55:33 matsuu Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/pgmecab/ChangeLog,v 1.5 2008/11/15 00:03:50 matsuu Exp $
+
+*pgmecab-1.1-r3 (15 Nov 2008)
+
+  15 Nov 2008; MATSUU Takuto <matsuu@gentoo.org>
+  +files/pgmecab-1.1-r3-postgres83.patch, +pgmecab-1.1-r3.ebuild:
+  Fixed to work with old versions, bug #239594.
 
 *pgmecab-1.1-r2 (02 Nov 2008)
 
diff --git a/dev-db/pgmecab/files/pgmecab-1.1-r3-postgres83.patch b/dev-db/pgmecab/files/pgmecab-1.1-r3-postgres83.patch
new file mode 100644
index 000000000000..4bd4483bd18f
--- /dev/null
+++ b/dev-db/pgmecab/files/pgmecab-1.1-r3-postgres83.patch
@@ -0,0 +1,20 @@
+--- pgmecab.c.orig	2008-10-05 13:24:34.000000000 +0200
++++ pgmecab.c	2008-10-05 13:25:17.000000000 +0200
+@@ -24,7 +24,7 @@
+ static Datum returnEmptyStr()
+ {
+ 	text* emptyVal = (text*) palloc(VARHDRSZ);
+-	VARATT_SIZEP(emptyVal) = VARHDRSZ;
++	SET_VARSIZE(emptyVal, VARHDRSZ);
+ 	PG_RETURN_TEXT_P(emptyVal);
+ }
+ 
+@@ -90,7 +90,7 @@
+ 	
+ 	/* �֤�����Υ������ */
+ 	text* return_val = (text *) palloc(VARHDRSZ + mecab_result_size * sizeof(char));
+-	VARATT_SIZEP(return_val) = VARHDRSZ + mecab_result_size * sizeof(char);
++	SET_VARSIZE(return_val, VARHDRSZ + mecab_result_size * sizeof(char));
+ 	
+ 	/* ��̤򥳥ԡ� */
+ 	memcpy((void*)VARDATA(return_val), mecab_result, mecab_result_size);
diff --git a/dev-db/pgmecab/pgmecab-1.1-r3.ebuild b/dev-db/pgmecab/pgmecab-1.1-r3.ebuild
new file mode 100644
index 000000000000..c4ec361f7b6d
--- /dev/null
+++ b/dev-db/pgmecab/pgmecab-1.1-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/pgmecab/pgmecab-1.1-r3.ebuild,v 1.1 2008/11/15 00:03:50 matsuu Exp $
+
+inherit eutils versionator
+
+DESCRIPTION="PostgreSQL function to Wakachigaki for Japanese words"
+HOMEPAGE="http://www.emaki.minidns.net/Programming/postgres/index.html"
+SRC_URI="http://www.emaki.minidns.net/Programming/postgres/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="app-text/mecab
+	>=virtual/postgresql-server-7.4"
+DEPEND="${RDEPEND}
+	app-admin/eselect-postgresql"
+
+src_unpack () {
+	unpack ${A}
+	cd "${S}"
+	epatch "${FILESDIR}/${P}-gentoo.patch"
+
+	# Bug #239594
+	PGVER=( $(get_version_components $(eselect postgresql show)) )
+	PGMAJOR="${PGVER[0]}"
+	PGMINOR="${PGVER[1]}"
+	if [ ${PGMAJOR} -eq 8 -a ${PGMINOR} -gt 2 -o ${PGMAJOR} -gt 8 ] ; then
+		epatch "${FILESDIR}/${PF}-postgres83.patch"
+	fi
+}
+
+src_compile() {
+	emake USE_PGXS=1 || die
+}
+
+src_install() {
+	emake DESTDIR="${D}" USE_PGXS=1 install || die
+
+	dodoc README.pgmecab
+}
-- 
cgit v1.2.3-65-gdbad