aboutsummaryrefslogtreecommitdiff
path: root/databases/sqlrelay/Makefile
blob: 7789c1f5e85db8786d3aa3c4f2f1e90260a8c2e8 (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# Created by: Akinori MUSHA aka knu <knu@idaemons.org>

PORTNAME=	${SQLRELAY_PORTNAME}
PORTVERSION=	${SQLRELAY_PORTVERSION}
CATEGORIES=	databases
MASTER_SITES=	SF

MAINTAINER=	pi@FreeBSD.org
COMMENT=	Persistent DB connection pooling/proxying/load balancing system

LICENSE=	LGPL20

LIB_DEPENDS=	librudiments.so:devel/rudiments \
		libkrb5.so:security/krb5 \
		libcurl.so:ftp/curl \
		libiconv.so:converters/libiconv

USES=		gmake iconv libedit libtool pathfix python readline ssl

PATHFIX_MAKEFILEIN=	Makefile
CPPFLAGS+=	-I${LOCALBASE}/include
GNU_CONFIGURE=	yes
CONFIGURE_ARGS=		${SQLRELAY_CONFIGURE_ARGS} \
			--disable-tcl \
			--disable-java \
			--disable-nodejs \
			--disable-perl \
			--disable-php \
			--disable-python \
			--disable-python3 \
			--disable-ruby \
			--disable-erlang
MAKE_JOBS_UNSAFE=yes
USE_LDCONFIG=	yes

PORTDOCS=	*

TOSTRIP=	bin/sqlr-start \
		bin/sqlr-stop \
		bin/sqlr-listener \
		bin/sqlr-connection \
		bin/sqlr-scaler \
		bin/sqlr-cachemanager \
		bin/sqlr-export \
		bin/sqlr-import \
		bin/sqlr-pwdenc \
		bin/sqlr-status \
		bin/sqlrsh \
		lib/libmysql3sqlrelay.so.5.0.0 \
		lib/libmysql40sqlrelay.so.5.0.0 \
		lib/libmysql41sqlrelay.so.5.0.0 \
		lib/libmysql50sqlrelay.so.5.0.0 \
		lib/libmysql51sqlrelay.so.5.0.0 \
		lib/libpqsqlrelay.so.5.0.0 \
		lib/libsqlrclient.so.5.0.0 \
		lib/libsqlrclientwrapper.so.5.0.0 \
		lib/libsqlrodbc.so.5.0.0 \
		lib/libsqlrserver.so.8.0.0 \
		lib/libsqlrutil.so.8.0.0 \
		libexec/sqlrelay/sqlrauth_database.so \
		libexec/sqlrelay/sqlrauth_proxied.so \
		libexec/sqlrelay/sqlrauth_sqlrelay.so \
		libexec/sqlrelay/sqlrauth_userlist.so \
		libexec/sqlrelay/sqlrconfig_xmldom.so \
		libexec/sqlrelay/sqlrconnection_router.so \
		libexec/sqlrelay/sqlrdirective_custom_wf.so \
		libexec/sqlrelay/sqlrfilter_patterns.so \
		libexec/sqlrelay/sqlrfilter_regex.so \
		libexec/sqlrelay/sqlrfilter_string.so \
		libexec/sqlrelay/sqlrlogger_custom_nw.so \
		libexec/sqlrelay/sqlrlogger_custom_sc.so \
		libexec/sqlrelay/sqlrlogger_debug.so \
		libexec/sqlrelay/sqlrlogger_slowqueries.so \
		libexec/sqlrelay/sqlrlogger_stalecursors.so \
		libexec/sqlrelay/sqlrnotification_events.so \
		libexec/sqlrelay/sqlrparser_default.so \
		libexec/sqlrelay/sqlrprotocol_sqlrclient.so \
		libexec/sqlrelay/sqlrpwdenc_crypt.so \
		libexec/sqlrelay/sqlrpwdenc_md5.so \
		libexec/sqlrelay/sqlrpwdenc_rot.so \
		libexec/sqlrelay/sqlrquery_sqlrcmdcstat.so \
		libexec/sqlrelay/sqlrquery_sqlrcmdgstat.so \
		libexec/sqlrelay/sqlrresultsettranslation_reformatdatetime.so \
		libexec/sqlrelay/sqlrresultsettranslation_test.so \
		libexec/sqlrelay/sqlrrouter_clientinfolist.so \
		libexec/sqlrelay/sqlrrouter_clientiplist.so \
		libexec/sqlrelay/sqlrrouter_regex.so \
		libexec/sqlrelay/sqlrrouter_usedatabase.so \
		libexec/sqlrelay/sqlrrouter_userlist.so \
		libexec/sqlrelay/sqlrschedule_cron_userlist.so \
		libexec/sqlrelay/sqlrtranslation_normalize.so \
		libexec/sqlrelay/sqlrtranslation_patterns.so

.include "${.CURDIR}/Makefile.common"

OPTIONS_DEFINE=	MYSQL ODBC ORACLE PGSQL SQLITE3 FREETDS FIREBIRD DOCS
OPTIONS_SUB=	yes

ORACLE_CONFIGURE_ENABLE=	oracle

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MSQLITE3}
LIB_DEPENDS+=		libgdbm.so:databases/gdbm \
			libsqlite3.so:databases/sqlite3
CONFIGURE_ARGS+=	--with-gdbm-prefix="${LOCALBASE}" \
			--with-sqlite-prefix="${LOCALBASE}"
TOSTRIP+=		libexec/sqlrelay/sqlrconnection_sqlite.so
.else
CONFIGURE_ARGS+=	--disable-sqlite
.endif

.if ${PORT_OPTIONS:MMYSQL}
USES+=		mysql
CONFIGURE_ARGS+=	--with-mysql-prefix="${LOCALBASE}"
TOSTRIP+=		libexec/sqlrelay/sqlrconnection_mysql.so
.else
CONFIGURE_ARGS+=	--disable-mysql
.endif

.if ${PORT_OPTIONS:MFIREBIRD}
USES+=		firebird
CONFIGURE_ARGS+=	--with-firebird-prefix="${LOCALBASE}"
TOSTRIP+=		libexec/sqlrelay/sqlrconnection_firebird.so
.else
CONFIGURE_ARGS+=	--disable-firebird
.endif

.if ${PORT_OPTIONS:MPGSQL}
USES+=			pgsql
CONFIGURE_ARGS+=	--with-postgresql-prefix="${LOCALBASE}"
TOSTRIP+=		libexec/sqlrelay/sqlrconnection_postgresql.so
.else
CONFIGURE_ARGS+=	--disable-postgresql
.endif

.if ${PORT_OPTIONS:MODBC}
LIB_DEPENDS+=		libodbc.so:databases/unixODBC
CONFIGURE_ARGS+=	--with-odbc-prefix="${LOCALBASE}"
TOSTRIP+=		libexec/sqlrelay/sqlrconnection_odbc.so
.else
CONFIGURE_ARGS+=	--disable-odbc
.endif

.if ${PORT_OPTIONS:MFREETDS}
LIB_DEPENDS+=		libtdsodbc.so:databases/freetds
CONFIGURE_ARGS+=	--with-freetds-prefix="${LOCALBASE}"
TOSTRIP+=		libexec/sqlrelay/sqlrconnection_freetds.so
.else
CONFIGURE_ARGS+=	--disable-freetds
.endif

post-patch:
	${REINPLACE_CMD} -E \
		-e 's,\$$\(initroot\),\$$\(initroot\)${PREFIX},g' \
		-e 's,/etc/rc.conf,/etc/defaults/rc.conf,g' \
			${WRKSRC}/init/Makefile
	${FIND} ${WRKSRC} -name Makefile | ${XARGS} ${REINPLACE_CMD} -E \
		-e 's#-release \$$\(SQLR_VERSION\)##g;'

post-configure:
	${REINPLACE_CMD} 's,-Werror,,' ${WRKSRC}/config.mk

post-install:
.for f in ${TOSTRIP}
	-${STRIP_CMD} ${STAGEDIR}${PREFIX}/${f}
.endfor
	${RM} ${STAGEDIR}${PREFIX}/lib/SQLRClient.dll
	${RM} ${STAGEDIR}${PREFIX}/lib/SQLRClient.dll.config

.include <bsd.port.mk>