You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
5.4 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/uclibc++.mk
  9. PKG_NAME:=mysql
  10. PKG_VERSION:=5.1.73
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=\
  14. http://mysql.he.net/Downloads/MySQL-5.1/ \
  15. http://www.linorg.usp.br/mysql/Downloads/MySQL-5.1/ \
  16. http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/ \
  17. http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-5.1/
  18. PKG_HASH:=05ebe21305408b24407d14b77607a3e5ffa3c300e03f1359d3066f301989dcb5
  19. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  20. PKG_LICENSE:=GPL-2.0
  21. PKG_BUILD_PARALLEL:=1
  22. PKG_USE_MIPS16:=0
  23. PKG_FIXUP:=libtool
  24. include $(INCLUDE_DIR)/package.mk
  25. define Package/libmysqlclient/Default
  26. SECTION:=libs
  27. CATEGORY:=Libraries
  28. DEPENDS:=$(CXX_DEPENDS) +zlib
  29. TITLE:=MySQL client library
  30. URL:=http://dev.mysql.com/
  31. endef
  32. define Package/mysql-server
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. DEPENDS:=+libmysqlclient +libpthread +libncurses +libreadline
  36. TITLE:=MySQL Server
  37. URL:=http://dev.mysql.com/
  38. SUBMENU:=database
  39. endef
  40. define Package/libmysqlclient
  41. $(call Package/libmysqlclient/Default)
  42. endef
  43. define Package/libmysqlclient-r
  44. $(call Package/libmysqlclient/Default)
  45. TITLE += threadsafe
  46. DEPENDS+= +libpthread
  47. endef
  48. ifneq ($(CONFIG_USE_UCLIBCXX),)
  49. TARGET_CXX=g++-uc
  50. endif
  51. TARGET_CFLAGS += $(FPIC)
  52. CONFIGURE_ARGS += \
  53. --enable-shared \
  54. --enable-static \
  55. --enable-thread-safe-client \
  56. --disable-assembler \
  57. --with-pthread \
  58. --with-server \
  59. --without-mysqlmanager \
  60. --with-mysqld-user=root \
  61. --with-unix-socket-path=/tmp \
  62. --without-libwrap \
  63. --with-low-memory \
  64. --without-embedded-server \
  65. --without-query-cache \
  66. --without-ssl \
  67. --without-docs \
  68. --without-man \
  69. --without-readline \
  70. --without-debug \
  71. --with-named-thread-libs=-lpthread
  72. CONFIGURE_VARS += \
  73. mysql_cv_compress=yes \
  74. mysql_cv_gethostname_style=glibc2 \
  75. mysql_cv_gcc_atomic_builtins=yes \
  76. mysql_cv_gcc_atomic_builtins_pthread_t=yes \
  77. ac_cv_c_stack_direction=-1
  78. define Build/Compile
  79. +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
  80. SUBDIRS="include" \
  81. DESTDIR="$(PKG_INSTALL_DIR)" \
  82. all
  83. $(MAKE) -C "$(PKG_BUILD_DIR)" \
  84. SUBDIRS="include" \
  85. DESTDIR="$(PKG_INSTALL_DIR)" \
  86. install
  87. g++ -I $(PKG_BUILD_DIR)/include \
  88. -o $(PKG_BUILD_DIR)/sql/gen_lex_hash \
  89. $(PKG_BUILD_DIR)/sql/gen_lex_hash.cc
  90. +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmysql" \
  91. CC="g++" \
  92. CFLAGS="$(HOST_CFLAGS)" \
  93. CPPFLAGS="$(HOST_CFLAGS)" \
  94. LDFLAGS="$(HOST_LDFLAGS)" \
  95. conf_to_src
  96. +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
  97. SUBDIRS="libmysql" \
  98. DESTDIR="$(PKG_INSTALL_DIR)" \
  99. all
  100. $(MAKE) -C "$(PKG_BUILD_DIR)" \
  101. SUBDIRS="libmysql" \
  102. DESTDIR="$(PKG_INSTALL_DIR)" \
  103. install
  104. +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
  105. SUBDIRS="libmysql_r" \
  106. DESTDIR="$(PKG_INSTALL_DIR)" \
  107. all
  108. $(MAKE) -C "$(PKG_BUILD_DIR)" \
  109. SUBDIRS="libmysql_r" \
  110. DESTDIR="$(PKG_INSTALL_DIR)" \
  111. install
  112. $(MAKE) -C "$(PKG_BUILD_DIR)" \
  113. SUBDIRS="scripts" \
  114. DESTDIR="$(PKG_INSTALL_DIR)" \
  115. bin_SCRIPTS="mysql_config" \
  116. install
  117. +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
  118. DESTDIR="$(PKG_INSTALL_DIR)" \
  119. all
  120. $(MAKE) -C "$(PKG_BUILD_DIR)" \
  121. DESTDIR="$(PKG_INSTALL_DIR)" \
  122. install
  123. endef
  124. define Build/InstallDev
  125. $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
  126. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
  127. ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
  128. $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
  129. # NOTE: needed for MySQL-Python
  130. $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
  131. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
  132. rm -f $(1)/usr/lib/mysql/libmysqlclient.la
  133. endef
  134. define Package/libmysqlclient/install
  135. $(INSTALL_DIR) $(1)/usr/lib
  136. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
  137. endef
  138. define Package/libmysqlclient-r/install
  139. $(INSTALL_DIR) $(1)/usr/lib
  140. $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
  141. endef
  142. define Package/mysql-server/install
  143. $(INSTALL_DIR) $(1)/usr/bin
  144. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/
  145. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
  148. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
  149. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/
  150. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
  151. $(INSTALL_DIR) $(1)/etc/init.d/
  152. $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
  153. $(INSTALL_CONF) conf/my.cnf $(1)/etc/
  154. $(INSTALL_DIR) $(1)/usr/share/mysql
  155. $(INSTALL_DIR) $(1)/usr/share/mysql/english
  156. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english
  157. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/
  158. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables.sql $(1)/usr/share/mysql/
  159. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables_data.sql $(1)/usr/share/mysql/
  160. endef
  161. define Package/mysql-server/conffiles
  162. /etc/my.cnf
  163. endef
  164. $(eval $(call BuildPackage,mysql-server))
  165. $(eval $(call BuildPackage,libmysqlclient))
  166. $(eval $(call BuildPackage,libmysqlclient-r))