108 %if "%{with_jdbc}" == "yes" |
109 %if "%{with_jdbc}" == "yes" |
109 %setup -q -T -D -a 1 |
110 %setup -q -T -D -a 1 |
110 %endif |
111 %endif |
111 %patch -p0 |
112 %patch -p0 |
112 |
113 |
113 %build |
|
114 # patch file search path |
114 # patch file search path |
115 %{l_shtool} subst %{l_value -s -a} \ |
115 %{l_shtool} subst %{l_value -s -a} \ |
116 mysys/default.c |
116 mysys/default.c |
117 |
117 |
118 # fix shebang on supplemental Perl scripts |
118 # fix shebang on supplemental Perl scripts |
119 rm -f scripts/*.orig |
119 rm -f scripts/*.orig |
120 %{l_shtool} subst \ |
120 %{l_shtool} subst \ |
121 -e 's;^#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \ |
121 -e 's;^#!/usr/bin/perl;#!%{l_prefix}/bin/perl;' \ |
122 scripts/* |
122 scripts/* |
123 |
123 |
124 # determine additional configure options |
124 %build |
125 case "%{l_platform -t}" in |
125 # create build subdirectory |
126 *-freebsd* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; |
126 %{l_shtool} mkdir -p objbld |
127 *-linux* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; |
127 cd objbld |
128 *-sunos* ) opt="--with-client-ldflags=-static --with-mysqld-ldflags=-static" ;; |
128 |
129 esac |
129 # configure environment |
130 |
130 export CC="%{l_cc}" |
131 # configure source tree |
131 export CXX="%{l_cxx}" |
132 CC="%{l_cc}" \ |
132 export CFLAGS="%{l_cflags -O}" |
133 CXX="%{l_cxx}" \ |
133 export CXXFLAGS="%{l_cxxflags -O} -felide-constructors -fno-exceptions -fno-rtti" |
134 CFLAGS="%{l_cflags -O}" \ |
134 export CPPFLAGS="%{l_cppflags ncurses}" |
135 CXXFLAGS="%{l_cxxflags -O}" \ |
135 export LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" |
136 CPPFLAGS="%{l_cppflags ncurses}" \ |
136 export LIBS="-lz" |
137 LDFLAGS="-L`pwd`/libmysql %{l_ldflags}" \ |
137 |
138 LIBS="-lz" \ |
138 # Configure source tree. |
139 ./configure \ |
139 # Tips are in mysql_release.cmake |
140 --prefix=%{l_prefix} \ |
140 # or run cmake(1) -L for all opts |
141 --mandir=%{l_prefix}/man \ |
141 # Disable dtrace(1) to avoid 'mysqld_dtrace_all.o: file not recognized: Bad value' |
142 --infodir=%{l_prefix}/info \ |
142 %{l_prefix}/bin/cmake \ |
143 --sysconfdir=%{l_prefix}/etc/mysql \ |
143 -DCMAKE_INSTALL_PREFIX="%{l_prefix}" \ |
144 --localstatedir=%{l_prefix}/var/mysql \ |
144 -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ |
145 --libexecdir=%{l_prefix}/libexec/mysql \ |
145 -DINSTALL_DOCDIR="share/mysql/doc" \ |
146 --with-unix-socket-path=%{l_prefix}/var/mysql/mysql.sock \ |
146 -DINSTALL_DOCREADMEDIR="share/mysql/doc" \ |
147 --with-mysqld-user=%{l_musr} \ |
147 -DINSTALL_INCLUDEDIR="include/mysql" \ |
148 --enable-thread-safe-client \ |
148 -DINSTALL_INFODIR:STRING="info" \ |
149 --with-comment="%{l_openpkg_release}" \ |
149 -DINSTALL_MYSQLSHAREDIR="share/mysql" \ |
|
150 -DINSTALL_SBINDIR="libexec/mysql" \ |
|
151 -DINSTALL_SHAREDIR="share/mysql" \ |
|
152 -DINSTALL_SCRIPTDIR="bin" \ |
|
153 -DINSTALL_SUPPORTFILESDIR="share/mysql" \ |
|
154 -DMYSQL_UNIX_ADDR="%{l_prefix}/var/mysql/mysql.sock" \ |
|
155 -DFEATURE_SET="community" \ |
|
156 -DCOMPILATION_COMMENT="%{l_openpkg_release}" \ |
|
157 -DMANUFACTURER="Built from OpenPKG sources" \ |
|
158 -DDEFAULT_CHARSET="%{with_charset}" \ |
|
159 -DDEFAULT_COLLATION="%{with_collation}" \ |
|
160 -DMYSQL_USER="%{l_musr}" \ |
|
161 -DWITH_ZLIB=system \ |
|
162 -DWITH_READLINE=YES \ |
|
163 -DWITH_LIBEDIT=NO \ |
|
164 -DWITH_LIBWRAP=NO \ |
|
165 -DDISABLE_SHARED=YES \ |
|
166 -DENABLE_DTRACE=NO \ |
|
167 -DZLIB_INCLUDE_DIR=%{l_cppflags zlib} \ |
|
168 -DPKG_CONFIG_EXECUTABLE="PKG_CONFIG_EXECUTABLE-NOTFOUND" \ |
150 %if "%{with_server}" != "yes" |
169 %if "%{with_server}" != "yes" |
151 --without-server \ |
170 -DWITHOUT_SERVER=YES \ |
152 %else |
171 %endif |
153 --with-server \ |
172 %if "%{with_ssl}" == "yes" |
154 --with-plugin-csv \ |
173 -DWITH_SSL=system \ |
155 --with-plugin-heap \ |
174 -DOPENSSL_INCLUDE_DIR="%{l_cppflags openssl}" \ |
156 --with-plugin-myisam \ |
175 -DOPENSSL_SSL_LIBRARY="%{l_prefix}/lib/libssl.a" \ |
157 --with-plugin-myisammrg \ |
176 -DOPENSSL_CRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \ |
|
177 -DCRYPTO_LIBRARY="%{l_prefix}/lib/libcrypto.a" \ |
|
178 %else |
|
179 -DWITH_SSL=NO \ |
|
180 %endif |
158 %if "%{with_innobase}" == "yes" |
181 %if "%{with_innobase}" == "yes" |
159 --with-plugin-innobase \ |
182 -DWITH_INNOBASE_STORAGE_ENGINE=YES \ |
160 %else |
183 %else |
161 --without-plugin-innobase \ |
184 -DWITH_INNOBASE_STORAGE_ENGINE=NO \ |
162 %endif |
185 %endif |
163 %if "%{with_archive}" == "yes" |
186 %if "%{with_archive}" == "yes" |
164 --with-plugin-archive \ |
187 -DWITH_ARCHIVE_STORAGE_ENGINE=YES \ |
165 %else |
188 %else |
166 --without-plugin-archive \ |
189 -DWITH_ARCHIVE_STORAGE_ENGINE=NO \ |
167 %endif |
190 %endif |
168 %if "%{with_blackhole}" == "yes" |
191 %if "%{with_blackhole}" == "yes" |
169 --with-plugin-blackhole \ |
192 -DWITH_BLACKHOLE_STORAGE_ENGINE=YES \ |
170 %else |
193 %else |
171 --without-plugin-blackhole \ |
194 -DWITH_BLACKHOLE_STORAGE_ENGINE=NO \ |
172 %endif |
195 %endif |
173 %if "%{with_federated}" == "yes" |
196 %if "%{with_federated}" == "yes" |
174 --with-plugin-federated \ |
197 -DWITH_FEDERATED_STORAGE_ENGINE=YES \ |
175 %else |
198 %else |
176 --without-plugin-federated \ |
199 -DWITH_FEDERATED_STORAGE_ENGINE=NO \ |
177 %endif |
200 %endif |
178 %if "%{with_ndbcluster}" == "yes" |
201 %if "%{with_ndbcluster}" == "yes" |
179 --with-plugin-ndbcluster \ |
202 -DWITH_NDBCLUSTER_STORAGE_ENGINE=YES \ |
180 %else |
203 %else |
181 --without-plugin-ndbcluster \ |
204 -DWITH_NDBCLUSTER_STORAGE_ENGINE=NO \ |
182 %endif |
205 %endif |
183 %if "%{with_partition}" == "yes" |
206 %if "%{with_partition}" == "yes" |
184 --with-plugin-partition \ |
207 -DWITH_PARTITION_STORAGE_ENGINE=YES \ |
185 %else |
208 %else |
186 --without-plugin-partition \ |
209 -DWITH_PARTITION_STORAGE_ENGINE=NO \ |
187 %endif |
210 %endif |
188 %endif |
211 %if "%{with_perfschema}" == "yes" |
189 --with-zlib-dir=%{l_prefix} \ |
212 -DWITH_PERFSCHEMA_STORAGE_ENGINE=YES \ |
190 %if "%{with_ssl}" == "yes" |
213 %else |
191 --with-ssl=%{l_prefix} \ |
214 -DWITH_PERFSCHEMA_STORAGE_ENGINE=NO \ |
192 %endif |
215 %endif |
193 %if "%{with_embedded}" == "yes" |
216 %if "%{with_embedded}" == "yes" |
194 --with-embedded-server \ |
217 -DWITH_EMBEDDED_SERVER=YES \ |
195 %endif |
218 %else |
196 --with-charset=%{with_charset} \ |
219 -DWITH_EMBEDDED_SERVER=NO \ |
197 --with-collation=%{with_collation} \ |
220 %endif |
198 --without-readline \ |
221 .. |
199 --without-libedit \ |
222 |
200 --with-big-tables \ |
223 # build source tree (VERBOSE=1) |
201 --with-low-memory \ |
224 %{l_make} %{l_mflags -O} |
202 --disable-shared \ |
|
203 $opt |
|
204 |
|
205 # build source tree |
|
206 %{l_make} %{l_mflags} |
|
207 |
225 |
208 %install |
226 %install |
209 |
227 # install from build subdirectory |
210 # patch init script |
228 cd objbld |
211 %{l_shtool} subst %{l_value -s -a} \ |
229 |
212 scripts/mysql_install_db.sh |
230 ## patch init script (this broken) |
|
231 #%{l_shtool} subst %{l_value -s -a} \ |
|
232 # bin/mysql_install_db.sh |
213 |
233 |
214 # perform standard installation procedure |
234 # perform standard installation procedure |
215 %{l_make} %{l_mflags} install \ |
235 %{l_make} %{l_mflags} install \ |
216 AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \ |
|
217 DESTDIR=$RPM_BUILD_ROOT |
236 DESTDIR=$RPM_BUILD_ROOT |
218 |
237 |
219 # cleanup mysql_config script |
238 # cleanup scripts |
220 %{l_shtool} subst \ |
239 %{l_shtool} subst \ |
221 -e 's;^\(ldflags=.\).*\(.\)$;\1%{l_ldflags}\2;' \ |
240 -e 's;^\(ldflags=.\).*\(.\)$;\1%{l_ldflags}\2;' \ |
222 $RPM_BUILD_ROOT%{l_prefix}/bin/mysql_config |
241 $RPM_BUILD_ROOT%{l_prefix}/bin/mysql_config |
223 |
242 |
224 # move utility 'replace', msql2mysql is patched for new path |
243 # move utilities, patched for new paths |
225 mv $RPM_BUILD_ROOT%{l_prefix}/bin/replace \ |
244 mv $RPM_BUILD_ROOT%{l_prefix}/bin/replace \ |
226 $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ |
245 $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ |
227 |
246 |
228 # strip installation area |
247 # strip installation area |
|
248 rm -rf $RPM_BUILD_ROOT%{l_prefix}/data |
229 rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test |
249 rm -rf $RPM_BUILD_ROOT%{l_prefix}/mysql-test |
230 rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench |
250 rm -rf $RPM_BUILD_ROOT%{l_prefix}/sql-bench |
231 rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir |
|
232 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/mysql-%{V_mysql}.spec |
|
233 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure |
251 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/binary-configure |
234 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_src_distribution |
252 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini |
235 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/make_win_binary_distribution |
|
236 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/comp_err |
|
237 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true |
253 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true |
238 strip $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/* 2>/dev/null || true |
254 strip $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/* 2>/dev/null || true |
239 %if "%{with_ndbcluster}" == "yes" |
255 %if "%{with_ndbcluster}" == "yes" |
240 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ndb* |
256 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/ndb* |
241 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/ndb* |
257 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/ndb* |
242 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ndb* |
258 rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/ndb* |
243 rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/mysql/storage/ndb |
259 rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/mysql/storage/ndb |
244 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/libndb* |
260 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mysql/libndb* |
245 rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ndb* |
261 rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/mysql/ndb* |
246 rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mysql/ndb-config-2-node.ini |
|
247 %endif |
262 %endif |
248 |
263 |
249 # install global configuration |
264 # install global configuration |
250 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql |
265 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql |
251 sed <%{SOURCE my.cnf} >my.cnf \ |
266 sed <%{SOURCE my.cnf} >my.cnf \ |