Update makefiles to use the autotools stuff put in the template, remove bogus stamp...
[packages.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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=mysql
12 PKG_VERSION:=5.0.18
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=\
17         http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
18         http://mysql.he.net/Downloads/MySQL-5.0/ \
19         http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
20         http://mysql.holywar.net/Downloads/MySQL-5.0/
21 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
22 PKG_CAT:=zcat
23
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26
27 PKG_BUILDDEP:=libncurses libreadline
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/libmysqlclient
32   SECTION:=libs
33   CATEGORY:=Libraries
34   DEPENDS:=zlib
35   TITLE:=MySQL client library
36   URL:=http://dev.mysql.com/
37 endef
38
39 define Build/Configure
40         $(call Build/Configure/Default, \
41                 --enable-shared \
42                 --enable-static \
43                 --disable-assembler \
44                 --with-pthread \
45                 --without-raid \
46                 --with-unix-socket-path=/tmp \
47                 --without-libwrap \
48                 --without-pstack \
49                 --with-low-memory \
50                 --without-server \
51                 --without-embedded-server \
52                 --without-query-cache \
53                 --without-mysqlfs \
54                 --without-vio \
55                 --without-openssl \
56                 --without-docs \
57                 --without-bench \
58                 --without-readline \
59                 --with-named-thread-libs=-lpthread \
60                 , \
61                 mysql_cv_compress=yes \
62                 mysql_cv_gethostname_style=glibc2 \
63         );
64 endef
65
66 define Build/Compile
67         rm -rf $(PKG_INSTALL_DIR)
68         mkdir -p $(PKG_INSTALL_DIR)
69         $(MAKE) -C "$(PKG_BUILD_DIR)" \
70                 SUBDIRS="include" \
71                 DESTDIR="$(PKG_INSTALL_DIR)" \
72                 all install
73         $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
74                 CC="$(HOSTCC)" \
75                 LINK="$(HOSTCC) -o conf_to_src -lc" \
76                 CFLAGS="" \
77                 CPPFLAGS="" \
78                 conf_to_src
79         $(MAKE) -C "$(PKG_BUILD_DIR)" \
80                 SUBDIRS="libmysql" \
81                 DESTDIR="$(PKG_INSTALL_DIR)" \
82                 all install
83         $(MAKE) -C "$(PKG_BUILD_DIR)" \
84                 SUBDIRS="scripts" \
85                 DESTDIR="$(PKG_INSTALL_DIR)" \
86                 bin_SCRIPTS="mysql_config" \
87                 install
88 endef
89
90 define Build/InstallDev
91         mkdir -p $(STAGING_DIR)/usr/bin
92         $(CP) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(STAGING_DIR)/usr/bin/
93         mkdir -p $(STAGING_DIR)/usr/include
94         $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(STAGING_DIR)/usr/include/
95         mkdir -p $(STAGING_DIR)/usr/lib
96         $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(STAGING_DIR)/usr/lib/
97         rm -f $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.la
98 endef
99
100 define Build/UninstallDev
101         rm -rf \
102                 $(STAGING_DIR)/usr/bin/mysql_config \
103                 $(STAGING_DIR)/usr/include/mysql \
104                 $(STAGING_DIR)/usr/lib/mysql
105 endef
106
107 define Package/libmysqlclient/install
108         install -d -m0755 $(1)/usr/lib
109         $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
110 endef
111
112 $(eval $(call BuildPackage,libmysqlclient))