mariadb/support-files/mysql-max.spec.sh

264 lines
8.9 KiB
Bash
Raw Normal View History

2000-07-31 21:29:14 +02:00
%define mysql_version @VERSION@
%define shared_lib_version @SHARED_LIB_VERSION@
%define release 2
%define mysqld_user mysql
%define see_base For a description of MySQL see the base MySQL RPM or http://www.mysql.com
Name: MySQL
Summary: MySQL: a very fast and reliable SQL database engine
Group: Applications/Databases
Summary(pt_BR): MySQL: Um servidor SQL r<>pido e confi<66>vel.
Group(pt_BR): Aplica<63><61>es/Banco_de_Dados
Version: @MYSQL_NO_DASH_VERSION@
Release: %{release}
Copyright: GPL / LGPL
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
Icon: mysql.gif
URL: http://www.mysql.com/
2001-04-02 18:49:43 +02:00
Packager: David Axmark <david@mysql.com>, Monty <monty@mysql.com>
2000-07-31 21:29:14 +02:00
Provides: msqlormysql MySQL-server
Obsoletes: mysql
# Think about what you use here since the first step is to
# run a rm -rf
2001-04-13 15:21:38 +02:00
BuildRoot: /var/tmp/mysql-max
2000-07-31 21:29:14 +02:00
# From the manual
%description
MySQL is a true multi-user, multi-threaded SQL (Structured Query
Language) database server. MySQL is a client/server implementation
that consists of a server daemon (mysqld) and many different client
programs/libraries.
The main goals of MySQL are speed, robustness and ease of use. MySQL
was originally developed because we needed a SQL server that could
handle very big databases with magnitude higher speed than what any
database vendor could offer to us. And since we did not need all the
features that made their server slow we made our own. We have now been
using MySQL since 1996 in a environment with more than 40 databases,
10,000 tables, of which more than 500 have more than 7 million
rows. This is about 200G of data.
The base upon which MySQL is built is a set of routines that have been
used in a highly demanding production environment for many
years. While MySQL is still in development, it already offers a rich
and highly useful function set.
2001-04-02 18:49:43 +02:00
The MySQL-max version differs from the normal MySQL server distribution
in that the BDB and Innobase table handlers are enabled by default.
You can use any normal MySQL client with the MySQL-max server.
See the documentation for more information.
2000-07-31 21:29:14 +02:00
%description -l pt_BR
O MySQL <20> um servidor de banco de dados SQL realmente multiusu<73>rio e\
multi-tarefa. A linguagem SQL <20> a mais popular linguagem para banco de\
dados no mundo. O MySQL <20> uma implementa<74><61>o cliente/servidor que\
consiste de um servidor chamado mysqld e diversos\
programas/bibliotecas clientes. Os principais objetivos do MySQL s<>o:\
velocidade, robustez e facilidade de uso. O MySQL foi originalmente\
desenvolvido porque n<>s na Tcx precis<69>vamos de um servidor SQL que\
pudesse lidar com grandes bases de dados e com uma velocidade muito\
maior do que a que qualquer vendedor podia nos oferecer. Estamos\
usando\
o MySQL desde 1996 em um ambiente com mais de 40 bases de dados com 10.000\
tabelas, das quais mais de 500 t<>m mais de 7 milh<6C>es de linhas. Isto <20> o\
equivalente a aproximadamente 50G de dados cr<63>ticos. A base da constru<72><75>o do\
MySQL <20> uma s<>rie de rotinas que foram usadas em um ambiente de produ<64><75>o com\
alta demanda por muitos anos. Mesmo o MySQL estando ainda em desenvolvimento,\
ele j<> oferece um conjunto de fun<75><6E>es muito ricas e <20>teis. Veja a documenta<74><61>o\
para maiores informa<6D><61>es.
%prep
2001-04-02 18:49:43 +02:00
%setup -n mysql-max-%{mysql_version}
2001-04-13 15:21:38 +02:00
# %setup -T -D -a 1 -n mysql-max-%{mysql_version}
2000-07-31 21:29:14 +02:00
%build
# The all-static flag is to make the RPM work on different
# distributions. This version tries to put shared mysqlclient libraries
2000-07-31 21:29:14 +02:00
# in a separate package.
BuildMySQL() {
# The --enable-assembler simply does nothing on systems that does not
# support assembler speedups.
sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
CC=\"${MYSQL_BUILD_CC:-egcs}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \
2000-07-31 21:29:14 +02:00
CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \
-felide-constructors -fno-exceptions -fno-rtti \
-fno-omit-frame-pointer}\" \
2000-07-31 21:29:14 +02:00
./configure \
$* \
--enable-assembler \
--with-mysqld-user=%{mysqld_user} \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--prefix=/ \
--with-extra-charsets=complex \
--exec-prefix=/usr \
--libexecdir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--localstatedir=/var/lib/mysql \
--infodir=/usr/info \
--includedir=/usr/include \
--mandir=/usr/man \
--with-berkeley-db \
--with-innodb \
--with-comment=\"Official MySQL-Max RPM\";
2000-07-31 21:29:14 +02:00
# Add this for more debugging support
# --with-debug
# Add this for MyISAM RAID support:
# --with-raid
2000-07-31 21:29:14 +02:00
"
2001-04-02 18:49:43 +02:00
make
2000-07-31 21:29:14 +02:00
}
# Use the build root for temporary storage of the shared libraries.
RBR=$RPM_BUILD_ROOT
2001-04-13 15:21:38 +02:00
MBD=$RPM_BUILD_DIR/mysql-max-%{mysql_version}
2000-07-31 21:29:14 +02:00
if test -z "$RBR" -o "$RBR" = "/"
then
echo "RPM_BUILD_ROOT has stupid value"
exit 1
fi
rm -rf $RBR
mkdir -p $RBR
2001-04-02 18:49:43 +02:00
#cd $MBD/db-%{db_version}/dist
#./configure --prefix=$RBR/usr/BDB
#make install
#
#echo $RBR $MBD
#cd $MBD
2000-07-31 21:29:14 +02:00
BuildMySQL "--disable-shared" \
"--with-mysqld-ldflags='-all-static'" \
"--with-client-ldflags='-all-static'"
2001-04-02 18:49:43 +02:00
%install -n mysql-max-%{mysql_version}
2000-07-31 21:29:14 +02:00
RBR=$RPM_BUILD_ROOT
2001-04-13 15:21:38 +02:00
MBD=$RPM_BUILD_DIR/mysql-max-%{mysql_version}
2000-07-31 21:29:14 +02:00
# Ensure that needed directories exists
install -d $RBR/etc/{logrotate.d,rc.d/init.d}
install -d $RBR/var/lib/mysql/mysql
install -d $RBR/usr/share/sql-bench
install -d $RBR/usr/share/mysql-test
2000-07-31 21:29:14 +02:00
install -d $RBR/usr/{sbin,share,man,include}
install -d $RBR/usr/doc/MySQL-%{mysql_version}
install -d $RBR/usr/lib
# Make install
make install DESTDIR=$RBR benchdir_root=/usr/share/
2000-07-31 21:29:14 +02:00
# Install logrotate and autostart
install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
# Install docs
2001-04-13 15:21:38 +02:00
install -m644 $RPM_BUILD_DIR/mysql-max-%{mysql_version}/Docs/mysql.info \
2000-07-31 21:29:14 +02:00
$RBR/usr/info/mysql.info
for file in README COPYING COPYING.LIB Docs/manual_toc.html Docs/manual.html \
Docs/manual.txt Docs/manual.texi Docs/manual.ps \
support-files/my-huge.cnf support-files/my-large.cnf \
support-files/my-medium.cnf support-files/my-small.cnf
do
b=`basename $file`
install -m644 $MBD/$file $RBR/usr/doc/MySQL-%{mysql_version}/$b
done
%pre
if test -x /etc/rc.d/init.d/mysql
then
/etc/rc.d/init.d/mysql stop > /dev/null 2>&1
echo "Giving mysqld a couple of seconds to exit nicely"
sleep 5
fi
%post
mysql_datadir=/var/lib/mysql
# Create data directory if needed
if test ! -d $mysql_datadir; then mkdir $mysql_datadir; fi
if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
# Make MySQL start/shutdown automatically when the machine does it.
/sbin/chkconfig --add mysql
# Create a MySQL user. Do not report any problems if it already
# exists. This is redhat specific and should be handled more portable
useradd -M -r -d $mysql_datadir -s /bin/bash -c "MySQL server" mysql 2> /dev/null || true
# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
chown -R mysql $mysql_datadir
# Initiate databases
mysql_install_db -IN-RPM
# Change permissions again to fix any new files.
chown -R mysql $mysql_datadir
# Fix permissions for the permission database so that only the user
# can read them.
chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally.
/etc/rc.d/init.d/mysql start
# Allow safe_mysqld to start mysqld and print a message before we exit
sleep 2
%preun
if test -x /etc/rc.d/init.d/mysql
then
/etc/rc.d/init.d/mysql stop > /dev/null
fi
# Remove autostart of mysql
if test $1 = 0
then
/sbin/chkconfig --del mysql
fi
# We do not remove the mysql user since it may still own a lot of
# database files.
%files
%attr(-, root, root) %doc /usr/doc/MySQL-%{mysql_version}/
%attr(755, root, root) /usr/bin/isamchk
%attr(755, root, root) /usr/bin/isamlog
%attr(755, root, root) /usr/bin/pack_isam
%attr(755, root, root) /usr/bin/myisamchk
%attr(755, root, root) /usr/bin/myisamlog
%attr(755, root, root) /usr/bin/myisampack
%attr(755, root, root) /usr/bin/mysql_fix_privilege_tables
%attr(755, root, root) /usr/bin/mysql_convert_table_format
%attr(755, root, root) /usr/bin/mysql_install_db
%attr(755, root, root) /usr/bin/mysql_setpermission
%attr(755, root, root) /usr/bin/mysql_zap
%attr(755, root, root) /usr/bin/mysqlbug
%attr(755, root, root) /usr/bin/mysqltest
2000-07-31 21:29:14 +02:00
%attr(755, root, root) /usr/bin/mysqlhotcopy
%attr(755, root, root) /usr/bin/perror
%attr(755, root, root) /usr/bin/replace
%attr(755, root, root) /usr/bin/resolveip
%attr(755, root, root) /usr/bin/safe_mysqld
%attr(755, root, root) /usr/bin/mysqld_multi
2000-07-31 21:29:14 +02:00
%attr(755, root, root) /usr/bin/my_print_defaults
%attr(644, root, root) /usr/info/mysql.info*
2000-07-31 21:29:14 +02:00
%attr(755, root, root) /usr/sbin/mysqld
%attr(644, root, root) /etc/logrotate.d/mysql
%attr(755, root, root) /etc/rc.d/init.d/mysql
%attr(755, root, root) /usr/share/mysql/
%changelog
2000-07-31 21:29:14 +02:00
2001-04-13 15:21:38 +02:00
* Fri Apr 13 2001 Monty
2001-04-02 18:49:43 +02:00
First version of mysql-max.spec.sh based on mysql.spec.sh