summaryrefslogtreecommitdiff
path: root/www/mnogosearch/Makefile
blob: a61c381d1c2d13d0804f03ff11daeb0362de85e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Created by: ache

PORTNAME=	mnogosearch
PORTVERSION=	3.4.1
CATEGORIES=	www databases
MASTER_SITES=	http://www.mnogosearch.org/Download/

MAINTAINER=	crees@FreeBSD.org
COMMENT=	Full featured SQL-based hypertext search engine

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

CONFLICTS=	sphinxsearch udmsearch mguesser

OPTIONS_DEFINE=	DOCS EXAMPLES THREADS SSL ASIAN SYSLOG

OPTIONS_MULTI=	DATABASE
OPTIONS_MULTI_DATABASE=	PGSQL MYSQL SQLITE2 SQLITE3

OPTIONS_DEFAULT=	THREADS SSL SYSLOG SQLITE3

ASIAN_DESC=	Enable asian charsets
DATABASE_DESC=	Database backends
SYSLOG_DESC=	Send logs to syslog
SQLITE2_DESC=	Use SQLite 2.x
SQLITE3_DESC=	Use SQLite 3.x

GNU_CONFIGURE=	yes
INSTALL_TARGET=	install-strip
USES=		cpe gmake libtool
USE_LDCONFIG=	yes
CONFIGURE_ARGS=	--sysconfdir=${ETCDIR} \
		--localstatedir=/var/mnogosearch \
		--datadir=${DATADIR}

SUB_FILES+=	pkg-message

PGSQL_USES=	pgsql
PGSQL_CONFIGURE_WITH=	pgsql=${LOCALBASE}

SQLITE2_USES=	sqlite:2
SQLITE3_USES=	sqlite
SQLITE2_CONFIGURE_ON=	--with-sqlite=${LOCALBASE}
SQLITE3_CONFIGURE_ON=	--with-sqlite3=${LOCALBASE}

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSSL}
USES+=	ssl
.endif

.if ${PORT_OPTIONS:MTHREADS}
CONFIGURE_ARGS+=	--enable-pthreads
.else
CONFIGURE_ARGS+=	--disable-pthreads
.endif

.if ${PORT_OPTIONS:MSSL}
CONFIGURE_ARGS+=	--with-openssl=${OPENSSLBASE}
.endif

.if ${PORT_OPTIONS:MASIAN}
CONFIGURE_ARGS+=	--with-extra-charsets=all
.endif

.if ! ${PORT_OPTIONS:MSYSLOG}
CONFIGURE_ARGS+=	--disable-syslog
.endif

.if ${PORT_OPTIONS:MMYSQL}
USES+=		mysql
CONFIGURE_ARGS+=	--with-mysql=${LOCALBASE}
.endif

PORTDATA=	*
PORTDOCS=	ChangeLog INSTALL README.html
PORTEXAMPLES=	README *.conf

post-patch:
.if ${PORT_OPTIONS:MDOCS}
	@${REINPLACE_CMD} -e 's#$$(DESTDIR)$$(prefix)/doc#${DOCSDIR}#' \
		${WRKSRC}/Makefile.in ${WRKSRC}/doc/Makefile.in
.else
	@${REINPLACE_CMD} -e \
		's#^SUBDIRS = include src doc#SUBDIRS = include src#' \
		${WRKSRC}/Makefile.in
.endif

post-install:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
.for f in ${PORTDOCS:NREADME.html}
	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
.endfor
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	${INSTALL_DATA} ${WRKSRC}/doc/samples/* ${STAGEDIR}${EXAMPLESDIR}/

.include <bsd.port.mk>