diff --git a/build/build_rpm.sh b/build/build_rpm.sh index a96d1dc..785c02f 100644 --- a/build/build_rpm.sh +++ b/build/build_rpm.sh @@ -6,8 +6,10 @@ VERSION=$(grep -i tunerversion $BUILD_DIR/../mysqltuner.pl | grep = | cut -d\" - cd $BUILD_DIR perl -pe "s/%VERSION%/$VERSION/g" mysqltuner.spec.tpl > mysqltuner.spec 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 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 diff --git a/build/mysqltuner-1.4.5-1.noarch.rpm b/build/mysqltuner-1.4.5-1.noarch.rpm deleted file mode 100644 index 3e8f9ba..0000000 Binary files a/build/mysqltuner-1.4.5-1.noarch.rpm and /dev/null differ diff --git a/build/mysqltuner-1.4.5-1.src.rpm b/build/mysqltuner-1.4.5-1.src.rpm deleted file mode 100644 index 0b7e275..0000000 Binary files a/build/mysqltuner-1.4.5-1.src.rpm and /dev/null differ diff --git a/build/mysqltuner-1.4.5.tgz b/build/mysqltuner-1.4.5.tgz deleted file mode 100644 index e3ea0a5..0000000 Binary files a/build/mysqltuner-1.4.5.tgz and /dev/null differ diff --git a/build/mysqltuner.spec b/build/mysqltuner.spec deleted file mode 100644 index 63f024a..0000000 --- a/build/mysqltuner.spec +++ /dev/null @@ -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 1.4.5-1 -- Initial RPM release - diff --git a/build/mysqltuner.spec.tpl b/build/mysqltuner.spec.tpl index 811fe88..a76adf8 100644 --- a/build/mysqltuner.spec.tpl +++ b/build/mysqltuner.spec.tpl @@ -6,7 +6,7 @@ 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 +Requires: mysql BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -28,11 +28,12 @@ Montgomery's MySQL tuning primer script. rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_sbindir} install -d $RPM_BUILD_ROOT%{_datarootdir} +install -d $RPM_BUILD_ROOT/%{_mandir}/man1 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} - +install -p %{name}.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1 %clean rm -rf $RPM_BUILD_ROOT @@ -41,6 +42,7 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) %doc %{_datarootdir}/%{name} %attr(755,root,root) %{_sbindir}/%{name} +%{_mandir}/man1/* %changelog * Thu Jun 18 2015 Jean-Marie RENOUARD %VERSION%-1 diff --git a/mysqltuner.pl b/mysqltuner.pl index fdaaf31..dee21be 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -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 my (%mystat,%myvar,$dummyselect); 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 my (%enginestats,%enginecount,$fragtables); sub check_storage_engines { @@ -1473,7 +1474,7 @@ ENDSQL 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 FROM performance_schema.table_io_waits_summary_by_index_usage WHERE index_name IS NOT NULL