diff options
author | glarkin <glarkin@FreeBSD.org> | 2010-03-06 03:29:17 +0800 |
---|---|---|
committer | glarkin <glarkin@FreeBSD.org> | 2010-03-06 03:29:17 +0800 |
commit | b85d0e061933318d5d4c7bfbd17e7cc58bf0652f (patch) | |
tree | 9f201abcc304e590cf51a84e793c806d7cc2354b /databases/sqlite-ext-miscfuncs | |
parent | b6da343754ce58b76832f19369dd74a792d338bd (diff) | |
download | freebsd-ports-gnome-b85d0e061933318d5d4c7bfbd17e7cc58bf0652f.tar.gz freebsd-ports-gnome-b85d0e061933318d5d4c7bfbd17e7cc58bf0652f.tar.zst freebsd-ports-gnome-b85d0e061933318d5d4c7bfbd17e7cc58bf0652f.zip |
Provide mathematical, string and aggregate functions for SQL queries
using the SQLite loadable extensions mechanism.
Math functions:
acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference,
degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth,
exp, log, log10, power, sign, sqrt, square, ceil, floor, pi
String functions:
replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim,
replace, reverse, proper, padl, padr, padc, strfilter
Aggregate functions:
stdev, variance, mode, median, lower_quartile, upper_quartile
WWW: http://www.sqlite.org/contrib
Submitted by: myself (glarkin)
Feature safe: yes
Diffstat (limited to 'databases/sqlite-ext-miscfuncs')
-rw-r--r-- | databases/sqlite-ext-miscfuncs/Makefile | 58 | ||||
-rw-r--r-- | databases/sqlite-ext-miscfuncs/distinfo | 3 | ||||
-rw-r--r-- | databases/sqlite-ext-miscfuncs/files/README.in | 29 | ||||
-rw-r--r-- | databases/sqlite-ext-miscfuncs/pkg-descr | 19 | ||||
-rw-r--r-- | databases/sqlite-ext-miscfuncs/pkg-message | 11 |
5 files changed, 120 insertions, 0 deletions
diff --git a/databases/sqlite-ext-miscfuncs/Makefile b/databases/sqlite-ext-miscfuncs/Makefile new file mode 100644 index 000000000000..770670784941 --- /dev/null +++ b/databases/sqlite-ext-miscfuncs/Makefile @@ -0,0 +1,58 @@ +# New ports collection makefile for: sqlite-ext-miscfuncs +# Date created: 28 Jan 2010 +# Whom: Greg Larkin <glarkin@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= sqlite-ext-miscfuncs +PORTVERSION= 1.0 +CATEGORIES= databases +MASTER_SITES= http://www.sqlite.org/contrib/download/${DISTFILES}/download/ \ + LOCAL/glarkin +DISTNAME= ${SRCFILE} +EXTRACT_SUFX= + +MAINTAINER= glarkin@FreeBSD.org +COMMENT= Math, string, and aggregate function library for SQLite + +USE_SQLITE= yes +DIST_SUBDIR= sqlite-ext +NO_WRKSUBDIR= yes + +SRCFILE= extension-functions.c +LIBFILE= libsqlitemiscfuncs.so +INST_DIR= ${PREFIX}/libexec/${DIST_SUBDIR} +USE_LDCONFIG= ${INST_DIR} + +SUB_FILES= ${PORTDOCS} +SUB_LIST+= LIBFILE=${LIBFILE} + +FETCH_BEFORE_ARGS= -o ${SRCFILE}?get=25 + +EXTRACT_CMD= ${CP} +EXTRACT_BEFORE_ARGS= +EXTRACT_AFTER_ARGS= ${WRKSRC}/ + +PLIST_DIRS= libexec/${DIST_SUBDIR} +PLIST_FILES= ${PLIST_DIRS}/${LIBFILE} + +PORTDOCS= README + +CFLAGS+= -I${PREFIX}/include -fPIC -lm -shared + +do-build: + @cd ${WRKSRC} && ${CC} ${CFLAGS} ${SRCFILE} -o ${LIBFILE} + +do-install: + @${INSTALL} -d ${PREFIX}/libexec/${DIST_SUBDIR} + @${INSTALL_PROGRAM} ${WRKSRC}/${LIBFILE} ${INST_DIR} + +post-install: +.if !defined(NOPORTDOCS) + @${INSTALL} -d ${DOCSDIR} + @${CP} ${WRKDIR}/${PORTDOCS} ${DOCSDIR} +.endif + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.mk> diff --git a/databases/sqlite-ext-miscfuncs/distinfo b/databases/sqlite-ext-miscfuncs/distinfo new file mode 100644 index 000000000000..921d5b987ca3 --- /dev/null +++ b/databases/sqlite-ext-miscfuncs/distinfo @@ -0,0 +1,3 @@ +MD5 (sqlite-ext/extension-functions.c) = 625757faf99dde4e976a85f04a8f5e65 +SHA256 (sqlite-ext/extension-functions.c) = 4d8eeb7046e0c9671beadd0c5bea105c24a38ff1cf5fb318543a982d6ca3b1da +SIZE (sqlite-ext/extension-functions.c) = 51748 diff --git a/databases/sqlite-ext-miscfuncs/files/README.in b/databases/sqlite-ext-miscfuncs/files/README.in new file mode 100644 index 000000000000..5365a6d87ad0 --- /dev/null +++ b/databases/sqlite-ext-miscfuncs/files/README.in @@ -0,0 +1,29 @@ +Usage instructions for applications calling the sqlite3 API functions: + + In your application, call sqlite3_enable_load_extension(db,1) to + allow loading external libraries. Then load the library + %%LIBFILE%% using sqlite3_load_extension; the third argument + should be 0. See http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions. + Select statements may now use these functions, as in: + + SELECT cos(radians(inclination)) FROM satsum WHERE satnum = 25544; + + +Usage instructions for the sqlite3 program: + + If the program is built so that loading extensions is permitted, + the following will work: + + sqlite> SELECT load_extension('%%LIBFILE%%'); + sqlite> select cos(radians(45)); + 0.707106781186548 + + Note: Loading extensions is by default prohibited as a + security measure; see "Security Considerations" in + http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions. + + If the sqlite3 program and library are built this + way, you cannot use these functions from the program, you + must write your own program using the sqlite3 API, and call + sqlite3_enable_load_extension as described above, or else + rebuilt the sqlite3 program to allow loadable extensions. diff --git a/databases/sqlite-ext-miscfuncs/pkg-descr b/databases/sqlite-ext-miscfuncs/pkg-descr new file mode 100644 index 000000000000..9bb0e8f92c09 --- /dev/null +++ b/databases/sqlite-ext-miscfuncs/pkg-descr @@ -0,0 +1,19 @@ +Provide mathematical, string and aggregate functions for SQL queries +using the SQLite loadable extensions mechanism. + +Math functions: + + acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, + degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, + exp, log, log10, power, sign, sqrt, square, ceil, floor, pi + +String functions: + + replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, + replace, reverse, proper, padl, padr, padc, strfilter + +Aggregate functions: + + stdev, variance, mode, median, lower_quartile, upper_quartile + +WWW: http://www.sqlite.org/contrib diff --git a/databases/sqlite-ext-miscfuncs/pkg-message b/databases/sqlite-ext-miscfuncs/pkg-message new file mode 100644 index 000000000000..d55184d7fb78 --- /dev/null +++ b/databases/sqlite-ext-miscfuncs/pkg-message @@ -0,0 +1,11 @@ +********************************************************************* +Loading extensions is by default prohibited as a security measure; +see "Security Considerations" in +http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions. + +If the sqlite3 program and library are built this way, you cannot +use these functions from the program, you must write your own program +using the sqlite3 API, and call sqlite3_enable_load_extension as +described above, or else rebuilt the sqlite3 program to allow +loadable extensions. +********************************************************************* |