mysql: decrease package number
[openwrt/svn-archive/archive.git] / libs / mysql / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mysql
11 PKG_VERSION:=5.1.53
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=\
16 http://mysql.planetmirror.com/Downloads/MySQL-5.1/ \
17 http://mysql.he.net/Downloads/MySQL-5.1/ \
18 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.1/ \
19 http://mysql.holywar.net/Downloads/MySQL-5.1/
20 PKG_MD5SUM:=e5e7c5b0b5c382489e6a66778703bc46
21
22 PKG_BUILD_DEPENDS:=libncurses libreadline
23 PKG_BUILD_PARALLEL:=1
24 PKG_FIXUP:=libtool
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/libmysqlclient/Default
29 SECTION:=libs
30 CATEGORY:=Libraries
31 DEPENDS:=+zlib
32 TITLE:=MySQL client library
33 URL:=http://dev.mysql.com/
34 endef
35
36 define Package/mysql-server/Default
37 SECTION:=utils
38 CATEGORY:=Utilities
39 DEPENDS:=+zlib +libmysqlclient +uclibcxx
40 TITLE:=MySQL Server
41 URL:=http://dev.mysql.com/
42 SUBMENU:=database
43 endef
44
45 define Package/mysql-server
46 $(call Package/mysql-server/Default)
47 endef
48
49 define Package/libmysqlclient
50 $(call Package/libmysqlclient/Default)
51 endef
52
53 define Package/libmysqlclient_r
54 $(call Package/libmysqlclient/Default)
55 TITLE += threadsafe
56 endef
57
58 CONFIGURE_VARS += \
59 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
60 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++" \
61 LDFLAGS="$$$$LDFLAGS" \
62 LIBS="-nodefaultlibs -luClibc++ -lm $(LIBGCC_S)" \
63 CLIENTCLIBS="-nodefaultlibs -luClibc++ -lm $(LIBGCC_S)" \
64
65
66 define Build/Configure
67 (cd $(PKG_BUILD_DIR); touch \
68 configure.in \
69 aclocal.m4 \
70 Makefile.in \
71 config.h.in \
72 configure \
73 );
74 $(CP) files/lex_hash.h $(PKG_BUILD_DIR)/sql/lex_hash.h
75
76 $(call Build/Configure/Default, \
77 --enable-shared \
78 --enable-static \
79 --enable-thread-safe-client \
80 --disable-assembler \
81 --with-pthread \
82 --with-server \
83 --without-mysqlmanager \
84 --without-raid \
85 --with-mysqld-user=root \
86 --with-unix-socket-path=/tmp \
87 --without-libwrap \
88 --without-pstack \
89 --with-low-memory \
90 --without-embedded-server \
91 --without-query-cache \
92 --without-mysqlfs \
93 --without-vio \
94 --without-ssl \
95 --without-docs \
96 --without-man \
97 --without-bench \
98 --without-readline \
99 --without-debug \
100 --with-named-thread-libs=-lpthread \
101 , \
102 mysql_cv_compress=yes \
103 mysql_cv_gethostname_style=glibc2 \
104 ac_cv_c_stack_direction=-1 \
105 );
106 endef
107
108 TARGET_CFLAGS += $(FPIC)
109
110 define Build/Compile
111 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
112 SUBDIRS="include" \
113 DESTDIR="$(PKG_INSTALL_DIR)" \
114 all
115 $(MAKE) -C "$(PKG_BUILD_DIR)" \
116 SUBDIRS="include" \
117 DESTDIR="$(PKG_INSTALL_DIR)" \
118 install
119 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmysql" \
120 CC="$(HOSTCC)" \
121 LINK="$(HOSTCC) -o conf_to_src -lc" \
122 CFLAGS="" \
123 CPPFLAGS="" \
124 conf_to_src
125 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
126 SUBDIRS="libmysql" \
127 DESTDIR="$(PKG_INSTALL_DIR)" \
128 all
129 $(MAKE) -C "$(PKG_BUILD_DIR)" \
130 SUBDIRS="libmysql" \
131 DESTDIR="$(PKG_INSTALL_DIR)" \
132 install
133 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
134 SUBDIRS="libmysql_r" \
135 DESTDIR="$(PKG_INSTALL_DIR)" \
136 all
137 $(MAKE) -C "$(PKG_BUILD_DIR)" \
138 SUBDIRS="libmysql_r" \
139 DESTDIR="$(PKG_INSTALL_DIR)" \
140 install
141 $(MAKE) -C "$(PKG_BUILD_DIR)" \
142 SUBDIRS="scripts" \
143 DESTDIR="$(PKG_INSTALL_DIR)" \
144 bin_SCRIPTS="mysql_config" \
145 install
146 $(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
147 DESTDIR="$(PKG_INSTALL_DIR)" \
148 all
149 $(MAKE) -C "$(PKG_BUILD_DIR)" \
150 DESTDIR="$(PKG_INSTALL_DIR)" \
151 install
152 endef
153
154
155 define Build/InstallDev
156 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
157 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
158 ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
159 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
160 # NOTE: needed for MySQL-Python
161 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
162 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
163 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
164 endef
165
166 define Package/libmysqlclient/install
167 $(INSTALL_DIR) $(1)/usr/lib
168 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
169 endef
170 define Package/libmysqlclient_r/install
171 $(INSTALL_DIR) $(1)/usr/lib
172 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
173 endef
174
175 define Package/mysql-server/install
176 $(INSTALL_DIR) $(1)/usr/bin
177 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/
178 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/
179 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
180 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
181 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
182 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/
183 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
184 $(INSTALL_DIR) $(1)/etc/init.d/
185 $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
186 $(INSTALL_CONF) conf/my.cnf $(1)/etc/
187 $(INSTALL_DIR) $(1)/usr/share/mysql
188 $(INSTALL_DIR) $(1)/usr/share/mysql/english
189 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/
191 endef
192
193 $(eval $(call BuildPackage,mysql-server))
194 $(eval $(call BuildPackage,libmysqlclient))
195 $(eval $(call BuildPackage,libmysqlclient_r))