ulogd: moved to github
[openwrt.org/packages.git] / libs / Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#
# Copyright (C) 2006-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
 
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/uclibc++.mk
 
PKG_NAME:=mysql
PKG_VERSION:=5.1.73
PKG_RELEASE:=1
 
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=\
        http://mysql.he.net/Downloads/MySQL-5.1/ \
        http://www.linorg.usp.br/mysql/Downloads/MySQL-5.1/ \
        http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/ \
        http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-5.1/ \
        http://downloads.mysql.com/archives/mysql-5.1/
 
PKG_MD5SUM:=887f869bcc757957067b9198f707f32f
 
PKG_BUILD_DEPENDS:=libncurses libreadline
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
 
PKG_FIXUP:=libtool
 
include $(INCLUDE_DIR)/package.mk
 
define Package/libmysqlclient/Default
  SECTION:=libs
  CATEGORY:=Libraries
  DEPENDS:=$(CXX_DEPENDS) +zlib
  TITLE:=MySQL client library
  URL:=http://dev.mysql.com/
endef
 
define Package/mysql-server
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libmysqlclient +libpthread +libncursesw +libreadline
  TITLE:=MySQL Server
  URL:=http://dev.mysql.com/
  SUBMENU:=database
endef
 
define Package/libmysqlclient
  $(call Package/libmysqlclient/Default)
endef
 
define Package/libmysqlclient-r
  $(call Package/libmysqlclient/Default)
  TITLE += threadsafe
  DEPENDS+= +libpthread
endef
 
TARGET_CXX=g++-uc
 
TARGET_CFLAGS += $(FPIC)
 
CONFIGURE_ARGS += \
        --enable-shared \
        --enable-static \
        --enable-thread-safe-client \
        --disable-assembler \
        --with-pthread \
        --with-server \
        --without-mysqlmanager \
        --with-mysqld-user=root \
        --with-unix-socket-path=/tmp \
        --without-libwrap \
        --with-low-memory \
        --without-embedded-server \
        --without-query-cache \
        --without-ssl \
        --without-docs \
        --without-man \
        --without-readline \
        --without-debug \
        --with-named-thread-libs=-lpthread
 
CONFIGURE_VARS += \
        mysql_cv_compress=yes \
        mysql_cv_gethostname_style=glibc2 \
        mysql_cv_gcc_atomic_builtins=yes \
        mysql_cv_gcc_atomic_builtins_pthread_t=yes \
        ac_cv_c_stack_direction=-1
 
define Build/Compile
        +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="include" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="include" \
                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)/libmysql" \
                CC="g++" \
                CFLAGS="$(HOST_CFLAGS)" \
                CPPFLAGS="$(HOST_CFLAGS)" \
                LDFLAGS="$(HOST_LDFLAGS)" \
                conf_to_src
        +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="libmysql" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="libmysql" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                install
        +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="libmysql_r" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                all
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="libmysql_r" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                install
        $(MAKE) -C "$(PKG_BUILD_DIR)" \
                SUBDIRS="scripts" \
                DESTDIR="$(PKG_INSTALL_DIR)" \
                bin_SCRIPTS="mysql_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
 
 
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/libmysqlclient/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
endef
define Package/libmysqlclient-r/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
endef
 
define Package/mysql-server/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(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/mysqld.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/mysql_system_tables.sql $(1)/usr/share/mysql/
        $(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))
 
comments