aboutsummaryrefslogtreecommitdiffstats
path: root/databases/sqlite-ext-mobigroup/Makefile
blob: 933bcc2ff445cbe07e5771752377c0886b49166b (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
# New ports collection makefile for:    sqlite-ext-mobigroup
# Date created:     28 Jul 2010
# Whom:         Pavel Volkov <pavelivolkov@googlemail.com>
#
# $FreeBSD$
#

PORTNAME=   sqlite-ext-mobigroup
PORTVERSION=    3.7.5.1
PORTEPOCH=  1
CATEGORIES= databases
MASTER_SITES=   http://mobigroup.ru/debian/pool-squeeze/main/s/sqlite3/
DISTNAME=   sqlite3_${PORTVERSION:R}-mobigroup.${PORTVERSION:E}

MAINTAINER= pavelivolkov@googlemail.com
COMMENT=    A mobigroup functions library for SQLite

USE_SQLITE= yes

DIST_SUBDIR=    sqlite-ext
WRKSRC=     ${WRKDIR}/sqlite3-${PORTVERSION:R}

USE_LDCONFIG=   ${PREFIX}/libexec/${DIST_SUBDIR}

OPTIONS=    COMPRESS "compress content into a blob using libz" off \
        ENV "implements the getenv" off \
        INET "provide the ipv4 functions in SQL queries" on \
        MD5 "implements the MD5 message-digest algorithm" off

PLIST_DIRS= libexec/${DIST_SUBDIR}
PORTDOCS=   *
PORTEXAMPLES=   *

.include <bsd.port.options.mk>

.ifdef WITH_COMPRESS
PLIST_FILES+=   libexec/${DIST_SUBDIR}/libsqlitecompress.so
.endif
.ifdef WITH_INET
PLIST_FILES+=   libexec/${DIST_SUBDIR}/libsqliteipv4.so
.endif
.ifdef WITH_ENV
PLIST_FILES+=   libexec/${DIST_SUBDIR}/libsqliteenv.so
.endif
.ifdef WITH_MD5
PLIST_FILES+=   libexec/${DIST_SUBDIR}/libsqlitemd5.so
.endif

CFLAGS+=    -I${PREFIX}/include -fPIC -lm -shared

do-build:
.ifdef WITH_COMPRESS
    @cd ${WRKSRC}/ext/_compress && \
        ${CC} -lz ${CFLAGS} compress.c -o libsqlitecompress.so
.endif
.ifdef WITH_INET
    @cd ${WRKSRC}/ext/inet && \
        ${CC} ${CFLAGS} ipv4-ext.c -o libsqliteipv4.so
.endif
.ifdef WITH_ENV
    @cd ${WRKSRC}/ext/env && \
        ${CC} ${CFLAGS} env.c -o libsqliteenv.so
.endif
.ifdef WITH_MD5
    @cd ${WRKSRC}/ext/md5 && \
        ${CC} ${CFLAGS} md5.c -o libsqlitemd5.so
.endif

do-install:
    @${MKDIR} ${PREFIX}/libexec/${DIST_SUBDIR}
.ifndef NOPORTDOCS
    @${MKDIR} ${DOCSDIR}
.endif
.ifndef NOPORTEXAMPLES
    @${MKDIR} ${EXAMPLESDIR}
.endif
.ifdef WITH_COMPRESS
    @${INSTALL_PROGRAM} ${WRKSRC}/ext/_compress/libsqlitecompress.so ${PREFIX}/libexec/${DIST_SUBDIR}
.endif
.ifdef WITH_INET
    @${INSTALL_PROGRAM} ${WRKSRC}/ext/inet/libsqliteipv4.so ${PREFIX}/libexec/${DIST_SUBDIR}
.   ifndef NOPORTDOCS
        @${SED} '/\/\*/d;/\*\//,$$d' ${WRKSRC}/ext/inet/ipv4-ext.c > ${WRKSRC}/ext/inet/README-ipv4.txt
        @${INSTALL_DATA} ${WRKSRC}/ext/inet/README-ipv4.txt ${DOCSDIR}
.   endif
.   ifndef NOPORTEXAMPLES
        @${INSTALL_DATA} ${WRKSRC}/ext/inet/ipv4-ext.sql ${EXAMPLESDIR}
.   endif
.endif
.ifdef WITH_ENV
    @${INSTALL_PROGRAM} ${WRKSRC}/ext/env/libsqliteenv.so ${PREFIX}/libexec/${DIST_SUBDIR}
.   ifndef NOPORTDOCS
        @${SED} '/\/\*/d;/\*\//,$$d' ${WRKSRC}/ext/env/env.c > ${WRKSRC}/ext/env/README-env.txt
        @${INSTALL_DATA} ${WRKSRC}/ext/env/README-env.txt ${DOCSDIR}
.   endif
.endif
.ifdef WITH_MD5
    @${INSTALL_PROGRAM} ${WRKSRC}/ext/md5/libsqlitemd5.so ${PREFIX}/libexec/${DIST_SUBDIR}
.   ifndef NOPORTDOCS
        @${SED} '/\/\*/d;/\*\//,$$d' ${WRKSRC}/ext/md5/md5.c > ${WRKSRC}/ext/md5/README-md5.txt
        @${INSTALL_DATA} ${WRKSRC}/ext/md5/README-md5.txt ${DOCSDIR}
.   endif
.   ifndef NOPORTEXAMPLES
        @${INSTALL_DATA} ${WRKSRC}/ext/md5/md5.sql ${EXAMPLESDIR}
.   endif
.endif

.include <bsd.port.mk>