diff --git a/build/build.sh b/build/build.sh index 2c6565e..48aac67 100644 --- a/build/build.sh +++ b/build/build.sh @@ -1,10 +1,13 @@ #!/bin/sh -VERSION=1.4.5 +BUILD_DIR=`dirname $(readlink -f $0)` -mkdir -p mysqltuner-$VERSION -cp ../mysqltuner.pl mysqltuner.spec ../LICENSE mysqltuner-$VERSION -tar czf mysqltuner-${VERSION}.tgz mysqltuner-$VERSION +VERSION=$(grep -i tunerversion $BUILD_DIR/../mysqltuner.pl | grep = | cut -d\" -f2) +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 +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) . rm -rf mysqltuner-$VERSION ./lrpm.txt diff --git a/build/clean.sh b/build/clean.sh new file mode 100644 index 0000000..08106d3 --- /dev/null +++ b/build/clean.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +rm -rf mysqltuner-* mysqltuner.spec diff --git a/build/mysqltuner-1.4.5-1.noarch.rpm b/build/mysqltuner-1.4.5-1.noarch.rpm index 4df88dd..294be7e 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 bab15fb..02b3279 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 854cf9b..d4bc3aa 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.tpl b/build/mysqltuner.spec.tpl new file mode 100644 index 0000000..d4b3ecc --- /dev/null +++ b/build/mysqltuner.spec.tpl @@ -0,0 +1,46 @@ +Summary: High Performance MySQL Tuning Script +Name: mysqltuner +Version: %VERSION% +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 -p %{name}.pl $RPM_BUILD_ROOT%{_sbindir}/%{name} +install -d $RPM_BUILD_ROOT%{_datarootdir}/%{name} +install -p LICENSE $RPM_BUILD_ROOT%{_sbindir}/%{name} + + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc LICENSE +%attr(755,root,root) %{_sbindir}/%{name} + +%changelog +* Thu Jun 18 2015 Jean-Marie RENOUARD %VERSION%-1 +- Initial RPM release +