1 |
# $MidnightBSD$ |
2 |
# $FreeBSD: ports/textproc/sphinxsearch/Makefile,v 1.15 2011/03/19 13:15:30 ale Exp $ |
3 |
# |
4 |
# Note: the Sphinx Storage Engine MySQL plugin is not supported by |
5 |
# this port. You need a patched version of mysql server for that. |
6 |
# See http://www.infracaninophile.co.uk/articles/sphinxse.html |
7 |
|
8 |
PORTNAME= sphinxsearch |
9 |
PORTVERSION= 2.2.7 |
10 |
CATEGORIES= textproc databases |
11 |
MASTER_SITES= http://sphinxsearch.com/files/ \ |
12 |
http://snowball.tartarus.org/dist/:libstemmer |
13 |
DISTNAME= sphinx-${PORTVERSION}-release |
14 |
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} |
15 |
|
16 |
MAINTAINER= ports@MidnightBSD.org |
17 |
COMMENT= Sphinx Full-Text Search Engine |
18 |
|
19 |
LICENSE= gpl2 |
20 |
|
21 |
# If expat is present on the system and configure finds it, it will |
22 |
# unconditionally link the output binary against it. There's no way |
23 |
# of turning this off. So for consistency, make sure it's always on. |
24 |
LIB_DEPENDS= libexpat.so:${PORTSDIR}/textproc/expat2 |
25 |
|
26 |
OPTIONS_DEFINE= ICONV ID64 LIBSTEMMER MYSQL OPTIMIZED_CFLAGS PGSQL \ |
27 |
RE2 SYSLOG UNIXODBC DOCS |
28 |
OPTIONS_DEFAULT=ICONV MYSQL SYSLOG |
29 |
|
30 |
ICONV_CONFIGURE_WITH= iconv |
31 |
ICONV_USES= iconv |
32 |
ICONV_LDFLAGS= ${ICONV_LIB} |
33 |
|
34 |
# Changes document and word IDs to a 64bit type, useful if you have |
35 |
# more than about 4.2E9 such items to deal with. Means corresponding |
36 |
# changes in DB schema. Disabled by default. |
37 |
ID64_DESC= Use 64-bit document and word IDs |
38 |
ID64_CONFIGURE_ENABLE= id64 |
39 |
|
40 |
# Note: The snowball project doesn't release numbered versions of it's |
41 |
# pre-processors. Instead, at arbitrary but fairly long intervals a |
42 |
# snapshot of their source repository is turned into a tarball (always |
43 |
# the same filename) and placed on their web site. It's like they |
44 |
# want to make it as hard as possible for anyone to package and use |
45 |
# their software. |
46 |
# |
47 |
# Adds support for two additional word stemmming pre-processors from |
48 |
# the Snowball project (http://snowball.tartarus.org/) -- these |
49 |
# essentially do exactly the same thing as the built in English, |
50 |
# Russian and Czech stemmers but also support French, Spanish, |
51 |
# Portuguese, Italian, Romanian, German, Dutch, Swedish, Norwegian, |
52 |
# Danish, Finnish, Hungarian. Disabled by default. |
53 |
LIBSTEMMER_DESC= Compile with libstemmer support |
54 |
LIBSTEMMER_CONFIGURE_WITH=libstemmer |
55 |
LIBSTEMMER_DISTNAME= libstemmer_c |
56 |
LIBSTEMMER_DISTFILES= ${LIBSTEMMER_DISTNAME}.tgz:libstemmer |
57 |
|
58 |
.if make(makesum) || defined(FETCH_ALL) |
59 |
OPTIONS_SET_FORCE= LIBSTEMMER |
60 |
.endif |
61 |
|
62 |
# The port will successfully compile with both PGSQL and MYSQL support |
63 |
# simultaneously. Not sure how useful that is in practice though. |
64 |
|
65 |
MYSQL_CONFIGURE_WITH= mysql |
66 |
MYSQL_CONFIGURE_ON= --with-mysql-includes=${LOCALBASE}/include/mysql \ |
67 |
--with-mysql-libs=${LOCALBASE}/lib/mysql |
68 |
MYSQL_USE= mysql |
69 |
|
70 |
OPTIMIZED_CFLAGS_CXXFLAGS=-O3 -fomit-frame-pointer |
71 |
|
72 |
PGSQL_CONFIGURE_WITH= pgsql |
73 |
PGSQL_CONFIGURE_ON= --with-pgsql-includes=${LOCALBASE}/include \ |
74 |
--with-pgsql-libs=${LOCALBASE}/lib |
75 |
PGSQL_USES= pgsql |
76 |
|
77 |
# Why does this insist on linking against the libre2.a static library? |
78 |
|
79 |
RE2_DESC= Enable re2 regular expression library |
80 |
RE2_CONFIGURE_WITH= re2 |
81 |
RE2_BUILD_DEPENDS= ${LOCALBASE}/lib/libre2.a:${PORTSDIR}/devel/re2 |
82 |
|
83 |
SYSLOG_DESC= Enable logging via syslog |
84 |
SYSLOG_CONFIGURE_WITH= syslog |
85 |
|
86 |
UNIXODBC_CONFIGURE_WITH=unixodbc |
87 |
UNIXODBC_LIB_DEPENDS= libodbc.so:${PORTSDIR}/databases/unixODBC |
88 |
|
89 |
CONFLICTS= sphinxsearch-devel-[0-9]* dpsearch-[0-9]* rdb-[0-9]* \ |
90 |
swish++-[0-9]* xaira-[0-9]* |
91 |
|
92 |
.include <bsd.mport.options.mk> |
93 |
|
94 |
USERS?= _sphinx |
95 |
GROUPS?= _sphinx |
96 |
|
97 |
SPHINX_DIR?= /var/db/${PORTNAME} |
98 |
SPHINX_RUN?= /var/run/${PORTNAME} |
99 |
SPHINX_LOG?= /var/log/${PORTNAME} |
100 |
|
101 |
# Yes, the conflation of CPPFLAGS and CXXFLAGS is deliberate. No, |
102 |
# don't ask. |
103 |
|
104 |
GNU_CONFIGURE= yes |
105 |
CPPFLAGS+= ${CXXFLAGS} |
106 |
CFGFILE= ${PREFIX}/etc/sphinx.conf |
107 |
USE_RC_SUBR= sphinxsearch |
108 |
SUB_LIST+= PORTNAME=${PORTNAME} \ |
109 |
CFGFILE=${CFGFILE} \ |
110 |
SPHINX_USR=${USERS} \ |
111 |
SPHINX_GRP=${GROUPS} \ |
112 |
SPHINX_DIR=${SPHINX_DIR} \ |
113 |
SPHINX_RUN=${SPHINX_RUN} \ |
114 |
SPHINX_LOG=${SPHINX_LOG} |
115 |
SUB_FILES+= pkg-deinstall |
116 |
|
117 |
EXAMPLES= example.sql api |
118 |
|
119 |
DOCS= doc/sphinx.css doc/sphinx.html doc/sphinx.txt doc/sphinx.xml |
120 |
DOCSRC= ${WRKSRC}/doc |
121 |
|
122 |
MAN1SRC= indexer.1 indextool.1 spelldump.1 |
123 |
MAN8SRC= searchd.8 |
124 |
|
125 |
post-extract: |
126 |
.if ${PORT_OPTIONS:MLIBSTEMMER} |
127 |
@( cd ${WRKDIR} && ${COPYTREE_SHARE} ${LIBSTEMMER_DISTNAME} ${WRKSRC} ) |
128 |
.endif |
129 |
|
130 |
# Fix up the sample configuration file to correspond to FreeBSD norms |
131 |
post-patch: |
132 |
@${REINPLACE_CMD} \ |
133 |
-e "s!@CONFDIR@/log/searchd.pid!${SPHINX_RUN}/searchd.pid!" \ |
134 |
-e "s!@CONFDIR@/log/query.log!${SPHINX_LOG}/sphinx-query.log!" \ |
135 |
-e "s!@CONFDIR@/log/searchd.log!${SPHINX_LOG}/searchd.log!" \ |
136 |
-e "s!@CONFDIR@!${SPHINX_DIR}!" \ |
137 |
${WRKSRC}/sphinx.conf.in |
138 |
${SED} -e 's/"1"/"8"/' ${DOCSRC}/searchd.1 > ${DOCSRC}/searchd.8 |
139 |
.for man in ${MAN1} |
140 |
${SED} -i~ -e 's/\\fBsearchd\\fR(1)/\\fBsearchd\\fR(8)/' \ |
141 |
${DOCSRC}/${man} |
142 |
.endfor |
143 |
|
144 |
do-install: install-bin install-docs install-man install-examples |
145 |
|
146 |
install-bin: |
147 |
${INSTALL_PROGRAM} ${WRKSRC}/src/indexer ${PREFIX}/bin/indexer |
148 |
${INSTALL_PROGRAM} ${WRKSRC}/src/indextool ${PREFIX}/bin/indextool |
149 |
${INSTALL_PROGRAM} ${WRKSRC}/src/spelldump ${PREFIX}/bin/spelldump |
150 |
${INSTALL_PROGRAM} ${WRKSRC}/src/searchd ${PREFIX}/sbin/searchd |
151 |
${INSTALL_DATA} ${WRKSRC}/sphinx.conf.dist ${CFGFILE}.sample |
152 |
|
153 |
install-docs: |
154 |
@${MKDIR} ${DOCSDIR} |
155 |
.for doc in ${DOCS} |
156 |
${INSTALL_DATA} ${WRKSRC}/${doc} ${DOCSDIR} |
157 |
.endfor |
158 |
|
159 |
install-man: |
160 |
.for man in ${MAN1SRC} |
161 |
${INSTALL_MAN} ${DOCSRC}/${man} ${MANPREFIX}/man/man1/${man} |
162 |
.endfor |
163 |
.for man in ${MAN8SRC} |
164 |
${INSTALL_MAN} ${DOCSRC}/${man} ${MANPREFIX}/man/man8/${man} |
165 |
.endfor |
166 |
|
167 |
install-examples: |
168 |
@${MKDIR} ${EXAMPLESDIR} |
169 |
.for example in ${EXAMPLES} |
170 |
@cd ${WRKSRC} && ${COPYTREE_SHARE} ${example} ${EXAMPLESDIR} |
171 |
.endfor |
172 |
|
173 |
.include <bsd.port.mk> |