cleanup
[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 # $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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=\
18 http://mysql.planetmirror.com/Downloads/MySQL-5.0/ \
19 http://mysql.he.net/Downloads/MySQL-5.0/ \
20 http://www.linorg.usp.br/mysql/Downloads/MySQL-5.0/ \
21 http://mysql.holywar.net/Downloads/MySQL-5.0/
22 PKG_MD5SUM:=f18153b0239aaa03fc5a751f2d82cb71
23 PKG_CAT:=zcat
24
25 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26 PKG_BUILDDEP:=libncurses libreadline
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/libmysqlclient
31 SECTION:=libs
32 CATEGORY:=Libraries
33 DEPENDS:=zlib
34 TITLE:=MySQL client library
35 DESCRIPTION:=MySQL client library.
36 URL:=http://dev.mysql.com/
37 endef
38
39 define Build/Configure
40 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
41 touch configure.in; \
42 touch aclocal.m4; \
43 touch Makefile.in; \
44 touch config.h.in; \
45 touch configure; \
46 $(TARGET_CONFIGURE_OPTS) \
47 CFLAGS="$(TARGET_CFLAGS)" \
48 CXXFLAGS="$(TARGET_CFLAGS)" \
49 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
50 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
51 mysql_cv_compress=yes \
52 mysql_cv_gethostname_style=glibc2 \
53 ./configure \
54 --target=$(GNU_TARGET_NAME) \
55 --host=$(GNU_TARGET_NAME) \
56 --build=$(GNU_HOST_NAME) \
57 --program-prefix="" \
58 --program-suffix="" \
59 --prefix=/usr \
60 --exec-prefix=/usr \
61 --bindir=/usr/bin \
62 --datadir=/usr/share \
63 --includedir=/usr/include \
64 --infodir=/usr/share/info \
65 --libdir=/usr/lib \
66 --libexecdir=/usr/lib \
67 --localstatedir=/var \
68 --mandir=/usr/share/man \
69 --sbindir=/usr/sbin \
70 --sysconfdir=/etc \
71 $(DISABLE_LARGEFILE) \
72 $(DISABLE_NLS) \
73 --enable-shared \
74 --enable-static \
75 --disable-assembler \
76 --with-pthread \
77 --without-raid \
78 --with-unix-socket-path=/tmp \
79 --without-libwrap \
80 --without-pstack \
81 --with-low-memory \
82 --without-server \
83 --without-embedded-server \
84 --without-query-cache \
85 --without-mysqlfs \
86 --without-vio \
87 --without-openssl \
88 --without-docs \
89 --without-bench \
90 --without-readline \
91 --with-named-thread-libs=-lpthread \
92 );
93 endef
94
95 define Build/Compile
96 rm -rf $(PKG_INSTALL_DIR)
97 mkdir -p $(PKG_INSTALL_DIR)
98 $(MAKE) -C "$(PKG_BUILD_DIR)" \
99 SUBDIRS="include" \
100 DESTDIR="$(PKG_INSTALL_DIR)" \
101 all install
102 $(MAKE) -C "$(PKG_BUILD_DIR)/libmysql" \
103 CC="$(HOSTCC)" \
104 LINK="$(HOSTCC) -o conf_to_src -lc" \
105 CFLAGS="" \
106 CPPFLAGS="" \
107 conf_to_src
108 $(MAKE) -C "$(PKG_BUILD_DIR)" \
109 SUBDIRS="libmysql" \
110 DESTDIR="$(PKG_INSTALL_DIR)" \
111 all install
112 $(MAKE) -C "$(PKG_BUILD_DIR)" \
113 SUBDIRS="scripts" \
114 DESTDIR="$(PKG_INSTALL_DIR)" \
115 bin_SCRIPTS="mysql_config" \
116 install
117 endef
118
119 define Package/libmysqlclient/install
120 install -d -m0755 $(1)/usr/lib
121 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
122 endef
123
124 define Build/InstallDev
125 mkdir -p $(STAGING_DIR)/usr/bin
126 $(CP) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(STAGING_DIR)/usr/bin/
127 mkdir -p $(STAGING_DIR)/usr/include
128 $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(STAGING_DIR)/usr/include/
129 mkdir -p $(STAGING_DIR)/usr/lib
130 $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(STAGING_DIR)/usr/lib/
131 rm -f $(STAGING_DIR)/usr/lib/mysql/libmysqlclient.la
132 endef
133
134 define Build/UninstallDev
135 rm -rf \
136 $(STAGING_DIR)/usr/bin/mysql_config \
137 $(STAGING_DIR)/usr/include/mysql \
138 $(STAGING_DIR)/usr/lib/mysql
139 endef
140
141 $(eval $(call BuildPackage,libmysqlclient))