Add man page on RPM packaging
fix a dependencies issue with mysql
This commit is contained in:
parent
70687a62be
commit
43f3fa21e9
7 changed files with 28 additions and 71 deletions
|
@ -7,7 +7,9 @@ cd $BUILD_DIR
|
||||||
perl -pe "s/%VERSION%/$VERSION/g" mysqltuner.spec.tpl > mysqltuner.spec
|
perl -pe "s/%VERSION%/$VERSION/g" mysqltuner.spec.tpl > mysqltuner.spec
|
||||||
mkdir -p $BUILD_DIR/mysqltuner-$VERSION
|
mkdir -p $BUILD_DIR/mysqltuner-$VERSION
|
||||||
cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/mysqltuner-$VERSION
|
cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/mysqltuner-$VERSION
|
||||||
|
pod2man $BUILD_DIR/../mysqltuner.pl | gzip > $BUILD_DIR/mysqltuner-$VERSION/mysqltuner.1.gz
|
||||||
|
|
||||||
tar czf $BUILD_DIR/mysqltuner-${VERSION}.tgz mysqltuner-$VERSION
|
tar czf $BUILD_DIR/mysqltuner-${VERSION}.tgz mysqltuner-$VERSION
|
||||||
rpmbuild -ta mysqltuner-${VERSION}.tgz 2>/dev/null| grep --color=never '\.rpm' | cut -d: -f2 > ./lrpm.txt
|
rpmbuild -ta mysqltuner-${VERSION}.tgz 2>/dev/null| grep --color=never '\.rpm' | cut -d: -f2 > ./lrpm.txt
|
||||||
mv $(cat ./lrpm.txt) .
|
mv $(cat ./lrpm.txt) $BUILD_DIR
|
||||||
rm -rf mysqltuner-$VERSION ./lrpm.txt
|
rm -rf mysqltuner-$VERSION ./lrpm.txt
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,48 +0,0 @@
|
||||||
Summary: High Performance MySQL Tuning Script
|
|
||||||
Name: mysqltuner
|
|
||||||
Version: 1.4.5
|
|
||||||
Release: 1
|
|
||||||
License: GPL v3+
|
|
||||||
Group: Applications
|
|
||||||
Source0: https://github.com/build/MySQLTuner-perl/build/%{name}-%{version}.tgz
|
|
||||||
URL: https://github.com/major/MySQLTuner-perl
|
|
||||||
Requires: mysql-client
|
|
||||||
BuildArch: noarch
|
|
||||||
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
|
|
||||||
|
|
||||||
%description
|
|
||||||
MySQLTuner is a high-performance MySQL tuning script written in Perl
|
|
||||||
that will provide you with a snapshot of a MySQL server's health.
|
|
||||||
Based on the statistics gathered, specific recommendations will be
|
|
||||||
provided that will increase a MySQL server's efficiency and
|
|
||||||
performance. The script gives you automated MySQL tuning that is on
|
|
||||||
the level of what you would receive from a MySQL DBA.
|
|
||||||
|
|
||||||
This script has been derived from many of the ideas in Matthew
|
|
||||||
Montgomery's MySQL tuning primer script.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%install
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
install -d $RPM_BUILD_ROOT%{_sbindir}
|
|
||||||
install -d $RPM_BUILD_ROOT%{_datarootdir}
|
|
||||||
install -p %{name}.pl $RPM_BUILD_ROOT%{_sbindir}/%{name}
|
|
||||||
install -d $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
|
||||||
install -p LICENSE $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
|
||||||
install -p basic_passwords.txt $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
|
||||||
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files
|
|
||||||
%defattr(644,root,root,755)
|
|
||||||
%doc %{_datarootdir}/%{name}
|
|
||||||
%attr(755,root,root) %{_sbindir}/%{name}
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Thu Jun 18 2015 Jean-Marie RENOUARD <jmrenouard@gmail.com> 1.4.5-1
|
|
||||||
- Initial RPM release
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ License: GPL v3+
|
||||||
Group: Applications
|
Group: Applications
|
||||||
Source0: https://github.com/build/MySQLTuner-perl/build/%{name}-%{version}.tgz
|
Source0: https://github.com/build/MySQLTuner-perl/build/%{name}-%{version}.tgz
|
||||||
URL: https://github.com/major/MySQLTuner-perl
|
URL: https://github.com/major/MySQLTuner-perl
|
||||||
Requires: mysql-client
|
Requires: mysql
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
|
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
|
||||||
|
|
||||||
|
@ -28,11 +28,12 @@ Montgomery's MySQL tuning primer script.
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
install -d $RPM_BUILD_ROOT%{_sbindir}
|
install -d $RPM_BUILD_ROOT%{_sbindir}
|
||||||
install -d $RPM_BUILD_ROOT%{_datarootdir}
|
install -d $RPM_BUILD_ROOT%{_datarootdir}
|
||||||
|
install -d $RPM_BUILD_ROOT/%{_mandir}/man1
|
||||||
install -p %{name}.pl $RPM_BUILD_ROOT%{_sbindir}/%{name}
|
install -p %{name}.pl $RPM_BUILD_ROOT%{_sbindir}/%{name}
|
||||||
install -d $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
install -d $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
||||||
install -p LICENSE $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
install -p LICENSE $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
||||||
install -p basic_passwords.txt $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
install -p basic_passwords.txt $RPM_BUILD_ROOT%{_datarootdir}/%{name}
|
||||||
|
install -p %{name}.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
@ -41,6 +42,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
%defattr(644,root,root,755)
|
%defattr(644,root,root,755)
|
||||||
%doc %{_datarootdir}/%{name}
|
%doc %{_datarootdir}/%{name}
|
||||||
%attr(755,root,root) %{_sbindir}/%{name}
|
%attr(755,root,root) %{_sbindir}/%{name}
|
||||||
|
%{_mandir}/man1/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Jun 18 2015 Jean-Marie RENOUARD <jmrenouard@gmail.com> %VERSION%-1
|
* Thu Jun 18 2015 Jean-Marie RENOUARD <jmrenouard@gmail.com> %VERSION%-1
|
||||||
|
|
|
@ -461,6 +461,25 @@ sub mysql_setup {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# MySQL Request Array
|
||||||
|
sub select_array {
|
||||||
|
my $req=shift;
|
||||||
|
debugprint "PERFORM: $req \n";
|
||||||
|
my @result=`$mysqlcmd $mysqllogin -Bse "$req"`;
|
||||||
|
chomp (@result);
|
||||||
|
return @result;
|
||||||
|
}
|
||||||
|
|
||||||
|
# MySQL Request one
|
||||||
|
sub select_one {
|
||||||
|
my $req=shift;
|
||||||
|
debugprint "PERFORM: $req \n";
|
||||||
|
my $result=`$mysqlcmd $mysqllogin -Bse "$req"`;
|
||||||
|
chomp ($result);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
# Populates all of the variable and status hashes
|
# Populates all of the variable and status hashes
|
||||||
my (%mystat,%myvar,$dummyselect);
|
my (%mystat,%myvar,$dummyselect);
|
||||||
sub get_all_vars {
|
sub get_all_vars {
|
||||||
|
@ -665,24 +684,6 @@ sub check_architecture {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Request Array
|
|
||||||
sub select_array {
|
|
||||||
my $req=shift;
|
|
||||||
debugprint "PERFORM: $req \n";
|
|
||||||
my @result=`$mysqlcmd $mysqllogin -Bse "$req"`;
|
|
||||||
chomp (@result);
|
|
||||||
return @result;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Request one
|
|
||||||
sub select_one {
|
|
||||||
my $req=shift;
|
|
||||||
debugprint "PERFORM: $req \n";
|
|
||||||
my $result=`$mysqlcmd $mysqllogin -Bse "$req"`;
|
|
||||||
chomp ($result);
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Start up a ton of storage engine counts/statistics
|
# Start up a ton of storage engine counts/statistics
|
||||||
my (%enginestats,%enginecount,$fragtables);
|
my (%enginestats,%enginecount,$fragtables);
|
||||||
sub check_storage_engines {
|
sub check_storage_engines {
|
||||||
|
@ -1473,7 +1474,7 @@ ENDSQL
|
||||||
|
|
||||||
return unless (defined($myvar{'performance_schema'}) and $myvar{'performance_schema'} eq 'ON' );
|
return unless (defined($myvar{'performance_schema'}) and $myvar{'performance_schema'} eq 'ON' );
|
||||||
|
|
||||||
$selIdxReq= <<'ENDSQL';
|
$selIdxReq= <<'ENDSQL';
|
||||||
SELECT CONCAT(CONCAT(object_schema,'.'),object_name) AS 'table', index_name
|
SELECT CONCAT(CONCAT(object_schema,'.'),object_name) AS 'table', index_name
|
||||||
FROM performance_schema.table_io_waits_summary_by_index_usage
|
FROM performance_schema.table_io_waits_summary_by_index_usage
|
||||||
WHERE index_name IS NOT NULL
|
WHERE index_name IS NOT NULL
|
||||||
|
|
Loading…
Reference in a new issue