From a8eb7c738bda8f9bdce503eeeaddeaf351bbc95f Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Fri, 10 Jul 2015 01:24:27 +0000 Subject: [PATCH] Add mail/mailest, hyper estraier search engine backend for mail/mew. --- mail/Makefile | 1 + mail/mailest/Makefile | 34 ++++++++++++++++ mail/mailest/distinfo | 2 + mail/mailest/files/patch-mailestd-Makefile | 29 +++++++++++++ mail/mailest/files/patch-mailestd.c | 47 ++++++++++++++++++++++ mail/mailest/pkg-descr | 4 ++ mail/mailest/pkg-message | 29 +++++++++++++ mail/mailest/pkg-plist | 11 +++++ 8 files changed, 157 insertions(+) create mode 100644 mail/mailest/Makefile create mode 100644 mail/mailest/distinfo create mode 100644 mail/mailest/files/patch-mailestd-Makefile create mode 100644 mail/mailest/files/patch-mailestd.c create mode 100644 mail/mailest/pkg-descr create mode 100644 mail/mailest/pkg-message create mode 100644 mail/mailest/pkg-plist diff --git a/mail/Makefile b/mail/Makefile index ff3f810df7ee..30aa208ba9c8 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -215,6 +215,7 @@ SUBDIR += mailagent SUBDIR += maildirsync SUBDIR += maildrop + SUBDIR += mailest SUBDIR += mailfmt SUBDIR += mailfront SUBDIR += mailgraph diff --git a/mail/mailest/Makefile b/mail/mailest/Makefile new file mode 100644 index 000000000000..5cd8b269cece --- /dev/null +++ b/mail/mailest/Makefile @@ -0,0 +1,34 @@ +# $FreeBSD$ + +PORTNAME= mailest +PORTVERSION= 0.9.20 +CATEGORIES= mail + +MAINTAINER= hrs@FreeBSD.org +COMMENT= Hyper Estraier backend for Mew + +LICENSE= BSD2CLAUSE ISCL LGPL21 +LICENSE_COMB= multi +LICENSE_FILE_BSD2CLAUSE=${WRKSRC}/LICENSE.BSD2CLAUSE +LICENSE_FILE_ISCL= ${WRKSRC}/LICENSE.ISCL +LICENSE_FILE_LGPL21= ${WRKSRC}/LICENSE.LGPL21 + +LIB_DEPENDS= libevent.so:${PORTSDIR}/devel/libevent2 \ + libqdbm.so:${PORTSDIR}/databases/qdbm +RUN_DEPENDS= mewl:${PORTSDIR}/mail/mew \ + estcmd:${PORTSDIR}/textproc/hyperestraier + +USES= iconv +USE_EMACS= yes +USE_GITHUB= yes +GH_ACCOUNT= yasuoka +GH_TAGNAME= ${PORTNAME}-${PORTVERSION} +MAKE_ENV= USE_BSDMAKE=true WITH_INSTALL_AS_USER=true + +post-extract: + ${SED} "/\*-/,/*\//!d" ${WRKSRC}/bytebuf.c > ${LICENSE_FILE_BSD2CLAUSE} + ${SED} "/^\/\*/,/ *\//!d" ${WRKSRC}/mailestctl.c > ${LICENSE_FILE_ISCL} + ${SED} "/^\/\*\*/,/\*\*\//!d" ${WRKSRC}/estdraft.c \ + > ${LICENSE_FILE_LGPL21} + +.include diff --git a/mail/mailest/distinfo b/mail/mailest/distinfo new file mode 100644 index 000000000000..f23d934a3fdc --- /dev/null +++ b/mail/mailest/distinfo @@ -0,0 +1,2 @@ +SHA256 (yasuoka-mailest-0.9.20-mailest-0.9.20_GH0.tar.gz) = f51cde2047422c993425eee8102e5f7a914094b60a1a039a0b84502e5d22c5f8 +SIZE (yasuoka-mailest-0.9.20-mailest-0.9.20_GH0.tar.gz) = 171958 diff --git a/mail/mailest/files/patch-mailestd-Makefile b/mail/mailest/files/patch-mailestd-Makefile new file mode 100644 index 000000000000..c1aee6e150b6 --- /dev/null +++ b/mail/mailest/files/patch-mailestd-Makefile @@ -0,0 +1,29 @@ +--- mailestd/Makefile.orig 2015-05-27 12:18:27.000000000 +0900 ++++ mailestd/Makefile 2015-06-05 16:09:10.228594000 +0900 +@@ -2,9 +2,9 @@ + + PROG= mailestd + SRCS= bytebuf.c mailestd.c mailestctl.c parse.y parser.c +-LINKS= ${BINDIR}/mailestd ${LOCALBASE}/bin/mailestctl ++LINKS= ${BINDIR}/${PROG} ${BINDIR}/mailestctl + CFLAGS+= -DHAVE_LIBESTDRAFT -DMONITOR_KQUEUE +-LIBESTDRAFTOBJ!=cd ${.CURDIR}/../libestdraft; ${MAKE} _whereobj ++LIBESTDRAFTOBJ!=cd ${.CURDIR}/../libestdraft; ${MAKE} -V.OBJDIR + LDFLAGS= -L${LOCALBASE}/lib + LDADD= -lestraier -levent -lqdbm + DPADD= ${LIBESTRAIER} ${LIBEVENT} ${LIBQDBM} +@@ -21,13 +21,7 @@ + DPADD+= ${LIBPTHREAD} + .endif + +-beforeinstall: +- ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ +- ${.CURDIR}/../mew-mailest.sh ${PREFIX}/bin/mew-mailest +- ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ +- ${.CURDIR}/../cmew-mailest.sh ${PREFIX}/bin/cmew-mailest +- ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ +- ${.CURDIR}/../smew-mailest.sh ${PREFIX}/bin/smew-mailest ++SCRIPTS= mew-mailest.sh cmew-mailest.sh smew-mailest.sh + + LDFLAGS+= -L${LIBESTDRAFTOBJ} + LDADD+= -lestdraft diff --git a/mail/mailest/files/patch-mailestd.c b/mail/mailest/files/patch-mailestd.c new file mode 100644 index 000000000000..3421d0c49550 --- /dev/null +++ b/mail/mailest/files/patch-mailestd.c @@ -0,0 +1,47 @@ +--- mailestd.c.orig 2015-05-27 12:18:27.000000000 +0900 ++++ mailestd.c 2015-06-05 16:21:58.350309000 +0900 +@@ -809,8 +809,6 @@ + + RB_INIT(&folders); + ctx = mailestd_get_gather(_this, task->gather_id); +- mailestd_log(LOG_DEBUG, "Gathering %s ...", mailestd_folder_name( +- _this, folder, buf, sizeof(buf))); + if (folder[0] == '/') + strlcpy(rdir, folder, sizeof(rdir)); + else { +@@ -818,6 +816,8 @@ + strlcat(rdir, "/", sizeof(rdir)); + strlcat(rdir, folder, sizeof(rdir)); + } ++ mailestd_log(LOG_DEBUG, "Gathering %s ...", mailestd_folder_name( ++ _this, rdir, buf, sizeof(buf))); + paths[0] = rdir; + paths[1] = NULL; + lrdir = strlen(rdir); +@@ -853,7 +853,7 @@ + } + + mailestd_log(LOG_DEBUG, "Gathered %s (Total: %d Remove: %d Update: %d)", +- mailestd_folder_name(_this, folder, buf, sizeof(buf)), ++ mailestd_folder_name(_this, rdir, buf, sizeof(buf)), + total, delete, update); + out: + if (ctx != NULL) { +@@ -2638,6 +2638,7 @@ + mailestd_monitor_folder(struct mailestd *_this, const char *dirpath) + { + int fd = -1; ++ char buf[PATH_MAX]; + struct folder *fld, fld0; + + MAILESTD_ASSERT(_thread_self() == _this->monitorworker.thread); +@@ -2659,7 +2660,8 @@ + fld->fd = fd; + fld->path = xstrdup(dirpath); + RB_INSERT(folder_tree, &_this->monitors, fld); +- mailestd_log(LOG_DEBUG, "Start monitoring %s", dirpath); ++ mailestd_log(LOG_DEBUG, "Start monitoring %s", ++ mailestd_folder_name(_this, dirpath, buf, sizeof(buf))); + } + + static void diff --git a/mail/mailest/pkg-descr b/mail/mailest/pkg-descr new file mode 100644 index 000000000000..def69de02626 --- /dev/null +++ b/mail/mailest/pkg-descr @@ -0,0 +1,4 @@ +mailest provides a search backend and id index database for +Mew using Hyper Estraier. + +WWW: https://github.com/yasuoka/mailest diff --git a/mail/mailest/pkg-message b/mail/mailest/pkg-message new file mode 100644 index 000000000000..3b020ca7990a --- /dev/null +++ b/mail/mailest/pkg-message @@ -0,0 +1,29 @@ +------------ +How to start +------------ + ++ For existing `mewest` user, backup and/or delete the database + (`~/Mail/casket`) + + - Since "mailestd" can work with the old database, so OK to skip deleting + `~/Mail/casket`, but remark that `V` will not work against the mails + which are indexed by `mewest`. To make `V` work against them, delete + the database in advance. + ++ Add the below line to `.mew.el` to let Mew use "Hyper Estrairer" for + search. + + ((setq mew-search-method 'est) + ++ Add the below lines to `~/.emacs` use use the "mailest" instead of + existing "mewest". + + (defvar mew-prog-est "mew-mailest") + (defvar mew-prog-est-update "mew-mailest") + (defvar mew-prog-cmew "cmew-mailest") + (defvar mew-prog-smew "smew-mailest") + (defvar mew-id-db-file ".mailest.sock") + ++ Try `km`, `kM`, `k/`, `k?`, `V` in Mew. See + http://mew.org/en/info/release/mew_6.html#dbsearch for search commands + in Mew. diff --git a/mail/mailest/pkg-plist b/mail/mailest/pkg-plist new file mode 100644 index 000000000000..3a5dbbaed99e --- /dev/null +++ b/mail/mailest/pkg-plist @@ -0,0 +1,11 @@ +sbin/cmew-mailest +sbin/mailestctl +sbin/mew-mailest +sbin/smew-mailest +sbin/mailestd +man/man1/cmew-mailest.1.gz +man/man1/mailestctl.1.gz +man/man1/mew-mailest.1.gz +man/man1/smew-mailest.1.gz +man/man5/mailestd.conf.5.gz +man/man8/mailestd.8.gz