]> git.pld-linux.org Git - packages/percona-toolkit.git/blob - percona-toolkit.spec
- up to 3.1
[packages/percona-toolkit.git] / percona-toolkit.spec
1 %include        /usr/lib/rpm/macros.perl
2 Summary:        Essential command-line utilities for MySQL
3 Name:           percona-toolkit
4 Version:        3.1
5 Release:        1
6 License:        GPL v2
7 Group:          Applications/Databases
8 Source0:        https://www.percona.com/downloads/percona-toolkit/%{version}/source/tarball/%{name}-%{version}.tar.gz
9 # Source0-md5:  7521f8cbe1f5e579fbc742e3c1667327
10 Source1:        %{name}.conf
11 Source2:        %{name}.tmpfiles
12 Source3:        pt-kill.init
13 Patch0:         no-versioncheck.patch
14 Patch1:         bug-1314696.patch
15 URL:            https://www.percona.com/software/mysql-tools/percona-toolkit
16 BuildRequires:  perl-ExtUtils-MakeMaker
17 BuildRequires:  rpm-perlprov >= 4.1-13
18 BuildRequires:  rpmbuild(macros) >= 1.228
19 BuildRequires:  sed >= 4.0
20 Requires(post,preun):   /sbin/chkconfig
21 Requires(postun):       /usr/sbin/groupdel
22 Requires(postun):       /usr/sbin/userdel
23 Requires(pre):  /bin/id
24 Requires(pre):  /usr/bin/getgid
25 Requires(pre):  /usr/sbin/groupadd
26 Requires(pre):  /usr/sbin/useradd
27 Requires:       perl-DBD-mysql >= 1.0
28 Requires:       perl-DBI >= 1.13
29 Requires:       perl-Term-ReadKey >= 2.10
30 Requires:       rc-scripts
31 Provides:       group(percona-toolkit)
32 Provides:       user(percona-toolkit)
33 Obsoletes:      mysqldumpgrants
34 Obsoletes:      mysqltoolkit
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
39 Percona Toolkit for MySQL is a collection of advanced command-line
40 tools used by Percona MySQL Support staff to perform a variety of
41 MySQL server and system tasks that are too difficult or complex to
42 perform manually, including:
43 - Verify master and replica data consistency
44 - Efficiently archive rows
45 - Find duplicate indexes
46 - Summarize MySQL servers
47 - Analyze queries from logs and tcpdump
48 - Collect vital system information when problems occur
49
50 Percona Toolkit for MySQL is derived from Maatkit and Aspersa, two of
51 the best-known MySQL management software utility toolkits for MySQL
52 server administration.
53
54 %prep
55 %setup -q
56 %patch0 -p1
57 %patch1 -p2
58
59 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -v
60
61 # change shebang to be actual interpreter for rpm to generate deps on the
62 # interpreters.
63 %{__sed} -i -e '1s,^#!.*env *perl,#!%{__perl},' bin/pt-*
64 %{__sed} -i -e '1s,^#!.*env bash,#!/bin/bash,' bin/pt-*
65
66 %build
67 %{__perl} Makefile.PL \
68         INSTALLDIRS=vendor
69 %{__make}
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{systemdtmpfilesdir},/etc/rc.d/init.d} \
74         $RPM_BUILD_ROOT/var/run/%{name}
75
76 %{__make} pure_install \
77         PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
78
79 # seems unneeded (or blame d64a92a author)
80 %{__rm} $RPM_BUILD_ROOT%{perl_vendorlib}/*.pm
81 %{__rm} -r $RPM_BUILD_ROOT%{perl_vendorlib}/HTTP
82 %{__rm} -r $RPM_BUILD_ROOT%{perl_vendorlib}/Lmo
83 %{__rm} -r $RPM_BUILD_ROOT%{perl_vendorlib}/Percona
84 %{__rm} -r $RPM_BUILD_ROOT%{perl_vendorlib}/bash
85
86 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/pt-kill
87
88 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
89 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
90 touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/percona-version-check
91
92 ln -s pt-show-grants $RPM_BUILD_ROOT%{_bindir}/mysqldumpgrants
93 echo '.so man1/pt-show-grants.1p' > $RPM_BUILD_ROOT%{_mandir}/man1/mysqldumpgrants.1
94
95 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/.packlist
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %pre
101 %groupadd -g 310 percona-toolkit
102 %useradd -u 310 -d /etc/percona-toolkit -g percona-toolkit -c "Percona Toolkit User" percona-toolkit
103
104 %postun
105 if [ "$1" = "0" ]; then
106         %userremove percona-toolkit
107         %groupremove percona-toolkit
108 fi
109
110 %files
111 %defattr(644,root,root,755)
112 %doc Changelog README.md
113 %dir %{_sysconfdir}/%{name}
114 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
115 %ghost %{_sysconfdir}/%{name}/percona-version-check
116 %attr(754,root,root) /etc/rc.d/init.d/pt-kill
117 %attr(755,root,root) %{_bindir}/pt-*
118 %attr(755,root,root) %{_bindir}/mysqldumpgrants
119 %{systemdtmpfilesdir}/%{name}.conf
120 %{_mandir}/man1/%{name}.1*
121 %{_mandir}/man1/pt-*.1*
122 %{_mandir}/man1/mysqldumpgrants.1
123 %dir %attr(770,root,percona-toolkit) /var/run/%{name}
This page took 0.086623 seconds and 3 git commands to generate.