diff --git a/build/build.sh b/build/build.sh index 48aac67..a96d1dc 100644 --- a/build/build.sh +++ b/build/build.sh @@ -6,7 +6,7 @@ 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/mysqltuner-$VERSION +cp $BUILD_DIR/../mysqltuner.pl mysqltuner.spec $BUILD_DIR/../LICENSE $BUILD_DIR/../basic_passwords.txt $BUILD_DIR/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 mv $(cat ./lrpm.txt) . diff --git a/build/mysqltuner-1.4.5-1.noarch.rpm b/build/mysqltuner-1.4.5-1.noarch.rpm index 294be7e..3e8f9ba 100644 Binary files a/build/mysqltuner-1.4.5-1.noarch.rpm and b/build/mysqltuner-1.4.5-1.noarch.rpm differ diff --git a/build/mysqltuner-1.4.5-1.src.rpm b/build/mysqltuner-1.4.5-1.src.rpm index 02b3279..0b7e275 100644 Binary files a/build/mysqltuner-1.4.5-1.src.rpm and b/build/mysqltuner-1.4.5-1.src.rpm differ diff --git a/build/mysqltuner-1.4.5.tgz b/build/mysqltuner-1.4.5.tgz index d4bc3aa..e3ea0a5 100644 Binary files a/build/mysqltuner-1.4.5.tgz and b/build/mysqltuner-1.4.5.tgz differ diff --git a/build/mysqltuner.spec b/build/mysqltuner.spec index 8132561..63f024a 100644 --- a/build/mysqltuner.spec +++ b/build/mysqltuner.spec @@ -27,9 +27,11 @@ Montgomery's MySQL tuning primer script. %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%{_sbindir}/%{name} +install -p LICENSE $RPM_BUILD_ROOT%{_datarootdir}/%{name} +install -p basic_passwords.txt $RPM_BUILD_ROOT%{_datarootdir}/%{name} %clean @@ -37,7 +39,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc LICENSE +%doc %{_datarootdir}/%{name} %attr(755,root,root) %{_sbindir}/%{name} %changelog diff --git a/build/mysqltuner.spec.tpl b/build/mysqltuner.spec.tpl index d4b3ecc..811fe88 100644 --- a/build/mysqltuner.spec.tpl +++ b/build/mysqltuner.spec.tpl @@ -27,9 +27,11 @@ Montgomery's MySQL tuning primer script. %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%{_sbindir}/%{name} +install -p LICENSE $RPM_BUILD_ROOT%{_datarootdir}/%{name} +install -p basic_passwords.txt $RPM_BUILD_ROOT%{_datarootdir}/%{name} %clean @@ -37,7 +39,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) -%doc LICENSE +%doc %{_datarootdir}/%{name} %attr(755,root,root) %{_sbindir}/%{name} %changelog diff --git a/mysqltuner.pl b/mysqltuner.pl index ba76dfa..8445b95 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -140,6 +140,9 @@ sub usage { my $devnull = File::Spec->devnull(); my $basic_password_files=($opt{passwordfile} eq "0")? abs_path(dirname(__FILE__))."/basic_passwords.txt" : abs_path($opt{passwordfile}) ; +# for RPM distributions +$basic_password_files="/usr/share/mysqltuner/basic_passwords.txt" unless -f "$basic_password_files"; + # my $reportfile=undef; $reportfile=abs_path($opt{reportfile}) unless $opt{reportfile} eq "0";