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.

187 lines
5.3 KiB

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