mysql/mysql.spec

changeset 679
714b450dc37c
parent 527
7b145ccff1e9
child 698
31b10e374497
equal deleted inserted replaced
0:070d504d38ed 1:62f8ea9fc9ae
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # package version 24 # package version
25 %define V_major 5.1 25 %define V_major 5.5
26 %define V_minor 63 26 %define V_minor 27
27 %define V_mysql %{V_major}.%{V_minor} 27 %define V_mysql %{V_major}.%{V_minor}
28 %define V_opkg %{V_major}.%{V_minor} 28 %define V_opkg %{V_major}.%{V_minor}
29 %define V_jdbc 5.1.21 29 %define V_jdbc 5.1.21
30 30
31 # package information 31 # package information
37 Distribution: OpenPKG Community 37 Distribution: OpenPKG Community
38 Class: BASE 38 Class: BASE
39 Group: Database 39 Group: Database
40 License: GPL 40 License: GPL
41 Version: %{V_opkg} 41 Version: %{V_opkg}
42 Release: 20120704 42 Release: 20120800
43 43
44 # package options 44 # package options
45 %option with_server yes 45 %option with_server yes
46 %option with_innobase yes 46 %option with_innobase yes
47 %option with_archive no 47 %option with_archive no
48 %option with_blackhole no 48 %option with_blackhole no
49 %option with_federated no 49 %option with_federated no
50 %option with_ndbcluster no 50 %option with_ndbcluster no
51 %option with_partition no 51 %option with_partition no
52 %option with_perfschema no
52 %option with_ssl no 53 %option with_ssl no
53 %option with_embedded no 54 %option with_embedded no
54 %option with_charset utf8 55 %option with_charset utf8
55 %option with_collation utf8_unicode_ci 56 %option with_collation utf8_unicode_ci
56 %option with_jdbc no 57 %option with_jdbc no
57 58
58 # fixing implicit inter-plugin dependencies and correlations 59 # fixing implicit interplugin dependencies and correlations
59 %if "%{with_ndbcluster}" == "yes" 60 %if "%{with_ndbcluster}" == "yes"
60 %undefine with_partition 61 %undefine with_partition
61 %define with_partition yes 62 %define with_partition yes
62 %endif 63 %endif
63 64
64 # list of sources 65 # list of sources
65 Source0: http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz 66 Source0: http://www.mysql.com/Downloads/MySQL-%{V_major}/mysql-%{V_mysql}.tar.gz
66 Source1: http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-%{V_jdbc}.tar.gz 67 Source1: http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-%{V_jdbc}.tar.gz
67 Source2: my.cnf 68 Source2: my.cnf
68 Source3: my.pwd 69 Source3: my.pwd
69 Source4: rc.mysql 70 Source4: rc.mysql
70 Patch0: mysql.patch 71 Patch0: mysql.patch
81 %if "%{with_jdbc}" == "yes" 82 %if "%{with_jdbc}" == "yes"
82 PreReq: java, JAVA-JDK 83 PreReq: java, JAVA-JDK
83 %endif 84 %endif
84 85
85 %description 86 %description
86 MySQL is a multi-user Relational Database Management System (RDBMS), 87 MySQL is a multiuser Relational Database Management System (RDBMS),
87 which is controlled through Structured Query Language (SQL) 88 which is controlled through Structured Query Language (SQL)
88 operating in full multi-threading mode. The main goals of MySQL are 89 operating in full multithreading mode. The main goals of MySQL are
89 speed, robustness and ease of use. MySQL was originally developed 90 speed, robustness and ease of use. MySQL was originally developed
90 because of the need for a SQL server that could handle very big 91 because of the need for a SQL server that could handle very big
91 databases with magnitude higher speed than what any database vendor 92 databases with magnitude higher speed than what any database vendor
92 could offer. 93 could offer.
93 94
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 \
259 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/ 274 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
260 %{l_shtool} install -c -m 600 \ 275 %{l_shtool} install -c -m 600 \
261 %{SOURCE my.pwd} \ 276 %{SOURCE my.pwd} \
262 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/ 277 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
263 278
264 # install run-command script 279 # install runcommand script
265 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 280 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
266 %{l_shtool} install -c -m 755 %{l_value -s -a} \ 281 %{l_shtool} install -c -m 755 %{l_value -s -a} \
267 %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 282 %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
283
284 # mitigate complex buildconf
285 %{l_shtool} install -c -m 644 \
286 INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/
268 287
269 # make sure the database directory exists 288 # make sure the database directory exists
270 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql 289 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/mysql
271 290
272 # directory for temporary tables 291 # directory for temporary tables
303 %endif 322 %endif
304 323
305 # determine the package files 324 # determine the package files
306 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 325 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
307 %if "%{with_server}" == "yes" 326 %if "%{with_server}" == "yes"
308 %{l_files_std} \
309 '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \ 327 '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \
310 '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \ 328 '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \
311 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \ 329 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \
312 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' 330 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' \
313 %else 331 %endif
314 %{l_files_std} 332 %{l_files_std}
315 %endif 333
316 334 %files -f objbld/files
317 %files -f files
318 335
319 %clean 336 %clean
320 337
321 %pre 338 %pre
322 %if "%{with_server}" == "yes" 339 %if "%{with_server}" == "yes"

mercurial