| 69 Source3: my.pwd |
69 Source3: my.pwd |
| 70 Source4: rc.mysql |
70 Source4: rc.mysql |
| 71 Patch0: mysql.patch |
71 Patch0: mysql.patch |
| 72 |
72 |
| 73 # build information |
73 # build information |
| 74 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make, gcc, gcc::with_cxx = yes |
74 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, make, cmake, gcc, gcc::with_cxx = yes |
| 75 PreReq: OpenPKG, openpkg >= 20100101, perl |
75 PreReq: OpenPKG, openpkg >= 20100101, perl |
| 76 BuildPreReq: zlib, readline, ncurses |
76 BuildPreReq: zlib, readline, ncurses |
| 77 PreReq: zlib, readline, ncurses |
77 PreReq: zlib, readline, ncurses |
| 78 %if "%{with_ssl}" == "yes" |
78 %if "%{with_ssl}" == "yes" |
| 79 BuildPreReq: openssl |
79 BuildPreReq: openssl |
| 281 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
281 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
| 282 %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
282 %{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
| 283 |
283 |
| 284 # mitigate complex buildconf |
284 # mitigate complex buildconf |
| 285 %{l_shtool} install -c -m 644 \ |
285 %{l_shtool} install -c -m 644 \ |
| 286 INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/ |
286 ../INSTALL-SOURCE $RPM_BUILD_ROOT%{l_prefix}/share/mysql/doc/ |
| 287 |
287 |
| 288 # make sure the database directory exists |
288 # make sure the database directory exists |
| 289 %{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 |
| 290 |
290 |
| 291 # directory for temporary tables |
291 # directory for temporary tables |
| 322 %endif |
322 %endif |
| 323 |
323 |
| 324 # determine the package files |
324 # determine the package files |
| 325 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
325 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
| 326 %if "%{with_server}" == "yes" |
326 %if "%{with_server}" == "yes" |
| |
327 %{l_files_std} \ |
| 327 '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \ |
328 '%config %attr(644,%{l_musr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.cnf' \ |
| 328 '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \ |
329 '%config %attr(600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/mysql/my.pwd' \ |
| 329 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \ |
330 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql' \ |
| 330 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' \ |
331 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mysql/tmp' |
| 331 %endif |
332 %else |
| 332 %{l_files_std} |
333 %{l_files_std} |
| |
334 %endif |
| 333 |
335 |
| 334 %files -f objbld/files |
336 %files -f objbld/files |
| 335 |
337 |
| 336 %clean |
338 %clean |
| 337 |
339 |
| 346 |
348 |
| 347 %post |
349 %post |
| 348 %if "%{with_server}" == "yes" |
350 %if "%{with_server}" == "yes" |
| 349 if [ $1 -eq 1 ]; then |
351 if [ $1 -eq 1 ]; then |
| 350 # after install, create initial database |
352 # after install, create initial database |
| 351 $RPM_INSTALL_PREFIX/bin/mysql_install_db \ |
353 cd $RPM_INSTALL_PREFIX && $RPM_INSTALL_PREFIX/bin/mysql_install_db \ |
| 352 --defaults-file=$RPM_INSTALL_PREFIX/etc/mysql/my.cnf >/dev/null 2>&1 |
354 --defaults-file=$RPM_INSTALL_PREFIX/etc/mysql/my.cnf \ |
| 353 chown -R %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/* |
355 --ldata=$RPM_INSTALL_PREFIX/var/mysql \ |
| |
356 --user=%{l_rusr} >/dev/null 2>&1 |
| |
357 chgrp %{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/mysql |
| 354 ( echo "An initial MySQL DB was created. The owner of the database" |
358 ( echo "An initial MySQL DB was created. The owner of the database" |
| 355 echo "is the DB user 'root'. Its initial password is empty." |
359 echo "is the DB user 'root'. Its initial password is empty." |
| 356 echo "After starting MySQL with..." |
360 echo "After starting MySQL with..." |
| 357 echo "" |
361 echo "" |
| 358 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start" |
362 echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start" |
| 359 echo "" |
363 echo "" |
| 360 echo "...you should change the password as soon as possible with:" |
364 echo "...you should change the password as soon as possible with:" |
| 361 echo "" |
365 echo "" |
| 362 echo " \$ $RPM_INSTALL_PREFIX/bin/mysqladmin \\ " |
366 echo " \$ $RPM_INSTALL_PREFIX/bin/mysqladmin \\ " |
| 363 echo " -u root password '<new-password>'" |
367 echo " -u root password '<new-password>'" |
| |
368 echo "" |
| |
369 echo "...or alternatively, even better secure the database with:" |
| |
370 echo "" |
| |
371 echo " \$ $RPM_INSTALL_PREFIX/bin/mysql_secure_installation" |
| 364 echo "" |
372 echo "" |
| 365 echo "Additionally, because the MySQL package includes automated" |
373 echo "Additionally, because the MySQL package includes automated" |
| 366 echo "maintenance procedures that require administrator access to" |
374 echo "maintenance procedures that require administrator access to" |
| 367 echo "the database, you must maintain a (plain text) copy of the" |
375 echo "the database, you must maintain a (plain text) copy of the" |
| 368 echo "administrator account name and password:" |
376 echo "administrator account name and password:" |