Full feature build system for mysqltuner.
This commit is contained in:
parent
03baf72c08
commit
73d0dd9d75
6 changed files with 56 additions and 4 deletions
|
@ -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
|
||||
|
|
3
build/clean.sh
Normal file
3
build/clean.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
rm -rf mysqltuner-* mysqltuner.spec
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
46
build/mysqltuner.spec.tpl
Normal file
46
build/mysqltuner.spec.tpl
Normal file
|
@ -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 <jmrenouard@gmail.com> %VERSION%-1
|
||||
- Initial RPM release
|
||||
|
Loading…
Reference in a new issue