Skip to content

Commit

Permalink
Build of mariadb completes, but packaging is not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
darabi authored and Reza Rahimi committed Apr 10, 2015
1 parent dfcc0c6 commit a20451f
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 49 deletions.
53 changes: 53 additions & 0 deletions feeds/packages/libs/jemalloc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=jemalloc
PKG_VERSION:=3.5.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.canonware.com/download/jemalloc
PKG_MD5SUM:=43a6ce2f60d14d58c4b28b73b8b70cd2

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

define Package/jemalloc
SECTION:=libs
CATEGORY:=Libraries
TITLE:=malloc alternative
DEPENDS:=+libpthread
URL:=http://www.canonware.com/jemalloc/index.html
endef

define Package/jemalloc/description
jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.
endef

CONFIGURE_ARGS += \
--host=$(REAL_GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--disable-experimental \
je_cv_static_page_shift=12

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/jemalloc
$(CP) $(PKG_INSTALL_DIR)/usr/include/jemalloc/jemalloc.h $(1)/usr/include/jemalloc
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjemalloc*.{a,so*} $(1)/usr/lib/
endef

define Package/jemalloc/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjemalloc.so* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjemalloc*.a $(1)/usr/lib/
endef

$(eval $(call BuildPackage,jemalloc))
223 changes: 177 additions & 46 deletions feeds/packages/utils/mariadb/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2015 OpenWrt.org
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
Expand Down Expand Up @@ -31,35 +31,43 @@ include $(INCLUDE_DIR)/cmake.mk
define Package/libmariadbclient/Default
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=$(CXX_DEPENDS) +zlib +xz
DEPENDS:=$(CXX_DEPENDS) +zlib +xz @BROKEN
TITLE:=MariaDB client library
URL:=http://mariadb.com/
endef

define Package/mariadb-server
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libmariadbclient +libpthread +libncursesw +libreadline +libevent
DEPENDS:=+libmariadbclient +libpthread +libncursesw +libreadline +libevent +xz
TITLE:=MariaDB Server
URL:=http://mariadb.com/
SUBMENU:=database
endef

define Package/libmariadbclient
$(call Package/libmariadbclient/Default)
DEPENDS+= +libpthread +libopenssl +libcrypto +libncurses +libevent +libform
endef

define Package/libmariadbclient-r
$(call Package/libmariadbclient/Default)
TITLE += threadsafe
DEPENDS+= +libpthread
DEPENDS+= +libpthread +libopenssl +libncurses +libevent +libform
endef

TARGET_CXX=g++-uc
CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE:String="MinSizeRel" \
-DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr \
-DWITH_PARTITION_STORAGE_ENGINE:BOOL=ON \
-DWITH_UNIT_TESTS:BOOL=OFF \
-DSTACK_DIRECTION=-1 \
-DWITH_JEMALLOC:STRING=system \
-DCURSES_USE_NCURSES=TRUE \
-DCURSES_LIBRARY="$(STAGING_DIR)/usr/lib/libncursesw.so" \
-DCURSES_INCLUDE_PATH="$(STAGING_DIR)/usr/include"

TARGET_CFLAGS += $(FPIC)

CMAKE_OPTIONS += -DSTACK_DIRECTION=-1 -DXTRADB_OK=1 -DWITHOUT_XTRADB=1 -DHAVE_BACKTRACE_WITHOUT_EXECINFO=1 -DWITH_UNIT_TESTS=0 -DHAVE_CXX_-Wmissing-prototypes=0 -DHAVE_CXX_-Wstrict-prototypes=1 -DHAVE_STDCXX11=1 -DHAVE_STDCXX0X=1 -DHAVE_CXX_-Wcast-align=1 -DHAVE_CXX_-Wshadow=1 -DHAVE_CXX_-Wpointer-arith=1 -DHAVE_CXX_-Wmissing-declarations=1 -DHAVE_CXX_-Wbad-function-cast=1 -DHAVE_CXX_-Wno-missing-noreturn=0 -DHAVE_C_-fno-rtti=1 -DHAVE_C_-Wcast-align=1 -DHAVE_C_-Wshadow=1 -DHAVE_C_-Wpointer-arith=1 -DHAVE_C_-Wmissing-declarations=1 -DHAVE_C_-Wmissing-prototypes=1 -DHAVE_C_-Wstrict-prototypes=1 -DHAVE_C_-Wno-missing-noreturn=0 -DHAVE_C_-Wbad-function-cast=1 -DHAVE_C_-Wextra=1 -DHAVE_C_-Wno-error=strict-overflow
# CMAKE_OPTIONS += -DSTACK_DIRECTION=-1 -DXTRADB_OK=1 -DWITHOUT_XTRADB=1 -DHAVE_BACKTRACE_WITHOUT_EXECINFO=1 -DWITH_UNIT_TESTS=0 -DHAVE_CXX_-Wmissing-prototypes=0 -DHAVE_CXX_-Wstrict-prototypes=1 -DHAVE_STDCXX11=1 -DHAVE_STDCXX0X=1 -DHAVE_CXX_-Wcast-align=1 -DHAVE_CXX_-Wshadow=1 -DHAVE_CXX_-Wpointer-arith=1 -DHAVE_CXX_-Wmissing-declarations=1 -DHAVE_CXX_-Wbad-function-cast=1 -DHAVE_CXX_-Wno-missing-noreturn=0 -DHAVE_C_-fno-rtti=1 -DHAVE_C_-Wcast-align=1 -DHAVE_C_-Wshadow=1 -DHAVE_C_-Wpointer-arith=1 -DHAVE_C_-Wmissing-declarations=1 -DHAVE_C_-Wmissing-prototypes=1 -DHAVE_C_-Wstrict-prototypes=1 -DHAVE_C_-Wno-missing-noreturn=0 -DHAVE_C_-Wbad-function-cast=1 -DHAVE_C_-Wextra=1 -DHAVE_C_-Wno-error=strict-overflow

# CONFIGURE_ARGS += \
# --enable-shared \
Expand Down Expand Up @@ -89,49 +97,17 @@ CMAKE_OPTIONS += -DSTACK_DIRECTION=-1 -DXTRADB_OK=1 -DWITHOUT_XTRADB=1 -DHAVE_BA
# mariadb_cv_gcc_atomic_builtins_pthread_t=yes \
# ac_cv_c_stack_direction=-1

define Build/Configure
cd $(PKG_BUILD_DIR) && ./BUILD/compile-pentium64
endef

define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all
$(MAKE) -C "$(PKG_BUILD_DIR)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
install
g++ -I $(PKG_BUILD_DIR)/include \
-o $(PKG_BUILD_DIR)/sql/gen_lex_hash \
$(PKG_BUILD_DIR)/sql/gen_lex_hash.cc
+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmariadb" \
CC="g++" \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CFLAGS)" \
LDFLAGS="$(HOST_LDFLAGS)" \
conf_to_src
+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
SUBDIRS="libmariadb" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all
$(MAKE) -C "$(PKG_BUILD_DIR)" \
SUBDIRS="libmariadb" \
DESTDIR="$(PKG_INSTALL_DIR)" \
install
+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
SUBDIRS="libmariadb_r" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all
$(MAKE) -C "$(PKG_BUILD_DIR)" \
SUBDIRS="libmariadb_r" \
DESTDIR="$(PKG_INSTALL_DIR)" \
install
$(MAKE) -C "$(PKG_BUILD_DIR)" \
SUBDIRS="scripts" \
DESTDIR="$(PKG_INSTALL_DIR)" \
bin_SCRIPTS="mariadb_config" \
install
+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
all
$(MAKE) -C "$(PKG_BUILD_DIR)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
install
endef


Expand All @@ -148,11 +124,11 @@ endef

define Package/libmariadbclient/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/mariadb/libmariadbclient.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/local/mysql/lib/libmysqlclient.so.* $(1)/usr/lib/
endef
define Package/libmariadbclient-r/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/mariadb/libmariadbclient_r.so.* $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/local/mysql/lib/libmysqlclient_r.so.* $(1)/usr/lib/
endef

define Package/mariadb-server/install
Expand All @@ -177,8 +153,163 @@ endef

define Package/mariadb-server/conffiles
/etc/my.cnf
/usr/lib/libmysqlclient.so.18
endef

$(eval $(call BuildPackage,mariadb-server))
$(eval $(call BuildPackage,libmariadbclient))
$(eval $(call BuildPackage,libmariadbclient-r))


# --------------------------------------------------------------------------------------

# include $(INCLUDE_DIR)/package.mk
# include $(INCLUDE_DIR)/cmake.mk

# define Package/libmariadbclient/Default
# SECTION:=libs
# CATEGORY:=Libraries
# DEPENDS:=$(CXX_DEPENDS) +zlib @BROKEN
# TITLE:=MariaDB client library
# URL:=http://mariadb.org
# endef

# define Package/mariadb-server
# SECTION:=utils
# CATEGORY:=Utilities
# DEPENDS:=+libmariadbclient +libpthread +libncursesw +libreadline +jemalloc @BROKEN
# TITLE:=MariaDB Server
# URL:=http://mariadb.org
# SUBMENU:=Database
# endef

# define Package/libmariadbclient
# $(call Package/libmariadbclient/Default)
# endef

# define Package/libmariadbclient-r
# $(call Package/libmariadbclient/Default)
# TITLE += threadsafe
# DEPENDS+= +libpthread @BROKEN
# endef


# CMAKE_OPTIONS += \
# -DCMAKE_BUILD_TYPE:String="MinSizeRel" \
# -DCMAKE_PREFIX_PATH=$(STAGING_DIR)/usr \
# -DWITH_PARTITION_STORAGE_ENGINE:BOOL=ON \
# -DWITH_UNIT_TESTS:BOOL=OFF \
# -DSTACK_DIRECTION=-1 \
# -DWITH_JEMALLOC:STRING=system \
# -DCURSES_USE_NCURSES=TRUE \
# -DCURSES_LIBRARY="$(STAGING_DIR)/usr/lib/libncursesw.so" \
# -DCURSES_INCLUDE_PATH="$(STAGING_DIR)/usr/include"


# define Build/InstallDev
# $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
# ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
# $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
# # NOTE: needed for MySQL-Python
# $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
# $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
# rm -f $(1)/usr/lib/mysql/libmysqlclient.la
# endef

# define Package/libmariadbclient/install
# $(INSTALL_DIR) $(1)/usr/lib
# $(CP) $(PKG_INSTALL_DIR)/usr/lib/mariadb/libmariadbclient.so.* $(1)/usr/lib/
# endef
# define Package/libmariadbclient-r/install
# $(INSTALL_DIR) $(1)/usr/lib
# $(CP) $(PKG_INSTALL_DIR)/usr/lib/mariadb/libmariadbclient_r.so.* $(1)/usr/lib/
# endef

# define Package/mariadb-server/install
# $(INSTALL_DIR) $(1)/usr/bin
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqlb $(1)/usr/bin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
# $(INSTALL_DIR) $(1)/etc/init.d/
# $(INSTALL_BIN) files/mysql.init $(1)/etc/init.d/mysqld
# $(INSTALL_CONF) conf/my.cnf $(1)/etc/
# $(INSTALL_DIR) $(1)/usr/share/mysql
# $(INSTALL_DIR) $(1)/usr/share/mysql/english
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mariadb_system_tables.sql $(1)/usr/share/mysql/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mariadb_system_tables_data.sql $(1)/usr/share/mysql/
# endef

# define Package/mariadb-server/conffiles
# /etc/my.cnf
# endef

# $(eval $(call BuildPackage,mariadb-server))
# $(eval $(call BuildPackage,libmariadbclient))
# $(eval $(call BuildPackage,libmariadbclient-r))

# diff --git a/libs/mariadb/conf/my.cnf b/libs/mariadb/conf/my.cnf
# new file mode 100644
# index 0000000..ec2ade2
# --- /dev/null
# -++ b/libs/mariadb/conf/my.cnf
# @@ -0,0 +1,54 @@
# [client]
# port = 3306
# socket = /var/run/mysqld.sock

# [mysqld]
# user = root
# socket = /var/run/mysqld.sock
# port = 3306
# basedir = /usr

# ############ Don't put this on the NAND #############
# # Figure out where you are going to put the databases
# # And run mysql_install_db --force
# datadir = /mnt/data/mysql/

# ######### This should also not go on the NAND #######
# tmpdir = /mnt/data/tmp/

# skip-external-locking

# bind-address = 127.0.0.1

# # Fine Tuning
# key_buffer = 16M
# max_allowed_packet = 16M
# thread_stack = 192K
# thread_cache_size = 8

# # Here you can see queries with especially long duration
# #log_slow_queries = /var/log/mysql/mysql-slow.log
# #long_query_time = 2
# #log-queries-not-using-indexes

# # The following can be used as easy to replay backup logs or for replication.
# #server-id = 1
# #log_bin = /var/log/mysql/mysql-bin.log
# #expire_logs_days = 10
# #max_binlog_size = 100M
# #binlog_do_db = include_database_name
# #binlog_ignore_db = include_database_name


# [mysqldump]
# quick
# quote-names
# max_allowed_packet = 16M

# [mysql]
# #no-auto-rehash # faster start of mysql but no tab completition

# [isamchk]
# key_buffer = 16M

7 changes: 4 additions & 3 deletions m-creations/config-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -2155,6 +2155,7 @@ CONFIG_PACKAGE_bind-libs=m
# CONFIG_PACKAGE_engine_pkcs11 is not set
# CONFIG_PACKAGE_fcgi is not set
CONFIG_PACKAGE_glib2=m
CONFIG_PACKAGE_jemalloc=m
# CONFIG_PACKAGE_libaio is not set
# CONFIG_PACKAGE_libantlr3c is not set
# CONFIG_PACKAGE_libao is not set
Expand Down Expand Up @@ -2259,8 +2260,6 @@ CONFIG_PACKAGE_liblua=m
# CONFIG_PACKAGE_liblzo is not set
CONFIG_PACKAGE_libmad=m
CONFIG_PACKAGE_libmagic=m
CONFIG_PACKAGE_libmariadbclient=m
CONFIG_PACKAGE_libmariadbclient-r=m
CONFIG_PACKAGE_libmcrypt=m
# CONFIG_PACKAGE_libmicroxml is not set
# CONFIG_PACKAGE_libminiupnpc is not set
Expand All @@ -2273,7 +2272,9 @@ CONFIG_PACKAGE_libmosquitto=m
CONFIG_PACKAGE_libmpdclient=m
# CONFIG_PACKAGE_libmpeg2 is not set
CONFIG_PACKAGE_libmysqlclient=m
CONFIG_PACKAGE_libmysqlclient-galera=m
CONFIG_PACKAGE_libmysqlclient-r=m
CONFIG_PACKAGE_libmysqlclient-r-galera=m
# CONFIG_PACKAGE_libnatpmp is not set
CONFIG_PACKAGE_libncurses=y
CONFIG_PACKAGE_libncursesw=m
Expand Down Expand Up @@ -3350,7 +3351,7 @@ CONFIG_PACKAGE_acl=m
#
# database
#
CONFIG_PACKAGE_mariadb-server=m
CONFIG_PACKAGE_mysql-galera=m
CONFIG_PACKAGE_mysql-server=m
CONFIG_PACKAGE_pgsql-cli=m
CONFIG_PACKAGE_pgsql-server=m
Expand Down

0 comments on commit a20451f

Please sign in to comment.