Add mysql and postgresql packages
[openwrt.git] / package / mysql / ipkg / rules
1 #!/usr/bin/make -f
2
3 ifneq ($(strip ${IPKG_RULES_INC}),)
4 include $(IPKG_RULES_INC)
5 endif
6
7 ##
8
9 PKG_VERSION := $(shell cat ./ipkg/version)
10 CURRENT_DIR := $(shell pwd)
11 INSTALL_DIR ?= $(CURRENT_DIR)/ipkg-install
12
13 unexport INSTALL_DIR
14
15 I_LIBMYSQLCLIENT := ipkg/libmysqlclient
16 I_LIBMYSQLCLIENT_DEV := ipkg/libmysqlclient-dev
17 I_MYSQL_UTILS := ipkg/mysql-utils
18
19 BUILD_DEPS := \
20 $(STAGING_DIR)/usr/include/ncurses.h \
21 # $(STAGING_DIR)/usr/include/zlib.h \
22
23 CONFIGURE_OPTS = \
24 --enable-shared \
25 --enable-static \
26 --disable-assembler \
27 --with-pthread \
28 --without-raid \
29 --with-unix-socket-path=/tmp \
30 --without-libwrap \
31 --without-pstack \
32 --with-low-memory \
33 --without-server \
34 --without-embedded-server \
35 --without-query-cache \
36 --without-mysqlfs \
37 --without-vio \
38 --without-openssl \
39 --without-docs \
40 --without-bench \
41 --without-readline \
42
43 ##
44
45 all: package
46
47
48 .stamp-configured: $(BUILD_DEPS)
49
50 touch configure.in
51 touch aclocal.m4
52 touch Makefile.in
53 touch config.h.in
54 touch configure
55
56 rm -rf config.cache
57 $(TARGET_CONFIGURE_OPTS) \
58 CFLAGS="-I$(STAGING_DIR)/usr/include" \
59 LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
60 OPTIMIZE_CFLAGS="$(TARGET_CFLAGS)" \
61 OPTIMIZE_CXXFLAGS="$(TARGET_CFLAGS)" \
62 ac_atomic_add=yes \
63 ac_atomic_sub=yes \
64 ac_cv_sys_restartable_syscalls=yes \
65 ac_cv_conv_longlong_to_float=yes \
66 mysql_cv_compress=yes \
67 mysql_cv_gethostname_style=glibc2 \
68 ./configure \
69 --target=$(GNU_TARGET_NAME) \
70 --host=$(GNU_TARGET_NAME) \
71 --build=$(GNU_HOST_NAME) \
72 --program-prefix="" \
73 --program-suffix="" \
74 --prefix=/usr \
75 --exec-prefix=/usr \
76 --bindir=/usr/bin \
77 --datadir=/usr/share \
78 --includedir=/usr/include \
79 --infodir=/usr/share/info \
80 --libdir=/usr/lib \
81 --libexecdir=/usr/lib \
82 --localstatedir=/var \
83 --mandir=/usr/share/man \
84 --sbindir=/usr/sbin \
85 --sysconfdir=/etc \
86 $(DISABLE_LARGEFILE) \
87 $(DISABLE_NLS) \
88 $(CONFIGURE_OPTS) \
89
90 touch .stamp-configured
91
92
93 .stamp-built: .stamp-configured
94
95 $(MAKE) -C "libmysql" \
96 CC="$(HOSTCC)" \
97 LINK="$(HOSTCC) -o conf_to_src -lc" \
98 CFLAGS="" \
99 conf_to_src
100
101 $(MAKE) \
102 SUBDIRS="include libmysql" \
103 all
104
105 $(MAKE) -C "client" mysqladmin mysqlshow
106
107 touch .stamp-built
108
109
110 $(INSTALL_DIR)/usr/include/mysql/mysql.h: .stamp-built
111
112 mkdir -p $(INSTALL_DIR)
113
114 $(MAKE) \
115 DESTDIR="$(INSTALL_DIR)" \
116 SUBDIRS="include libmysql" \
117 install
118
119 $(MAKE) -C "client" \
120 DESTDIR="$(INSTALL_DIR)" \
121 bin_PROGRAMS="mysqladmin mysqlshow" \
122 install
123
124
125 configure: .stamp-configured
126
127
128 build: .stamp-built
129
130
131 install: $(INSTALL_DIR)/usr/include/mysql/mysql.h
132
133
134 package: $(INSTALL_DIR)/usr/include/mysql/mysql.h
135
136 mkdir -p $(I_LIBMYSQLCLIENT)/usr/lib/
137 cp -fpR $(INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(I_LIBMYSQLCLIENT)/usr/lib/
138 $(STRIP) $(I_LIBMYSQLCLIENT)/usr/lib/libmysqlclient.so.*
139
140 mkdir -p $(I_LIBMYSQLCLIENT_DEV)/usr/include
141 cp -fpR $(INSTALL_DIR)/usr/include/mysql $(I_LIBMYSQLCLIENT_DEV)/usr/include/
142 mkdir -p $(I_LIBMYSQLCLIENT_DEV)/usr/lib/mysql
143 cp -fpR $(INSTALL_DIR)/usr/lib/mysql/libmysqlclient.a $(I_LIBMYSQLCLIENT_DEV)/usr/lib/mysql/
144 cp -fpR $(INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so* $(I_LIBMYSQLCLIENT_DEV)/usr/lib/mysql/
145
146 mkdir -p $(I_MYSQL_UTILS)/usr/bin
147 cp -fpR $(INSTALL_DIR)/usr/bin/mysqladmin $(I_MYSQL_UTILS)/usr/bin/
148 cp -fpR $(INSTALL_DIR)/usr/bin/mysqlshow $(I_MYSQL_UTILS)/usr/bin/
149 $(STRIP) $(I_MYSQL_UTILS)/usr/bin/*
150
151 chmod 0755 ipkg/*/CONTROL/
152 chmod 0644 ipkg/*/CONTROL/control
153
154 perl -pi -e "s/^Arch.*:.*/Architecture: $(ARCH)/g" ipkg/*/CONTROL/control
155 ifneq ($(strip $(PKG_VERSION)),)
156 perl -pi -e "s/^Vers.*:.*/Version: $(PKG_VERSION)/g" ipkg/*/CONTROL/control
157 endif
158
159 $(IPKG_BUILD) $(I_LIBMYSQLCLIENT) $(IPKG_TARGET_DIR)
160 $(IPKG_BUILD) $(I_LIBMYSQLCLIENT_DEV) $(IPKG_TARGET_DIR)
161 $(IPKG_BUILD) $(I_MYSQL_UTILS) $(IPKG_TARGET_DIR)
162
163
164 clean:
165
166 -$(MAKE) -C "client" \
167 DESTDIR="$(INSTALL_DIR)" \
168 bin_PROGRAMS="mysqladmin mysqlshow" \
169 uninstall
170
171 -$(MAKE) \
172 DESTDIR="$(INSTALL_DIR)" \
173 uninstall clean
174
175 rm -rf .stamp-* \
176 $(I_LIBMYSQLCLIENT)/usr \
177 $(I_LIBMYSQLCLIENT_DEV)/usr \
178 $(I_MYSQL_UTILS)/usr \
179
180
181 control:
182
183 @cat $(I_LIBMYSQLCLIENT)/CONTROL/control
184 @echo
185 @cat $(I_LIBMYSQLCLIENT_DEV)/CONTROL/control
186 @echo
187 @cat $(I_MYSQL_UTILS)/CONTROL/control
188 @echo
189
190
191 .PHONY: configure build install package clean control
This page took 0.046366 seconds and 5 git commands to generate.