Commit e944ba20 authored by unknown's avatar unknown

RPM spec file improvements:

- create a "mysql" user group and assign the mysql user account to that group
  in the server postinstall section. (BUG 10984)
- backported some changes from the 4.1 RPM spec file (cleanups: removed the incomplete
  Brazilian translations, more consequent use of macros)


support-files/mysql.spec.sh:
  - create a "mysql" user group and assign the mysql user account to that group
    in the server postinstall section. (BUG 10984)
  - backported some changes from the 4.1 RPM spec file (cleanups: removed the incomplete
    Brazilian translations, more consequent use of macros)
parent 622cd702
%define mysql_version @VERSION@ %define mysql_version @VERSION@
%define release 0 %define release 0
%define license GPL
%define mysqld_user mysql %define mysqld_user mysql
%define server_suffix -standard %define server_suffix -standard
%define mysqldatadir /var/lib/mysql
# We don't package all files installed into the build root by intention - # We don't package all files installed into the build root by intention -
# See BUG#998 for details. # See BUG#998 for details.
...@@ -12,11 +14,9 @@ ...@@ -12,11 +14,9 @@
Name: MySQL Name: MySQL
Summary: MySQL: a very fast and reliable SQL database server Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL: Um servidor SQL rpido e confivel.
Group(pt_BR): Aplicaes/Banco_de_Dados
Version: @MYSQL_NO_DASH_VERSION@ Version: @MYSQL_NO_DASH_VERSION@
Release: %{release} Release: %{release}
License: GPL License: %{license}
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
URL: http://www.mysql.com/ URL: http://www.mysql.com/
Packager: Lenz Grimmer <build@mysql.com> Packager: Lenz Grimmer <build@mysql.com>
...@@ -50,11 +50,8 @@ news and information about the MySQL software. Also please see the ...@@ -50,11 +50,8 @@ news and information about the MySQL software. Also please see the
documentation and the manual for more information. documentation and the manual for more information.
%package server %package server
Release: %{release}
Summary: MySQL: a very fast and reliable SQL database server Summary: MySQL: a very fast and reliable SQL database server
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL: Um servidor SQL rpido e confivel.
Group(pt_BR): Aplicaes/Banco_de_Dados
Requires: fileutils sh-utils Requires: fileutils sh-utils
Provides: msqlormysql mysql-server mysql MySQL Provides: msqlormysql mysql-server mysql MySQL
Obsoletes: MySQL mysql mysql-server Obsoletes: MySQL mysql mysql-server
...@@ -85,11 +82,8 @@ If you want to access and work with the database, you have to install ...@@ -85,11 +82,8 @@ If you want to access and work with the database, you have to install
package "MySQL-client" as well! package "MySQL-client" as well!
%package client %package client
Release: %{release}
Summary: MySQL - Client Summary: MySQL - Client
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Cliente
Group(pt_BR): Aplicaes/Banco_de_Dados
Obsoletes: mysql-client Obsoletes: mysql-client
Provides: mysql-client Provides: mysql-client
...@@ -98,16 +92,11 @@ This package contains the standard MySQL clients and administration tools. ...@@ -98,16 +92,11 @@ This package contains the standard MySQL clients and administration tools.
%{see_base} %{see_base}
%description client -l pt_BR
Este pacote contm os clientes padro para o MySQL.
%package bench %package bench
Release: %{release}
Requires: %{name}-client perl-DBI perl Requires: %{name}-client perl-DBI perl
Summary: MySQL - Benchmarks and test system Summary: MySQL - Benchmarks and test system
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados
Provides: mysql-bench Provides: mysql-bench
Obsoletes: mysql-bench Obsoletes: mysql-bench
...@@ -116,15 +105,9 @@ This package contains MySQL benchmark scripts and data. ...@@ -116,15 +105,9 @@ This package contains MySQL benchmark scripts and data.
%{see_base} %{see_base}
%description bench -l pt_BR
Este pacote contm medies de desempenho de scripts e dados do MySQL.
%package devel %package devel
Release: %{release}
Summary: MySQL - Development header files and libraries Summary: MySQL - Development header files and libraries
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados
Provides: mysql-devel Provides: mysql-devel
Obsoletes: mysql-devel Obsoletes: mysql-devel
...@@ -134,12 +117,7 @@ necessary to develop MySQL client applications. ...@@ -134,12 +117,7 @@ necessary to develop MySQL client applications.
%{see_base} %{see_base}
%description devel -l pt_BR
Este pacote contm os arquivos de cabealho (header files) e bibliotecas
necessrias para desenvolver aplicaes clientes do MySQL.
%package shared %package shared
Release: %{release}
Summary: MySQL - Shared libraries Summary: MySQL - Shared libraries
Group: Applications/Databases Group: Applications/Databases
...@@ -148,12 +126,11 @@ This package contains the shared libraries (*.so*) which certain ...@@ -148,12 +126,11 @@ This package contains the shared libraries (*.so*) which certain
languages and applications need to dynamically load and use MySQL. languages and applications need to dynamically load and use MySQL.
%package Max %package Max
Release: %{release}
Summary: MySQL - server with Berkeley BD, RAID and UDF support Summary: MySQL - server with Berkeley BD, RAID and UDF support
Group: Applications/Databases Group: Applications/Databases
Provides: mysql-Max Provides: mysql-Max
Obsoletes: mysql-Max Obsoletes: mysql-Max
Requires: MySQL-server >= 4.0 Requires: MySQL-server >= @MYSQL_BASE_VERSION@
%description Max %description Max
Optional MySQL server binary that supports additional features like Optional MySQL server binary that supports additional features like
...@@ -164,12 +141,9 @@ the standard MySQL package. ...@@ -164,12 +141,9 @@ the standard MySQL package.
Please note that this is a dynamically linked binary! Please note that this is a dynamically linked binary!
%package embedded %package embedded
Release: %{release}
Requires: %{name}-devel Requires: %{name}-devel
Summary: MySQL - embedded library Summary: MySQL - embedded library
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados
Obsoletes: mysql-embedded Obsoletes: mysql-embedded
%description embedded %description embedded
...@@ -216,7 +190,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ ...@@ -216,7 +190,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
--libdir=%{_libdir} \ --libdir=%{_libdir} \
--sysconfdir=%{_sysconfdir} \ --sysconfdir=%{_sysconfdir} \
--datadir=%{_datadir} \ --datadir=%{_datadir} \
--localstatedir=/var/lib/mysql \ --localstatedir=%{mysqldatadir} \
--infodir=%{_infodir} \ --infodir=%{_infodir} \
--includedir=%{_includedir} \ --includedir=%{_includedir} \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
...@@ -325,7 +299,7 @@ MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} ...@@ -325,7 +299,7 @@ MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
# Ensure that needed directories exists # Ensure that needed directories exists
install -d $RBR%{_sysconfdir}/{logrotate.d,init.d} install -d $RBR%{_sysconfdir}/{logrotate.d,init.d}
install -d $RBR/var/lib/mysql/mysql install -d $RBR%{mysqldatadir}/mysql
install -d $RBR%{_datadir}/{sql-bench,mysql-test} install -d $RBR%{_datadir}/{sql-bench,mysql-test}
install -d $RBR%{_includedir} install -d $RBR%{_includedir}
install -d $RBR%{_libdir} install -d $RBR%{_libdir}
...@@ -377,7 +351,7 @@ then ...@@ -377,7 +351,7 @@ then
fi fi
%post server %post server
mysql_datadir=/var/lib/mysql mysql_datadir=%{mysqldatadir}
# Create data directory if needed # Create data directory if needed
if test ! -d $mysql_datadir; then mkdir -m755 $mysql_datadir; fi if test ! -d $mysql_datadir; then mkdir -m755 $mysql_datadir; fi
...@@ -395,19 +369,20 @@ then ...@@ -395,19 +369,20 @@ then
/sbin/chkconfig --add mysql /sbin/chkconfig --add mysql
fi fi
# Create a MySQL user. Do not report any problems if it already # Create a MySQL user and group. Do not report any problems if it already
# exists. This is redhat specific and should be handled more portable # exists.
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true groupadd -r -c "MySQL server" %{mysqld_user} 2> /dev/null || true
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" -g %{mysqld_user} %{mysqld_user} 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon # Change permissions so that the user that will run the MySQL daemon
# owns all database files. # owns all database files.
chown -R mysql $mysql_datadir chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir
# Initiate databases # Initiate databases
mysql_install_db -IN-RPM --user=mysql %{_bindir}/mysql_install_db -IN-RPM --user=%{mysqld_user}
# Change permissions again to fix any new files. # Change permissions again to fix any new files.
chown -R mysql $mysql_datadir chown -R %{mysqld_user}:%{mysqld_user} $mysql_datadir
# Fix permissions for the permission database so that only the user # Fix permissions for the permission database so that only the user
# can read them. # can read them.
...@@ -587,6 +562,18 @@ fi ...@@ -587,6 +562,18 @@ fi
# itself - note that they must be ordered by date (important when # itself - note that they must be ordered by date (important when
# merging BK trees) # merging BK trees)
%changelog %changelog
* Fri Jul 15 2005 Lenz Grimmer <lenz@mysql.com>
- create a "mysql" user group and assign the mysql user account to that group
in the server postinstall section. (BUG 10984)
* Wed Jun 01 2005 Lenz Grimmer <lenz@mysql.com>
- use "mysqldatadir" variable instead of hard-coding the path multiple times
- use the "mysqld_user" variable on all occasions a user name is referenced
- removed (incomplete) Brazilian translations
- removed redundant release tags from the subpackage descriptions
* Wed May 25 2005 Joerg Bruehe <joerg@mysql.com> * Wed May 25 2005 Joerg Bruehe <joerg@mysql.com>
- Added a "make clean" between separate calls to "BuildMySQL". - Added a "make clean" between separate calls to "BuildMySQL".
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment