|
|
@@ -36,6 +36,22 @@
|
|
|
%define with_gemini no
|
|
|
%endif
|
|
|
|
|
|
+%if %{with_berkeleydb} == "yes"
|
|
|
+%define mysql_bdb_cache_size 8M
|
|
|
+%define mysql_bdb_log_buffer_size 32k
|
|
|
+%define mysql_bdb_max_lock 10000
|
|
|
+%else
|
|
|
+%define mysql_bdb_cache_size 0
|
|
|
+%define mysql_bdb_log_buffer_size 0
|
|
|
+%define mysql_bdb_max_lock 0
|
|
|
+%endif
|
|
|
+
|
|
|
+%if %{with_berkeleydb} == "yes" || %{with_innobase} == "yes" || %{with_gemini} == "yes"
|
|
|
+%define mysqld mysqld
|
|
|
+%else
|
|
|
+%define mysqld mysqld-max
|
|
|
+%endif
|
|
|
+
|
|
|
# package information
|
|
|
Name: mysql
|
|
|
Summary: Fast Relational Database Management System
|
|
|
@@ -46,13 +62,14 @@ Distribution: OpenPKG [BASE]
|
|
|
Group: Database
|
|
|
License: GPL
|
|
|
Version: 3.23.53
|
|
|
-Release: 20021014
|
|
|
+Release: 20021204
|
|
|
|
|
|
# list of sources
|
|
|
Source0: http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-3.23/mysql-%{version}.tar.gz
|
|
|
Source1: my.cnf
|
|
|
Source2: rc.mysql
|
|
|
Patch0: mysql.patch
|
|
|
+Patch1: mysql-initdb.patch
|
|
|
|
|
|
# build information
|
|
|
Prefix: %{l_prefix}
|
|
|
@@ -78,6 +95,7 @@ AutoReqProv: no
|
|
|
%prep
|
|
|
%setup -q
|
|
|
%patch0 -p1
|
|
|
+ %patch1 -p1
|
|
|
|
|
|
%build
|
|
|
# determine additional configure options
|
|
|
@@ -118,6 +136,11 @@ AutoReqProv: no
|
|
|
%install
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
+ # patch init script
|
|
|
+ %{l_shtool} subst \
|
|
|
+ -e 's;@l_prefix@;%{l_prefix};g' \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/scripts/mysql_install_db.sh
|
|
|
+
|
|
|
# perform standard installation procedure
|
|
|
%{l_make} %{l_mflags} install \
|
|
|
AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" \
|
|
|
@@ -140,13 +163,23 @@ AutoReqProv: no
|
|
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/mysql
|
|
|
%{l_shtool} install -c -m 644 \
|
|
|
-e 's;@l_prefix@;%{l_prefix};g' \
|
|
|
- -e 's;@l_musr@;%{l_musr};g' \
|
|
|
+ -e 's;@l_rusr@;%{l_rusr};g' \
|
|
|
+ -e 's;@mysql_bdb_cache_size@;%{mysql_bdb_cache_size};g' \
|
|
|
+ -e 's;@mysql_bdb_log_buffer_size@;%{mysql_bdb_log_buffer_size};g' \
|
|
|
+ -e 's;@mysql_bdb_max_lock@;%{mysql_bdb_max_lock};g' \
|
|
|
%{SOURCE my.cnf} \
|
|
|
$RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
|
|
|
+ %{l_shtool} install -c -m 600 \
|
|
|
+ %{SOURCE my.pwd} \
|
|
|
+ $RPM_BUILD_ROOT%{l_prefix}/etc/mysql/
|
|
|
|
|
|
# install run-command script
|
|
|
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
|
|
|
- %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
|
|
|
+ %{l_shtool} install -c -m 755 \
|
|
|
+ -e 's;@l_prefix@;%{l_prefix};g' \
|
|
|
+ -e 's;@l_rusr@;%{l_rusr};g' \
|
|
|
+ -e 's;@l_rgrp@;%{l_rgrp};g' \
|
|
|
+ -e 's;@mysqld@;%{mysqld};g' \
|
|
|
%{SOURCE rc.mysql} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
|
|
|
|
|
|
# make sure the database directory exists
|
|
|
@@ -155,7 +188,8 @@ AutoReqProv: no
|
|
|
# determine the package files
|
|
|
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
|
|
|
%{l_files_std} \
|
|
|
- '%config %{l_prefix}/etc/mysql/my.cnf'
|
|
|
+ '%config %{l_prefix}/etc/mysql/my.cnf' \
|
|
|
+ '%config %{l_prefix}/etc/mysql/my.pwd'
|
|
|
|
|
|
%files -f files
|
|
|
|
|
|
@@ -164,5 +198,13 @@ AutoReqProv: no
|
|
|
|
|
|
%post
|
|
|
$RPM_INSTALL_PREFIX/bin/mysql_install_db
|
|
|
- chown -R %{l_musr}:%{l_mgrp} $RPM_INSTALL_PREFIX/var/mysql/
|
|
|
-
|
|
|
+ chown %{l_rusr}:%{l_rgrp} \
|
|
|
+ $RPM_INSTALL_PREFIX/etc/mysql/my.cnf \
|
|
|
+ $RPM_INSTALL_PREFIX/etc/mysql/my.pwd
|
|
|
+ chown -R %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/mysql/
|
|
|
+ # display information about next steps
|
|
|
+ ( echo "The MySQL package includes automated maintenance procedures"
|
|
|
+ echo "that require administrator access to the database. For this"
|
|
|
+ echo "to work you must keep a copy (plain text) of the administrator"
|
|
|
+ echo "account in '$RPM_INSTALL_PREFIX/etc/mysql/my.pwd'."
|
|
|
+ ) | %{l_rpmtool} msg -b -t notice
|