[packages_10.03.2] mysql: merge r28083, r29176, r29199, r29908
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 03:38:32 +0000 (03:38 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 5 Feb 2012 03:38:32 +0000 (03:38 +0000)
SVN-Revision: 30184

libs/mysql/Makefile
libs/mysql/files/mysqld.init

index 3dcae75e8726cc51ac28e6e4a0aad238a356b1af..fdd822043ce362a93a51d1ead94ea1344101fd7d 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mysql
 PKG_VERSION:=5.1.53
-PKG_RELEASE:=2
+PKG_RELEASE:=6
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=\
@@ -29,7 +29,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/libmysqlclient/Default
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+zlib
+  DEPENDS:=+uclibcxx +zlib
   TITLE:=MySQL client library
   URL:=http://dev.mysql.com/
 endef
@@ -37,7 +37,7 @@ endef
 define Package/mysql-server/Default
   SECTION:=utils
   CATEGORY:=Utilities
-  DEPENDS:=+zlib +libmysqlclient +uclibcxx
+  DEPENDS:=+libmysqlclient +libncurses +libreadline
   TITLE:=MySQL Server
   URL:=http://dev.mysql.com/
   SUBMENU:=database
@@ -195,6 +195,10 @@ define Package/mysql-server/install
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables_data.sql $(1)/usr/share/mysql/
 endef
 
+define Package/mysql-server/conffiles
+/etc/my.cnf
+endef
+
 $(eval $(call BuildPackage,mysql-server))
 $(eval $(call BuildPackage,libmysqlclient))
 $(eval $(call BuildPackage,libmysqlclient_r))
index 693dade6c1552fef6a74f45574e400f8d299eab9..48e61896ef952e98f2eaad22651d77f12499e0ff 100644 (file)
@@ -1,29 +1,30 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2010 OpenWrt.org
+# Copyright (C) 2010-2011 OpenWrt.org
 
 START=95
 STOP=10
 
-PID=/var/run/mysqld.pid
-CMD=/usr/bin/mysqld
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+SERVICE_STOP_TIME=9
+
+error() {
+       echo "${initscript}:" "$@" 1>&2
+}
 
 start() {
        local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" /etc/my.cnf)
        if [ ! -d "$datadir" ]; then
-               echo "Error: datadir in /etc/my.cnf ($datadir) doesn't exist"
+               error "Error: datadir '$datadir' in /etc/my.cnf doesn't exist"
                return 1
-       elif [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
-               echo "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables"
+       fi
+       if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
+               error "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables"
                return 1
-       else
-               echo -n "Starting MySQL daemon... "
-               start-stop-daemon -x $CMD -b -S -- --pid-file=$PID
-               echo "done"
        fi
+       service_start /usr/bin/mysqld
 }
 
 stop() {
-       echo -n "Stopping MySQL daemon... "
-       service_kill ${CMD##*/} $PID
-       echo "done"
+       service_stop /usr/bin/mysqld
 }