うーんうーん

Tritonnプロジェクト 〜 MySQL+Sennaによる全文検索 〜 - Tritonnプロジェクト
http://qwik.jp/tritonn/

が、 patch を組み込んだ形に変わったのはうれしいのですが、
MacPorts で苦労しています ... 。
パッチだと色々楽なんだけどなぁ ... Patch も配布して欲しい:-P

でも、いまなんとか mysql5 +senna が動くよう MacPorts の Portfile 書いてます:-)

できました

Mac OS X Server 10.4.10
MacPorts 1.5.0

で動作確認済み:-)

# $Id: $
PortSystem 1.0

name			mysql5
version			5.0.41
revision                1
categories		databases
platforms		darwin

maintainers		openmaintainer@macports.org jberry@macports.org ryandesign@macports.org

description		Multithreaded SQL database server
long_description	MySQL is an open-source, multi-threaded SQL database \
				with a command syntax very similar to mSQL.

homepage		http://www.mysql.com/

set tritonn_version	1.0.3
set tritonn_sfj         26391

master_sites            http://iij.dl.sourceforge.jp/tritonn/${tritonn_sfj}/ \
                        http://osdn.dl.sourceforge.jp/tritonn/${tritonn_sfj}/ \
                        http://globalbase.dl.sourceforge.jp/tritonn/${tritonn_sfj}/ \
                        http://keihanna.dl.sourceforge.jp/tritonn/${tritonn_sfj}/
                
distname	        mysql-${version}-tritonn-${tritonn_version}
checksums		${distname}${extract.suffix} \
                                md5 377176759470b40c036d42c7d07c1948 \
                                sha1 44fa1cfcdcb894f5a549aa5d3611a9b3d33ef715

depends_lib		port:zlib port:openssl

patchfiles	patch-mysys-base64.c
set dbdir       ${prefix}/var/db/${name}
set mysqluser	mysql

configure.args	--mandir=${prefix}/share/man \
                --infodir=${prefix}/share/info \
                --localstatedir=${dbdir} \
                --libdir=${prefix}/lib/${name} \
                --bindir=${prefix}/lib/${name}/bin \
                --includedir=${prefix}/include/${name} \
                --datadir=${prefix}/share/${name} \
                --sysconfdir=${prefix}/etc/${name} \
                --with-zlib-dir=${prefix} \
                --with-openssl=${prefix} \
                --with-extra-charsets=complex \
                --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \
                --with-mysqld-user=${mysqluser} \
                --without-docs \
                --without-bench \
                --enable-thread-safe-client

platform darwin 8 {
	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0 \
}
				
variant server description {Create a startupitem to start/stop the server} {
	startupitem.create	yes
	startupitem.start	"${prefix}/share/mysql5/mysql/mysql.server start"
	startupitem.stop	"${prefix}/share/mysql5/mysql/mysql.server stop"
}

variant utf8 conflicts ujis description {Set default charset to UTF-8} {
	configure.args-append	--with-charset=utf8
}

variant ujis conflicts utf8 description {Set default charset to ujis (EUC-JP)} {
	configure.args-append	--with-charset=ujis
}

variant all_charsets description {Enable all extra charsets} {
	configure.args-delete	--with-extra-charsets=complex
	configure.args-append	--with-extra-charsets=all
}

variant senna description {Apply Tritonn patch (enables Japanese full-text search by Senna)} {
	depends_lib-append	port:senna port:mecab
	configure.args-append	--with-senna --with-mecab
}

pre-destroot {
	# Some directories we must have in all cases
	xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
	destroot.keepdirs-append ${destroot}${prefix}/etc/${name}
	
	# Setup only for server
	if { [variant_isset server] } {
		addgroup ${mysqluser}
		set gid [existsgroup ${mysqluser}]
		adduser ${mysqluser} gid=${gid} realname=MySQL\ Server

		# Some directories we must have only if we're running as a server
		xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
		
		xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
			${destroot}${dbdir} \
			${destroot}${prefix}/var/run/${name}
		destroot.keepdirs-append  \
			${destroot}${dbdir} \
			${destroot}${prefix}/var/run/${name}
	}
}

post-destroot {
	system "rm -rf ${destroot}${prefix}/mysql-test/"
	
	# Symlink mysql binaries into bin directory, with a 5 appended to the name
	foreach f [glob -tails -directory ${destroot}${prefix}/lib/${name}/bin my*] {
		system "cd ${destroot}${prefix}/bin && ln -sf ../lib/${name}/bin/${f} ${f}5"
	}
}

post-install {
	if { [variant_isset server] } {
		ui_msg "******************************************************"
		ui_msg "* In order to setup the database, you might want to run"
		ui_msg "* sudo -u ${mysqluser} mysql_install_db5"
		ui_msg "* if this is a new install" 
		ui_msg "******************************************************"
	}
}

senna 1.0.8 対応版

# $Id: $

PortSystem      1.0
name            senna
version         1.0.8
categories      textproc japanese
maintainers     rsky0711@gmail.com
platforms       darwin
description     Senna: An Embeddable Fulltext Search Engine
long_description \
    Senna is an embeddable fulltext search engine, which you can use \
    in conjunction with various scripting languages and databases. \
    Senna is an inverted index based engine, and combines the best \
    of n-gram indexing and word indexing to achieve fast, precise searches. \
    While senna codebase is rather compact it is scalable enough to handle \
    large amounts of data and queries.
homepage        http://qwik.jp/senna/

set encoding utf8
set sfj 26563

master_sites    http://osdn.dl.sourceforge.jp/senna/${sfj}/ \
                http://globalbase.dl.sourceforge.jp/senna/${sfj}/ \
                http://keihanna.dl.sourceforge.jp/senna/${sfj}/

checksums   md5    3a6b93afa22a7147c03724d569e97c4e 
depends_lib     port:mecab
depends_run     port:mecab-ipadic-utf8

patchfiles      patch-lib-lex.c
patch.pre_args  -p0

configure.args  --with-encoding=utf8 \
                --with-mecab-config=${prefix}/bin/mecab-config

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/lib/lex.c
    reinplace "s|@ENCODING@|${encoding}|g" ${worksrcpath}/lib/lex.c
}

post-destroot {
    xinstall -o root -m 755 -d \
        ${destroot}${prefix}/share/doc/${name}
    eval file copy [glob ${worksrcpath}/doc/*] \
        ${destroot}${prefix}/share/doc/${name}
}

variant euc {
    set encoding eucjp
    depends_run port:mecab-ipadic-eucjp
    configure.args-delete   --with-encoding=utf8
    configure.args-append   --with-encoding=euc
}