[packages] Use default templates instead of custom reimplementations where applicable
[openwrt/svn-archive/archive.git] / libs / mysql / Makefile
1 #
2 # Copyright (C) 2006 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.0.18
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.0/ \
17 http://mysql.he.net/Downloads/MySQL-5.0/ \
18 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
19 http://mysql.holywar.net/Downloads/MySQL-5.0/
20 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
21
22 PKG_BUILD_DEPENDS:=libncurses libreadline
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/libmysqlclient
27 SECTION:=libs
28 CATEGORY:=Libraries
29 DEPENDS:=+zlib
30 TITLE:=MySQL client library
31 URL:=http://dev.mysql.com/
32 endef
33
34 define Build/Configure
35 (cd $(PKG_BUILD_DIR); touch \
36 configure.in \
37 aclocal.m4 \
38 Makefile.in \
39 config.h.in \
40 configure \
41 );
42 $(call Build/Configure/Default, \
43 --enable-shared \
44 --enable-static \
45 --disable-assembler \
46 --with-pthread \
47 --without-raid \
48 --with-unix-socket-path=/tmp \
49 --without-libwrap \
50 --without-pstack \
51 --with-low-memory \
52 --without-server \
53 --without-embedded-server \
54 --without-query-cache \
55 --without-mysqlfs \
56 --without-vio \
57 --without-openssl \
58 --without-docs \
59 --without-bench \
60 --without-readline \
61 --with-named-thread-libs=-lpthread \
62 , \
63 mysql_cv_compress=yes \
64 mysql_cv_gethostname_style=glibc2 \
65 );
66 endef
67
68 TARGET_CFLAGS += $(FPIC)
69
70 define Build/Compile
71 $(MAKE) -C "$(PKG_BUILD_DIR)" \
72 SUBDIRS="include" \
73 DESTDIR="$(PKG_INSTALL_DIR)" \
74 all install
75 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
76 CC="$(HOSTCC)" \
77 LINK="$(HOSTCC) -o conf_to_src -lc" \
78 CFLAGS="" \
79 CPPFLAGS="" \
80 conf_to_src
81 $(MAKE) -C "$(PKG_BUILD_DIR)" \
82 SUBDIRS="libmysql" \
83 DESTDIR="$(PKG_INSTALL_DIR)" \
84 all install
85 $(MAKE) -C "$(PKG_BUILD_DIR)" \
86 SUBDIRS="scripts" \
87 DESTDIR="$(PKG_INSTALL_DIR)" \
88 bin_SCRIPTS="mysql_config" \
89 install
90 endef
91
92 define Build/InstallDev
93 $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
95 ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
96 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
97 # NOTE: needed for MySQL-Python
98 $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
99 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
100 rm -f $(1)/usr/lib/mysql/libmysqlclient.la
101 endef
102
103 define Package/libmysqlclient/install
104 $(INSTALL_DIR) $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
106 endef
107
108 $(eval $(call BuildPackage,libmysqlclient))