Sisyphus repositório
Última atualização: 23 janeiro 2022 | SRPMs: 17488 | Visitas: 22826737
en ru br
ALT Linux repositórios
S:8.0.28-alt1
5.0: 5.0.89-alt1
4.1: 5.0.51-alt2.a
4.0: 5.0.51-alt2.a.M40.2
+updates:5.0.51-alt2.a.M40.1
3.0: 4.0.24-alt1

Group :: Banco de dados
RPM: MySQL

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Name: MySQL
Version: 4.0.24
Release: alt1

%def_without debug
%define use_gif2png 1
%define mysql_version %version
%define mysqld_user mysql
%define _libexecdir %_sbindir
%define ROOT %_localstatedir/mysql

Summary: MySQL: A very fast and reliable SQL database engine
Summary(ru_RU.KOI8-R): MySQL: SQL-
Group: Databases
License: GPL / LGPL
Url: http://www.mysql.com/
Packager: MySQL Development Team <mysql at packages.altlinux.org>

Source: ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/Downloads/MySQL-4.0/mysql-%mysql_version.tar.bz2
Source1: mysqld.init
Source2: mysql.logrotate
Source3: safe_mysqld
Source4: mysqld_wrapper
Source5: my.cnf
Source6: mysql.chroot.lib
Source7: mysql.chroot.conf
Source8: mysql.chroot.all
Source9: mysql_migrate

Patch1: mysql-4.0.24-alt-chroot.patch
Patch2: mysql-4.0.15-alt-convert.patch
Patch3: mysql-3.23.55-alt-configure.patch
Patch4: mysql-4.0.15-alt-fix-internal-db.patch
Patch5: mysql-3.23.42-alt-texinfo.patch
Patch6: mysql-4.0.15-alt-client.patch
Patch7: mysql-4.0.24-alt-docs-html-split.patch
Patch8: mysql-4.0.15-alt-load_defaults.patch
Patch9: mysql-4.0.15-alt-tinfo.patch
Patch10: mysql-4.0.24-alt-mysql_install_db.patch

%if %use_gif2png
BuildPreReq: gif2png
%endif

# Automatically added by buildreq on Wed Sep 17 2003

BuildRequires: gcc-c++ glibc-devel-static libncurses-devel libreadline-devel libstdc++-devel libtinfo-devel zlib-devel perl-DBI perl-CGI

%package -n libMySQL
Summary: MySQL: Shared libraries
Summary(ru_RU.KOI8-R): MySQL:
License: LGPL
Group: System/Libraries
Provides: MySQL-shared = %version, mysql-shared = %version
Obsoletes: MySQL-shared-libs, MySQL-shared, mysql-shared

%package -n libMySQL-devel
Summary: MySQL: Development header files and libraries
Summary(ru_RU.KOI8-R): MySQL:
License: LGPL
Group: Development/C
Provides: MySQL-devel = %version, mysql-devel = %version
Obsoletes: MySQL-devel, mysql-devel
Requires: libMySQL = %version-%release

%package -n libMySQL-devel-static
Summary: MySQL: Development static libraries
Summary(ru_RU.KOI8-R): MySQL:
License: LGPL
Group: Development/C
Provides: MySQL-devel = %version, mysql-devel-static = %version
Requires: libMySQL-devel = %version-%release

%package client
Summary: MySQL: Client
Summary(ru_RU.KOI8-R): MySQL:
License: GPL
Group: Databases
Provides: mysql-client = %version
Obsoletes: mysql-client
Requires(post): %install_info
Requires(preun): %uninstall_info
Requires: libMySQL = %version-%release
AutoReq: yes, noperl

%package server
Summary: MySQL: A very fast and reliable SQL database engine
Summary(ru_RU.KOI8-R): MySQL: SQL-
License: GPL
Group: Databases
Provides: MySQL = %version, mysql-server = %version, mysql, msqlormysql, mysqlserver
Obsoletes: MySQL, mysql, mysql-server, msqlormysql, mysqlserver
PreReq: shadow-utils, coreutils
Requires(post,preun): chkconfig, chrooted, coreutils, findutils, grep, sed, %__subst
PreReq: libMySQL = %version-%release, MySQL-client = %version-%release

%package server-perl
Summary: MySQL: Perl utils for MySQL-server
License: GPL
Group: Databases
Requires: perl-DBD-mysql, perl-CGI, MySQL-server = %version-%release

%package bench
Summary: MySQL: Benchmarks
Summary(ru_RU.KOI8-R): MySQL:
License: GPL
Group: Databases
Provides: mysql-bench = %version
Obsoletes: mysql-bench
Requires: MySQL-client = %version-%release, perl-DBD-mysql

%package doc
Summary: MySQL: Documentation
Summary(ru_RU.KOI8-R): MySQL:
Group: Databases
Provides: mysql-doc = %version
Obsoletes: mysql-doc

%define see_base For a description of MySQL see the base MySQL RPM or %url
%define see_base_ru MySQL %url

%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.

This version allows to use transactions with BDB tables and extended
character set support. See the documentation for more information

%description -l ru_RU.KOI8-R
MySQL - , SQL- (SQL -
) . MySQL
/ mysqld
.

MySQL - , .
MySQL ,
.
, MySQL ,
.

MySQL
. . .

%description server
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.

This version allows to use transactions with BDB tables and extended
character set support. See the documentation for more information.

By default, MySQL server runs in safe chrooted environment with own uid and gid.

%description server-perl
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.
This package contents perl utils for MySQL-server.

%description server -l ru_RU.KOI8-R
MySQL - , SQL- (SQL -
) . MySQL
/ mysqld
.

MySQL - , .
MySQL ,
.
, MySQL ,
.

MySQL
. . .

%description -n libMySQL
This package contains the shared libraries (*.so*) which certain
languages and applications need to dynamically load and use MySQL.

%description -n libMySQL -l ru_RU.KOI8-R
( *.so*),
,
SQL- MySQL.

%description -n libMySQL-devel
This package contains the development header files and libraries
necessary to develop MySQL client applications.

%see_base

%description -n libMySQL-devel -l ru_RU.KOI8-R

,
, SQL- MySQL.

%see_base_ru

%description -n libMySQL-devel-static
This package contains the development libraries for static linking
necessary to develop MySQL client applications.

%see_base

%description -n libMySQL-devel-static -l ru_RU.KOI8-R
,
,
SQL- MySQL.

%see_base_ru

%description client
This package contains the standard MySQL clients.

%see_base

%description client -l ru_RU.KOI8-R
SQL- MySQL

%see_base_ru

%description bench
This package contains MySQL benchmark scripts and data.

%see_base

%description bench -l ru_RU.KOI8-R

SQL- MySQL.

%see_base_ru

%description doc
This package contains MySQL documentation in various formats.

%description doc -l ru_RU.KOI8-R
SQL- MySQL
.

%prep
%setup -q -n mysql-%mysql_version
%patch1 -p1
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10

# Use local regex.h header.

find -type f -print0 |
xargs -r0 %__grep -FZl '<regex.h>' -- |
xargs -r0 %__subst 's,<regex\.h>,"../regex/regex.h",g' --

# Prepare commands list for completion in mysql client.

sed -ne 's/^\(  { "[A-Z][^"]*"\).*/\1, 0, 0, 0, "" },/pg' <sql/lex.h >client/mysql_symbols.inc

find -type d -name CVS -print0 |
xargs -r0 %__rm -rf --
find -type f -name .cvsignore -print0 |
xargs -r0 %__rm -f --
%__rm -f Docs/*.{html,info}

chmod -R a-s,go-w sql-bench

%build

# Force HAVE_ERRNO_AS_DEFINE defined to wrong expansion

# of bits/errno.h's definition of errno in my_sys.h
%{!?_enable_debug:%add_optflags %optflags_notraceback}
%add_optflags -D_FILE_OFFSET_BITS=64 -DHAVE_ERRNO_AS_DEFINE -DONE_THREAD
export CXXFLAGS="$RPM_OPT_FLAGS -felide-constructors -fno-exceptions -fno-rtti"

libtoolize --copy --force
aclocal
autoheader
autoconf
automake

# Precache these values to enable /proc-less build.

export \
FIND_PROC='/bin/ps p $$PID | grep mysqld >/dev/null' \
CHECK_PID='/bin/kill -0 $$PID >/dev/null 2>/dev/null' \
#

%configure \
--localstatedir=%ROOT \
--enable-assembler \
--enable-shared \
--enable-thread-safe-client \
--without-readline \
%{subst_with debug} \
--with-raid \
--with-berkeley-db \
--with-extra-charsets=all \
--with-mysqld-user=%mysqld_user \
--with-unix-socket-path=%ROOT/mysql.sock \
--with-comment="%distribution MySQL RPM" \
# --with-berkeley-db=%prefix \
#

# Use g++ for linking.

%__subst 's,^CCLD = \$(CC),CCLD = $(CXX),g' *isam/Makefile*

pushd bdb/build_unix
%__rm -f config.cache
../dist/configure --prefix=%prefix
popd

# Benchdir does not fit in above model. Maybe a separate bench distribution

%make_build benchdir=$RPM_BUILD_ROOT%_datadir/sql-bench

%install
%__mkdir_p $RPM_BUILD_ROOT{%_bindir,%_sbindir,%_libdir,%_includedir,%_mandir,%_infodir,%_datadir/sql-bench,/var/log/mysql}
%__mkdir_p $RPM_BUILD_ROOT%ROOT/{etc,lib,log,tmp,/var/{nis,yp/binding},db/mysql}
touch $RPM_BUILD_ROOT%ROOT{%_sysconfdir/{hosts,services,{host,nsswitch,resolv}.conf},/var/nis/NIS_COLD_START}

%make_install install DESTDIR=$RPM_BUILD_ROOT \
localstatedir=$RPM_BUILD_ROOT%ROOT/db \
benchdir=%_datadir/sql-bench

# Relocate mysql_install_db

%__mv $RPM_BUILD_ROOT%_bindir/mysql_install_db $RPM_BUILD_ROOT%_sbindir/

# Relocate libmysqlclient* libraries.

%__mv $RPM_BUILD_ROOT%_libdir/mysql/libmysqlclient* $RPM_BUILD_ROOT%_libdir/

# Install various helper scripts.

%__install -pD -m755 %SOURCE1 $RPM_BUILD_ROOT%_initdir/mysqld
%__install -pD -m644 %SOURCE2 $RPM_BUILD_ROOT%_sysconfdir/logrotate.d/mysql
%__install -pD -m755 %SOURCE3 $RPM_BUILD_ROOT%_sbindir/safe_mysqld
%__install -pD -m755 %SOURCE4 $RPM_BUILD_ROOT%_sbindir/mysqld_wrapper
%__install -pD -m750 %SOURCE6 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/mysql.lib
%__install -pD -m750 %SOURCE7 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/mysql.conf
%__install -pD -m750 %SOURCE8 $RPM_BUILD_ROOT%_sysconfdir/chroot.d/mysql.all
%__install -pD -m750 %SOURCE9 $RPM_BUILD_ROOT%_sbindir/mysql_migrate

# Install configuration files.

%__install -pD -m644 /dev/null $RPM_BUILD_ROOT%_sysconfdir/my.cnf
%__install -pD -m600 %SOURCE5 $RPM_BUILD_ROOT%ROOT/my.cnf

# Fix \r.

r="$(echo -ne \\r)"
%__grep -lZ "$r\$" $RPM_BUILD_ROOT%_datadir/sql-bench/innotest* |
xargs -r0 %__subst "s/$r//g" --

# Fixed perl autodetection.

%__grep -EZl '^[[:space:]]*use the ' $RPM_BUILD_ROOT%_bindir/* |
xargs -r0 %__subst -p 's/\([[:space:]]*\)\(use the \)/\1then \2/g'

# Install texinfo documentation.

%__install -m644 Docs/*.info* $RPM_BUILD_ROOT%_infodir/

%__subst -p 's/\(BUGmysql="\)\([^"]*\)"/\1\2,mysql at packages.altlinux.org"/g' $RPM_BUILD_ROOT%_bindir/mysqlbug

%__mkdir_p $RPM_BUILD_ROOT%_docdir/MySQL-%version/Flags
%__install -p -m644 README support-files/*.cnf Docs/*.html $RPM_BUILD_ROOT%_docdir/MySQL-%version
%__install -p -m644 Docs/Flags/*.gif $RPM_BUILD_ROOT%_docdir/MySQL-%version/Flags
%if %use_gif2png
gif2png -dO $RPM_BUILD_ROOT%_docdir/MySQL-%version/Flags/*.gif ||
%__rm -f $RPM_BUILD_ROOT%_docdir/MySQL-%version/Flags/*.gif
%endif

%__rm -f $RPM_BUILD_ROOT%_bindir/safe_mysqld
%__rm -f $RPM_BUILD_ROOT%_datadir/mysql/mysql{-*.spec,-log-rotate,.server}

touch $RPM_BUILD_ROOT%ROOT/log/queries
touch $RPM_BUILD_ROOT/var/log/mysql/info

%post -n libMySQL -p %post_ldconfig
%postun -n libMySQL -p %postun_ldconfig

%pre server
/usr/sbin/groupadd -r -f %mysqld_user
/usr/sbin/useradd -r -g %mysqld_user -d %ROOT -s /dev/null -c "MySQL server" -n %mysqld_user >/dev/null 2>&1 ||:

if [ ! -e %ROOT/my.cnf -a -f /etc/my.cnf -a ! -L /etc/my.cnf -a ! -e /etc/my.cnf.rename ]; then
%__mv -v /etc/my.cnf /etc/my.cnf.rename &&
chown 0:0 /etc/my.cnf.rename &&
chmod 600 /etc/my.cnf.rename ||
{ echo "Error moving my.cnf" >&2; exit 1; }
fi

%post server
if [ -f /etc/my.cnf.rename -a ! -L /etc/my.cnf.rename -a ! -e /etc/my.cnf ]; then
%__mv -fv %ROOT/my.cnf %ROOT/my.cnf.rpmnew &&
%__mv -v /etc/my.cnf.rename %ROOT/my.cnf &&
chown 0:0 %ROOT/my.cnf &&
chmod 600 %ROOT/my.cnf ||
{ echo "Error moving my.cnf" >&2; %__mv -v /etc/my.cnf.rename /etc/my.cnf; }
fi

%install_info mysql.info
%_sysconfdir/chroot.d/mysql.all force
%__rm -rf %ROOT/dev

if [ $1 = 1 ]; then    
       /sbin/chkconfig --add mysqld      
fi

DATADIR=`/usr/bin/my_print_defaults mysqld |sed -ne 's/^--datadir=\(.*\)/\1/pg' |tail -1`
[ -n "$DATADIR" ] || { echo "Failed to read configuration"; exit 1; }

if [ "$DATADIR" = / ]; then
# Have to update configuration manually.
%__subst 's,^datadir=/$,datadir=/db,g' /etc/my.cnf &&
DATADIR=`/usr/bin/my_print_defaults mysqld |%__sed -ne 's/^--datadir=\(.*\)/\1/pg' |tail -1` ||
{ echo "Failed to update configuration"; exit 1; }
fi

NEED_RESTART=
if [ -f "%ROOT/mysql/db.frm" -a ! -f "%ROOT$DATADIR/mysql/db.frm" ]; then
%_initdir/mysqld status &>/dev/null && %_initdir/mysqld stop && NEED_RESTART=1 ||:
(cd %ROOT
%__install -d -m750 -o %mysqld_user -g adm ".$DATADIR"
for d in `find -mindepth 1 -maxdepth 1 -type d |%__grep -Ev '\./(dev|etc|lib|log|tmp|db)$'`; do
%__mv -i "$d" ".$DATADIR/$d"
done)
echo "Database root have been moved to $DATADIR"
fi

# Initiate databases.

%_sbindir/mysql_install_db

# Change permissions to fix any new files.

chown -R %mysqld_user:%mysqld_user "%ROOT$DATADIR/mysql"

# Fix permissions for the permission database so that only the user can read them.

chmod -R g-w,o-rw "%ROOT$DATADIR/mysql"

if [ -n "$NEED_RESTART" ]; then
%_initdir/mysqld start ||:
else
%_initdir/mysqld condrestart ||:
fi

%preun server
%preun_service mysqld

%triggerpostun server -- MySQL-server < 4.0
[ -x /usr/sbin/mysql_migrate ] || exit 0
%_initdir/mysqld status >/dev/null 2>&1 && %_initdir/mysqld stop && NEED_RESTART=1 || NEED_RESTART=
/usr/sbin/mysql_migrate >/dev/null 2>&1
[ -n "$NEED_RESTART" ] && %_initdir/mysqld start ||:

%postun server
if [ $1 = 0 ]; then
%__rm -f %ROOT/lib/* %ROOT/var/yp/binding/*
fi

%post client
%install_info mysql.info

%preun client
%uninstall_info mysql.info

%files -n libMySQL
%_libdir/*.so.*

%files -n libMySQL-devel
%_bindir/mysql_config
%_bindir/comp_err
%_libdir/*.so
%_includedir/*

%files -n libMySQL-devel-static
%_libdir/*.a
%_libdir/mysql

%files client
%_bindir/msql2mysql
%_bindir/mysql
%_bindir/my_print_defaults
%_bindir/mysqladmin
%_bindir/mysqlbinlog
%_bindir/mysqlbug
%_bindir/mysqlcheck
#%_bindir/mysqld_multi
%_bindir/mysqldump
%_bindir/mysqlimport
%_bindir/mysqlshow
%_bindir/mysqltest
%_bindir/perror
%_bindir/replace
%_bindir/resolve*
%_mandir/man?/*
%_infodir/*.info*

%files server-perl
%_bindir/mysql_convert_table_format
%_bindir/mysql_find_rows
%_bindir/mysql_setpermission
%_bindir/mysql_zap
%_bindir/mysqlhotcopy
%_bindir/mysqlaccess
%_bindir/mysqldumpslow

%files server
%ghost %config(noreplace,missingok) %_sysconfdir/my.cnf
%config(noreplace) %_initdir/*
%config(noreplace) %_sysconfdir/logrotate.d/*
%config %_sysconfdir/chroot.d/*
%_bindir/*isam*
%_bindir/mysql_fix_privilege_tables
%_sbindir/*
%_datadir/mysql
%attr(750,root,adm) %dir /var/log/mysql
%ghost %verify(not md5 mtime size) /var/log/mysql/*
%dir %_docdir/MySQL-%version
%_docdir/MySQL-%version/README
%_docdir/MySQL-%version/*.cnf

%attr(600,root,root) %config(noreplace,missingok) %ROOT/my.cnf
%attr(3771,root,mysql) %dir %ROOT
%attr(710,root,mysql) %dir %ROOT/lib
%attr(710,root,mysql) %dir %ROOT%_sysconfdir
%ghost %ROOT%_sysconfdir/hosts
%ghost %ROOT%_sysconfdir/services
%ghost %ROOT%_sysconfdir/*.conf
%attr(710,root,mysql) %dir %ROOT/var
%dir %ROOT/var/nis
%ghost %ROOT/var/nis/NIS_COLD_START
%dir %ROOT/var/yp
%dir %ROOT/var/yp/binding
%attr(3770,root,mysql) %dir %ROOT/db
%attr(750,mysql,mysql) %dir %ROOT/db/*
%attr(3770,root,mysql) %dir %ROOT/log
%attr(660,mysql,mysql) %ghost %verify(not md5 mtime size) %ROOT/log/*
%attr(3770,root,mysql) %dir %ROOT/tmp

%files bench
%_datadir/sql-bench

%files doc
%dir %_docdir/MySQL-%version
%_docdir/MySQL-%version/*.html
%_docdir/MySQL-%version/Flags

%changelog

Todas as alterações você pod ver aqui

 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009