summaryrefslogtreecommitdiff
path: root/net/prosearch/Makefile
blob: 36a5207b12a8eab85978bf562e815a3051e027ed (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# $FreeBSD$

PORTNAME=	prosearch
PORTVERSION=	0.19.2
#PORTREVISION=	1
CATEGORIES=	net www
MASTER_SITES=	http://pro.setun.net/search/download/ SF/pro-search/pro-search/${PORTVERSION}

MAINTAINER=	proler@gmail.com
COMMENT=	Powerful file search

USES=		perl5
USE_PERL5=	run
USE_BZIP2=	yes
SUB_FILES=	pkg-message
SUB_LIST=	SEARCHDIR=${SEARCHDIR}
NO_BUILD=	yes
SEARCHDIR?=	www/search
PLIST_SUB+=	SEARCHDIR=${SEARCHDIR}

SAMBA_PORT?=	net/samba36

#todo
# user and group for crawler, nginx
OPTIONS_DEFINE=	CRAWLER SAMBA RSYNC APACHE MOD_PERL2 MOD_FASTCGI \
		DB MYSQL MARIA PGSQL PGPP SQLITE SPHINX
OPTIONS_DEFAULT=	CRAWLER SAMBA APACHE DB MYSQL
CRAWLER_DESC=		With crawler deps (nmap, p5-libwww)
SAMBA_DESC=		crawler with SAMBA (file://)
RSYNC_DESC=		crawler with RSYNC
APACHE_DESC=		With web server apache2.2+
MOD_PERL2_DESC=		With MOD_PERL2
MOD_FASTCGI_DESC=	With MOD_FASTCGI
DB_DESC=		With database server deps
MARIA_DESC=		maria (mysql replace)
PGPP_DESC=		postgres pure Perl connection driver
SPHINX_DESC=		sphinx fulltext search engine

#		NGINX "With web server deps (NGINX)" off

NO_STAGE=	yes
.include <bsd.port.options.mk>

RUN_DEPENDS+=\
p5-lib-abs>=0:${PORTSDIR}/devel/p5-lib-abs

.if ${PORT_OPTIONS:MCRAWLER}
RUN_DEPENDS+=\
p5-libwww>=0:${PORTSDIR}/www/p5-libwww \
p5-URI>=0:${PORTSDIR}/net/p5-URI \
p5-DBI>=0:${PORTSDIR}/databases/p5-DBI \
p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser \
nmap:${PORTSDIR}/security/nmap \
p5-Net-DirectConnect>=0:${PORTSDIR}/net-p2p/p5-Net-DirectConnect
.endif

.if ${PORT_OPTIONS:MSAMBA}
RUN_DEPENDS+=	smbclient:${PORTSDIR}/net/samba-smbclient
.endif

.if ${PORT_OPTIONS:MRSYNC}
RUN_DEPENDS+=	rsync:${PORTSDIR}/net/rsync
.endif

.if ${PORT_OPTIONS:MAPACHE}
USE_APACHE_RUN=	22+
.endif

.if ${PORT_OPTIONS:MNGINX}
RUN_DEPENDS+=\
nginx:${PORTSDIR}/www/nginx
.endif

.if ${PORT_OPTIONS:MMOD_PERL2}
RUN_DEPENDS+=\
${LOCALBASE}/${APACHEMODDIR}/mod_perl.so:${PORTSDIR}/www/mod_perl2
.endif

.if ${PORT_OPTIONS:MMOD_FASTCGI}
RUN_DEPENDS+=\
${LOCALBASE}/${APACHEMODDIR}/mod_fastcgi.so:${PORTSDIR}/www/mod_fastcgi	\
p5-FCGI>=0:${PORTSDIR}/www/p5-FCGI
.endif

.if ${PORT_OPTIONS:MSPHINX}
WITH_MYSQL=	client	# for dbi
RUN_DEPENDS+=\
searchd:${PORTSDIR}/textproc/sphinxsearch-devel
.endif

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=	client
RUN_DEPENDS+=\
p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql
.endif

.if ${PORT_OPTIONS:MDB} && ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=	server
.endif

.if ${PORT_OPTIONS:MMARIA}
RUN_DEPENDS+=\
p5-DBD-mysql>=0:${PORTSDIR}/databases/p5-DBD-mysql \
${LOCALBASE}bin/mysql:${PORTSDIR}/databases/mariadb-client
.endif

.if ${PORT_OPTIONS:MDB} && ${PORT_OPTIONS:MMARIA}
RUN_DEPENDS+=\
${LOCALBASE}/libexec/mysqld:${PORTSDIR}/databases/mariadb-server
.endif

.if ${PORT_OPTIONS:MPGSQL}
USE_PGSQL=	yes
RUN_DEPENDS+=\
p5-DBD-Pg>=0:${PORTSDIR}/databases/p5-DBD-Pg
.endif

.if ${PORT_OPTIONS:MPGPP}
RUN_DEPENDS+=\
p5-DBD-PgPP>=0:${PORTSDIR}/databases/p5-DBD-PgPP
.endif

.if ${PORT_OPTIONS:MPGSQL} || ${PORT_OPTIONS:MPGPP} || ${PORT_OPTIONS:MDB}
USE_PGSQL=	yes
RUN_DEPENDS+=\
${LOCALBASE}/bin/postgres:${PORTSDIR}/databases/postgresql${PGSQL_VER}-server
.endif

.if ${PORT_OPTIONS:MSQLITE}
USE_SQLITE=	yes
RUN_DEPENDS+=\
p5-DBD-SQLite>=0:${PORTSDIR}/databases/p5-DBD-SQLite
.endif

WRKSRC=	${WRKDIR}/search

do-install:
	@cd ${WRKSRC} && ${COPYTREE_SHARE} . ${PREFIX}/${SEARCHDIR}/
	@${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/${SEARCHDIR}
	@${CHMOD} +x ${PREFIX}/${SEARCHDIR}/crawler.pl ${PREFIX}/${SEARCHDIR}/010.search.purge ${PREFIX}/${SEARCHDIR}/*.sh.* ${PREFIX}/${SEARCHDIR}/web/*.*cgi
	@${ECHO_CMD} @exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} \
		${SEARCHDIR:S|^${PREFIX}/|%D/|} >> ${TMPPLIST}

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.mk>