Blob Blame History Raw
# spec file for mysql-utilities
#
# Copyright (c) 2012-2013 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Please, preserve the changelog entries
#
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_version: %global python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")}

# From README.txt
# Python 2.6 or later but Python 3.x is not supported (yet).
%global with_python3 0

Name:           mysql-utilities
Version:        1.5.6
Release:        4%{?dist}
Summary:        MySQL Utilities

Group:          Applications/Databases
License:        GPLv2
URL:            https://launchpad.net/mysql-utilities

# Upstream has a mirror redirector for downloads, so the URL is hard to
# represent statically.  You can get the tarball by following a link from
# http://dev.mysql.com/downloads/tools/utilities/
Source0:        %{name}-%{version}.tar.gz

BuildArch:      noarch
BuildRequires:  python2-devel >= 2.6
BuildRequires:  mysql-connector-python
%if %{with_python3}
BuildRequires:  python3-devel
%endif

Requires:       mysql-connector-python


%description
A package of utilities that are used for maintenance and administration
of MySQL servers. These utilities encapsulate a set of primitive commands,
and bundles them so they can be used to perform macro operations with a
single command.

Documentation:
http://dev.mysql.com/doc/workbench/en/mysql-utilities.html


%prep
%setup -q


%build
# nothing to build


%install
install --directory %{buildroot}%{_mandir}/man1

%if %{with_python3}
: Python 3 build
%{__python3} setup.py install --skip-profile --root %{buildroot}
rm -rf build
%endif

: Python 2 build - end with this for tests
%{__python} setup.py install --skip-profile --root %{buildroot}

: Man pages
%{__python} setup.py install_man --root %{buildroot}

# Archive with doctrine files does not seem like something it should be
# part of RPM; it might un-packed into a separate package if necessary
rm -f %{buildroot}%{_sysconfdir}/mysql/mysql-fabric-doctrine-1.4.0.zip

%check
%if "%{python_version}" >= "2.7"

: Setup test environment
# do not use hard copy, only a symlink to the system version of
# mysql-connector-python
rm -rf %{buildroot}/%{python_sitelib}/mysql/connector
ln -s %{python_sitelib}/mysql/connector %{buildroot}/%{python_sitelib}/mysql/connector
ret=0
export PYTHONPATH=%{buildroot}/%{python_sitelib}

for unit in unit_tests/test*py
do
  %{__python} $unit || ret=1
done

: Cleanup
rm %{buildroot}/%{python_sitelib}/mysql/connector
exit $ret
%endif


%files
%doc CHANGES.txt LICENSE.txt README.txt
%{_bindir}/mysqlauditadmin
%{_bindir}/mysqlauditgrep
%{_bindir}/mysqldbcompare
%{_bindir}/mysqldbcopy
%{_bindir}/mysqldbexport
%{_bindir}/mysqldbimport
%{_bindir}/mysqldiff
%{_bindir}/mysqldiskusage
%{_bindir}/mysqlfailover
%{_bindir}/mysqlfrm
%{_bindir}/mysqlindexcheck
%{_bindir}/mysqlmetagrep
%{_bindir}/mysqlprocgrep
%{_bindir}/mysqlreplicate
%{_bindir}/mysqlrpladmin
%{_bindir}/mysqlrplcheck
%{_bindir}/mysqlrplshow
%{_bindir}/mysqlserverclone
%{_bindir}/mysqlserverinfo
%{_bindir}/mysqluc
%{_bindir}/mysqluserclone
%{python_sitelib}/mysql/utilities
%{python_sitelib}/mysql_utilities*
%{_mandir}/man1/mysql*
# empty file already provided by mysql-connector-python
%exclude %{python_sitelib}/mysql/__init*

# mysql fabric files
%{_sysconfdir}/mysql/fabric.cfg
%{_bindir}/mysqlfabric
%{_bindir}/mysqlrplms
%{_bindir}/mysqlrplsync
%{python_sitelib}/mysql/fabric


%changelog
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.6-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Sep 18 2015 Honza Horak <None> - 1.5.6-1
- New upstream release 1.5.6

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Oct 24 2014 Pavel Alexeev <Pahan@Hubbitus.info> - 1.5.2
- Update to 1.5.2 - bz#1147140.

* Mon Aug 18 2014 Pavel Alexeev <Pahan@Hubbitus.info> - 1.4.4-1
- Update to 1.4.4 - bz#1111839.

* Tue Jun 17 2014 Honza Horak <hhorak@redhat.com> - 1.4.3-1
- update to 1.4.3 GA, which adds mysql fabric

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Dec 19 2013 Remi Collet <remi@fedoraproject.org> - 1.3.6-1
- update to 1.3.6 GA
- add mysqlauditadmin and mysqlauditgrep on EPEL-6

* Mon Sep  9 2013 Remi Collet <remi@fedoraproject.org> - 1.3.5-1
- update to 1.3.5 GA

* Mon Aug  5 2013 Remi Collet <remi@fedoraproject.org> - 1.3.4-1
- update to 1.3.4 GA

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Jul 10 2013 Remi Collet <remi@fedoraproject.org> - 1.3.3-1
- update to 1.3.3 (beta)

* Sat Jun 15 2013 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
- update to 1.3.2 (beta)

* Sat Apr  6 2013 Remi Collet <remi@fedoraproject.org> - 1.3.0-1
- update to 1.3.0 (alpha)
  http://dev.mysql.com/doc/relnotes/mysql-utilities/en/wb-utils-news-1-3-0.html
- move from launchpad to mysql.com
- new command mysqlfrm
- mysqluc is now usable
- man pages provided in upstream tarball

* Fri Mar  8 2013 Remi Collet <remi@fedoraproject.org> - 1.2.1-2
- generate minimal man pages using help2man
  http://bugs.mysql.com/68610 - Missing man pages
- drop mysqlauditadmin and mysqlauditgrep on EPEL-6
  http://bugs.mysql.com/68614 - Issue with python 2.6

* Fri Mar  8 2013 Remi Collet <remi@fedoraproject.org> - 1.2.1-1
- update to 1.2.1
- no man pages, http://bugs.mysql.com/68610

* Fri Feb  8 2013 Remi Collet <remi@fedoraproject.org> - 1.2.0-1
- update to 1.2.0
- new commands: mysqlauditadmin and mysqlauditgrep

* Wed Jan  9 2013 Remi Collet <remi@fedoraproject.org> - 1.1.1-1
- update to 1.1.1

* Thu Oct  4 2012 Remi Collet <remi@fedoraproject.org> - 1.1.0-1
- update to 1.1.0
- new command mysqluc removed (broken)

* Fri Aug 10 2012 Remi Collet <remi@fedoraproject.org> - 1.0.6-1
- update to 1.0.6

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sun May 27 2012 Remi Collet <remi@fedoraproject.org> - 1.0.5-3
- no man for EL-6 (missing recent python-sphinx)

* Sun Apr 15 2012 Remi Collet <remi@fedoraproject.org> - 1.0.5-2
- fix BR to python2-devel
- incorrect-fsf-address and non-executable-script referenced as
  Oracle BUG#13956819
- remove mut man page (command not installed)

* Wed Apr 11 2012 Remi Collet <remi@fedoraproject.org> - 1.0.5-1
- initial RPM