This package contains a number of functions that allows one to interact

with the operating system from MySQL:

  sys_eval - executes an arbitrary command, and returns it's output.
  sys_exec - executes an arbitrary command, and returns it's exit code.
  sys_get  - gets the value of an environment variable.
  sys_set  - create an environment variable, or update the value of an
             existing environment variable.

Use lib_mysqludf_sys_info() to obtain information about the currently
installed version of lib_mysqludf_sys.

WWW: http://www.mysqludf.org/lib_mysqludf_sys

PR:		ports/163216
Submitted by:	David Cornejo <dave@dogwood.com>
This commit is contained in:
Pawel Pekala 2011-12-20 21:12:37 +00:00
parent 5535b87677
commit c8a63c112e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=287755
6 changed files with 94 additions and 0 deletions

View File

@ -209,6 +209,7 @@
SUBDIR += mysql-q4m
SUBDIR += mysql-udf
SUBDIR += mysql-udf-preg
SUBDIR += mysql-udf-sys
SUBDIR += mysql-workbench51
SUBDIR += mysql-workbench52
SUBDIR += mysql-xql

View File

@ -0,0 +1,32 @@
# New ports collection makefile for: mysql-udf-sys
# Date created: December 2011
# Whom: David Cornejo <dave@dogwood.com>
#
# $FreeBSD$
#
PORTNAME= mysql-udf-sys
PORTVERSION= 0.0.3
CATEGORIES= databases
MASTER_SITES= http://www.mysqludf.org/lib_mysqludf_sys/
DISTNAME= lib_mysqludf_sys_${PORTVERSION}
MAINTAINER= dave@dogwood.com
COMMENT= System access UDFs
USE_MYSQL= yes
USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}
PLIST_FILES= lib/mysql/plugin/lib_mysqludf_sys.so
PLIST_DIRS= lib/mysql/plugin
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|; s|%%LOCALBASE%%|${LOCALBASE}|' \
${WRKSRC}/Makefile
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (lib_mysqludf_sys_0.0.3.tar.gz) = 174f43d1df5372c84d98981031f02a2b9e090954ac473f543bff79f9a87c2c4d
SIZE (lib_mysqludf_sys_0.0.3.tar.gz) = 9136

View File

@ -0,0 +1,22 @@
--- Makefile.orig 2009-01-18 23:11:00.000000000 -1000
+++ Makefile 2011-12-12 13:16:07.000000000 -1000
@@ -1,4 +1,16 @@
-LIBDIR=/usr/lib
+
+LIBDIR= %%PREFIX%%/lib/mysql/plugin
+INCDIR= %%LOCALBASE%%/include/mysql
+PROG= lib_mysqludf_sys.so
+
+all: lib_mysql_udf.so
+
+lib_mysql_udf.so:
+ $(CC) -fPIC -Wall -I$(INCDIR) -I. -shared lib_mysqludf_sys.c -o $(PROG)
install:
- gcc -Wall -I/usr/include/mysql -I. -shared lib_mysqludf_sys.c -o $(LIBDIR)/lib_mysqludf_sys.so
+ mkdir -p $(LIBDIR)
+ install -o root -g wheel -m 0755 $(PROG) $(LIBDIR)
+
+clean:
+ rm -f $(PROG)
+

View File

@ -0,0 +1,13 @@
This package contains a number of functions that allows one to interact
with the operating system from MySQL:
sys_eval - executes an arbitrary command, and returns it's output.
sys_exec - executes an arbitrary command, and returns it's exit code.
sys_get - gets the value of an environment variable.
sys_set - create an environment variable, or update the value of an
existing environment variable.
Use lib_mysqludf_sys_info() to obtain information about the currently
installed version of lib_mysqludf_sys.
WWW: http://www.mysqludf.org/lib_mysqludf_sys

View File

@ -0,0 +1,24 @@
To add the custom functions to your MySQL server use the following SQL:
(These function can be dangerous, you should install only the functions
you need):
USE mysql;
CREATE FUNCTION
lib_mysqludf_sys_info RETURNS string SONAME 'lib_mysqludf_sys.so';
CREATE FUNCTION sys_get RETURNS string SONAME 'lib_mysqludf_sys.so';
CREATE FUNCTION sys_set RETURNS int SONAME 'lib_mysqludf_sys.so';
CREATE FUNCTION sys_exec RETURNS int SONAME 'lib_mysqludf_sys.so';
CREATE FUNCTION sys_eval RETURNS string SONAME 'lib_mysqludf_sys.so';
To deinstall:
DROP FUNCTION IF EXISTS lib_mysqludf_sys_info;
DROP FUNCTION IF EXISTS sys_get;
DROP FUNCTION IF EXISTS sys_set;
DROP FUNCTION IF EXISTS sys_exec;
DROP FUNCTION IF EXISTS sys_eval;
For function descriptions, see the following webpage:
http://www.mysqludf.org/lib_mysqludf_sys