2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
18 http://mysql.he.net/Downloads/MySQL-5.0/ \
19 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
20 http://mysql.holywar.net/Downloads/MySQL-5.0/
21 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
27 PKG_BUILD_DEPENDS:=libncurses libreadline
29 include $(INCLUDE_DIR)/package.mk
31 define Package/libmysqlclient
35 TITLE:=MySQL client library
36 URL:=http://dev.mysql.com/
39 define Build/Configure
40 (cd $(PKG_BUILD_DIR); touch \
47 $(call Build/Configure/Default, \
53 --with-unix-socket-path=/tmp \
58 --without-embedded-server \
59 --without-query-cache \
66 --with-named-thread-libs=-lpthread \
68 mysql_cv_compress=yes \
69 mysql_cv_gethostname_style=glibc2 \
74 rm -rf $(PKG_INSTALL_DIR)
75 mkdir -p $(PKG_INSTALL_DIR)
76 $(MAKE) -C "$(PKG_BUILD_DIR)" \
78 DESTDIR="$(PKG_INSTALL_DIR)" \
80 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
82 LINK="$(HOSTCC) -o conf_to_src -lc" \
86 $(MAKE) -C "$(PKG_BUILD_DIR)" \
88 DESTDIR="$(PKG_INSTALL_DIR)" \
90 $(MAKE) -C "$(PKG_BUILD_DIR)" \
92 DESTDIR="$(PKG_INSTALL_DIR)" \
93 bin_SCRIPTS="mysql_config" \
97 define Build/InstallDev
99 $(CP) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
100 mkdir -p $(1)/usr/include
101 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
102 # NOTE: needed for MySQL-Python
103 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
104 mkdir -p $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
106 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
109 define Build/UninstallDev
111 $(STAGING_DIR)/usr/bin/mysql_config \
112 $(STAGING_DIR)/usr/include/mysql \
113 $(STAGING_DIR)/usr/lib/mysql
116 define Package/libmysqlclient/install
117 $(INSTALL_DIR) $(1)/usr/lib
118 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
121 $(eval $(call BuildPackage,libmysqlclient))