From 2b64a84ffcef3c06bfbbc9fc737f8224e139333f Mon Sep 17 00:00:00 2001 From: Timothy Boronczyk Date: Fri, 17 Jan 2014 01:22:29 -0500 Subject: [PATCH] Add Makefile and install.sh similar to mysqludf/lib_mysqludf_sys for those who need to compile. --- Makefile | 4 ++++ install.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 Makefile create mode 100755 install.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..53cdfe2 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +LIBDIR=/usr/lib + +install: + gcc -Wall -fPIC -I/usr/include/mysql -I. -shared lib_mysqludf_json.c -o $(LIBDIR)/lib_mysqludf_json.so diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..92b0960 --- /dev/null +++ b/install.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# lib_mysqludf_json - a library of functions to map relational data to JSON +# Copyright (C) 2007 Roland Bouman +# Copyright (C) 2008-2009 Roland Bouman and Bernardo Damele A. G. +# web: http://www.mysqludf.org/ +# email: mysqludfs@gmail.com, bernardo.damele@gmail.com +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +echo "Compiling the MySQL UDF" +make + +if test $? -ne 0; then + echo "ERROR: You need libmysqlclient development software installed " + echo "to be able to compile this UDF, on Debian/Ubuntu just run:" + echo "apt-get install libmysqlclient15-dev" + exit 1 +else + echo "MySQL UDF compiled successfully" +fi + +echo -e "\nPlease provide your MySQL root password" + +mysql -u root -p mysql < lib_mysqludf_json.sql + +if test $? -ne 0; then + echo "ERROR: unable to install the UDF" + exit 1 +else + echo "MySQL UDF installed successfully" +fi +