1 |
# ex:ts=8 |
2 |
# New ports collection makefile for: sqlite |
3 |
# Date created: Feb 21, 2001 |
4 |
# Whom: Ying-Chieh Liao <ijliao@FreeBSD.org> |
5 |
# |
6 |
# $FreeBSD: ports/databases/sqlite3/Makefile,v 1.21 2006/11/21 12:25:46 mnag Exp $ |
7 |
# $MidnightBSD: mports/databases/sqlite3/Makefile,v 1.1 2007/02/16 21:11:23 laffer1 Exp $ |
8 |
# |
9 |
|
10 |
PORTNAME= sqlite |
11 |
PORTVERSION= 3.3.17 |
12 |
CATEGORIES= databases |
13 |
MASTER_SITES= http://www.sqlite.org/ |
14 |
|
15 |
MAINTAINER= mnag@FreeBSD.org |
16 |
COMMENT= An SQL database engine in a C library w/ Tcl wrapper |
17 |
|
18 |
USE_GMAKE= YES |
19 |
USE_GNOME= pkgconfig |
20 |
USE_AUTOTOOLS= libtool:15 |
21 |
USE_DOS2UNIX= *.pc.in |
22 |
USE_LDCONFIG= YES |
23 |
GNU_CONFIGURE= YES |
24 |
CONFIGURE_ARGS= --prefix=${PREFIX} --with-hints=freebsd.hints |
25 |
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd6.0 |
26 |
|
27 |
DOCSDIR= ${PREFIX}/share/doc/sqlite3 |
28 |
EXAMPLESDIR= ${PREFIX}/share/examples/sqlite3 |
29 |
|
30 |
OPTIONS= DEBUG "Enable debugging & verbose explain" off \ |
31 |
DOCS "Building docs (depends on TCL)" on \ |
32 |
TCLWRAPPER "TCL wrapper for SQLITE" off \ |
33 |
THREADS "Enable threads support" off |
34 |
|
35 |
# Defaults, for building the docs: |
36 |
TCL_V?= 8.4 |
37 |
MAKE_ARGS+= TCLSH=tclsh${TCL_V} |
38 |
MAKE_ENV+= TCL_VER=${TCL_V} |
39 |
|
40 |
.include <bsd.port.pre.mk> |
41 |
|
42 |
.if defined(WITH_DEBUG) |
43 |
CONFIGURE_ARGS+= --enable-debug |
44 |
.endif |
45 |
|
46 |
.if !defined(NOPORTDOCS) && !defined(WITHOUT_DOCS) |
47 |
BUILD_DEPENDS+= tclsh${TCL_V}:${PORTSDIR}/lang/tcl${TCL_V:S/.//} |
48 |
ALL_TARGET+= all doc |
49 |
PORTDOCS= * |
50 |
.endif |
51 |
|
52 |
.if defined(WITH_TCLWRAPPER) |
53 |
CATEGORIES+= lang tcl${TCL_V:S/.//} |
54 |
LIB_DEPENDS+= tcl${TCL_V:S/.//}:${PORTSDIR}/lang/tcl${TCL_V:S/.//} |
55 |
CONFIGURE_ARGS+= --with-tcl=${LOCALBASE}/lib/tcl${TCL_V} |
56 |
PLIST_SUB+= WITH_TCLWRAPPER="" |
57 |
.else |
58 |
CONFIGURE_ARGS+= --disable-tcl |
59 |
PLIST_SUB+= WITH_TCLWRAPPER="@comment " |
60 |
.endif |
61 |
|
62 |
.if defined(WITH_THREADS) |
63 |
CONFIGURE_ARGS+= --enable-threadsafe |
64 |
.endif |
65 |
|
66 |
post-patch: |
67 |
.if defined(WITH_THREADS) |
68 |
@${REINPLACE_CMD} -e "s|-lpthread|${PTHREAD_LIBS}|g" \ |
69 |
${WRKSRC}/configure |
70 |
@${REINPLACE_CMD} -E -e "s|(Libs:.*)|\1 ${PTHREAD_LIBS}|" \ |
71 |
-e "s|(Cflags:.*)|\1 ${PTHREAD_CFLAGS}|" \ |
72 |
${WRKSRC}/sqlite.pc.in ${WRKSRC}/sqlite3.pc.in |
73 |
.endif |
74 |
@${REINPLACE_CMD} -e "s|tclsh \$$(TOP)|\$$(TCLSH) \$$(TOP)|g" \ |
75 |
-e "s|./libtool|${LIBTOOL}|g" \ |
76 |
-e "s|\$${HAVE_TCL:1=tcl_install}||" \ |
77 |
${WRKSRC}/Makefile.in |
78 |
@${ECHO} "config_TARGET_TCL_INC=\"-I${PREFIX}/include/tcl${TCL_V}\"" \ |
79 |
> ${WRKSRC}/freebsd.hints |
80 |
@${ECHO} "config_TARGET_TCL_LIBS=\"-L${PREFIX}/lib -ltcl${TCL_V:S/.//}\"" \ |
81 |
>> ${WRKSRC}/freebsd.hints |
82 |
|
83 |
post-install: |
84 |
.if defined(WITH_TCLWRAPPER) |
85 |
@${MKDIR} ${PREFIX}/lib/sqlite |
86 |
@(cd ${WRKSRC} && ${LIBTOOL} --mode=install ${INSTALL_DATA} \ |
87 |
libtclsqlite3.la ${PREFIX}/lib/sqlite/) |
88 |
@${INSTALL_DATA} ${FILESDIR}/pkgIndex.tcl ${PREFIX}/lib/sqlite/ |
89 |
@${INSTALL_PROGRAM} ${WRKSRC}/.libs/tclsqlite3 ${PREFIX}/bin |
90 |
.endif |
91 |
.if !defined(NOPORTDOCS) && !defined(WITHOUT_DOCS) |
92 |
@${MKDIR} ${DOCSDIR} |
93 |
@${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR} |
94 |
.endif |
95 |
@${MKDIR} ${EXAMPLESDIR} |
96 |
@${INSTALL_DATA} ${FILESDIR}/example.tcl ${EXAMPLESDIR} |
97 |
|
98 |
.include <bsd.port.post.mk> |