Add percona-toolkit.spec (and remove Maatkit specs). Make build-packages build an RPM. Change replace-text shebang so it works on Ubuntu.

This commit is contained in:
Daniel Nichter
2011-07-18 18:39:41 -06:00
parent 17f233e0a0
commit 8caaad5d8e
5 changed files with 77 additions and 115 deletions

View File

@@ -1,44 +0,0 @@
Summary: Maatkit is a collection of essential command-line utilities for MySQL
Name: maatkit
Version: @DISTRIB@
Release: 1%{?dist}
Source: %{name}-%{version}.tar.gz
License: GPL
Group: Development/Tools
URL: http://code.google.com/p/maatkit/
BuildRoot: %{_tmppath}/%{name}-root
Requires: perl(DBD::mysql)
BuildArch: noarch
%description
Maatkit is a collection of essential command-line utilities for MySQL. Each is completely stand-alone, without dependencies other than core Perl and the DBI drivers needed to connect to MySQL, and doesn't need to be "installed" - you can just execute the scripts. This makes the tools easy to use on systems where you can't install anything extra, such as customer sites or ISPs.
%prep
%setup -q
%build
%install
rm -rf $RPM_BUILD_ROOT
%{__perl} Makefile.PL PREFIX=$RPM_BUILD_ROOT%{_prefix}
make install
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc Changelog COPYING MANIFEST README
%{_bindir}/*
%{_mandir}/man1/*
%{_mandir}/man3/*
%{perl_sitelib}/*
%changelog
* Thu Sep 18 2008 Robin Bowes <robin@robinbowes.com> - 2
- Added BuildArch: noarch
* Wed Aug 13 2008 Baron Schwartz <baron.schwartz@gmail.com> - 1
- Contributed by Spil Games

View File

@@ -1,60 +0,0 @@
Name: maatkit
Version: @DISTRIB@
Release: 1%{?dist}
Summary: Essential command-line utilities for MySQL
Group: Applications/Databases
License: GPL
URL: http://code.google.com/p/maatkit/
Source0: http://maatkit.googlecode.com/files/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Term::ReadKey) >= 2.10
# perl-DBI is required by perl-DBD-MySQL anyway
%description
This toolkit contains essential command-line utilities for MySQL, such as a
table checksum tool and query profiler. It provides missing features such as
checking slaves for data consistency, with emphasis on quality and
scriptability.
%prep
%setup -q
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor < /dev/null
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';'
find $RPM_BUILD_ROOT -type f -name maatkit.pod -exec rm -f {} ';'
chmod -R u+w $RPM_BUILD_ROOT/*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING INSTALL Changelog*
%{_bindir}/*
%{_mandir}/man1/*.1*
%changelog
* Fri Aug 14 2009 Robin Bowes <robin@robinbowes.com> - 3
Use perl Requires, rather than rpm packages
* Fri Sep 19 2008 Jeremy Cole <baron@percona.com> - 2
- lowercased the MySQL in requires perl-DBD-mysql
* Tue Jun 12 2007 Sven Edge <sven@curverider.co.uk> - 547-1
- initial packaging attempt

View File

@@ -0,0 +1,54 @@
Name: percona-toolkit
Summary: Advanced MySQL and system command-line tools used by Percona
Version: %{version}
Release: %{release}
Group: Applications/Databases
License: GPL
Vendor: Percona Inc.
URL: http://www.percona.com/software/percona-toolkit/
Source: percona-toolkit-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Term::ReadKey) >= 2.10
%description
Percona Toolkit is a collection of advanced command-line tools used by
Percona (http://www.percona.com/) support staff to perform a variety of
MySQL and system tasks that are too difficult or complex to perform manually.
These tools are ideal alternatives to private or "one-off" scripts because
they are professionally developed, formally tested, and fully documented.
They are also fully self-contained, so installation is quick and easy and
no libraries are installed.
Percona Toolkit is developed and supported by Percona Inc. For more
information and other free, open-source software developed by Percona,
visit http://www.percona.com/software/.
%prep
%setup -q
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor < /dev/null
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
find $RPM_BUILD_ROOT -type d -depth -exec rmdir {} 2>/dev/null ';'
find $RPM_BUILD_ROOT -type f -name 'percona-toolkit.pod' -exec rm -f {} ';'
chmod -R u+w $RPM_BUILD_ROOT/*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING INSTALL README Changelog
%{_bindir}/*
%{_mandir}/man1/*.1*
%changelog
* Mon Jul 18 2011 Daniel Nichter
- Initial implementation

View File

@@ -137,13 +137,11 @@ update_manifest() {
echo -n "Updating MANIFEST... " echo -n "Updating MANIFEST... "
cd $BRANCH cd $BRANCH
echo -n > MANIFEST echo -n > MANIFEST
for file in *; do for file in * bin/* docs/*.pod; do
if [ -f $file ]; then if [ -f $file ]; then
echo $file >> MANIFEST echo $file >> MANIFEST
fi fi
done done
find bin -type f -depth 1 >> MANIFEST
find docs -type f -depth 1 >> MANIFEST
echo "OK" echo "OK"
} }
@@ -216,11 +214,25 @@ build_rpm() {
if [ ! -f "$PKG.tar.gz" ]; then if [ ! -f "$PKG.tar.gz" ]; then
die "Cannot build RPM because $PKG.tar.gz does not exist" die "Cannot build RPM because $PKG.tar.gz does not exist"
fi fi
mkdir -p rpm rpm/BUILD rpm/SOURCES rpm/RPMS rpm/SRPMS mkdir -p rpm rpm/BUILD rpm/SOURCES rpm/RPMS rpm/SRPMS
cd rpm cd rpm
local topdir=`pwd` local topdir=`pwd`
# Build RPM package from the tarball
rpmbuild --define "_topdir $topdir" -ta ../$PKG.tar.gz # Build RPM package from the tarball.
rpmbuild -bb --clean $BRANCH/config/rpm/percona-toolkit.spec \
--quiet \
--define "_topdir $PWD" \
--define "_sourcedir $RELEASE" \
--define "version $VERSION" \
--define "release 1"
if [ ! -f "RPMS/noarch/$PKG-1.noarch.rpm" ]; then
die "RPMS/noarch/$PKG-1.noarch.rpm did not build"
fi
mv "RPMS/noarch/$PKG-1.noarch.rpm" $RELEASE
rm -rf $RELEASE/rpm
echo "OK" echo "OK"
} }
@@ -262,7 +274,9 @@ fi
# Now that those ^ items are updated, you need to commit and push one more # Now that those ^ items are updated, you need to commit and push one more
# time before the release packages are built. This script can't do that # time before the release packages are built. This script can't do that
# because your branch could non-standard. # because your branch could non-standard.
cat <<MSG BUILD=${BUILD:-1}
if [ $BUILD -eq 1 ]; then
cat <<MSG
Branch verified and updated; ready to build $PKG, Branch verified and updated; ready to build $PKG,
but first you must: but first you must:
@@ -273,11 +287,9 @@ but first you must:
Press any key to continue... (or Ctrl-C to abort) Press any key to continue... (or Ctrl-C to abort)
MSG MSG
read
# Build the release packages. read
BUILD=${BUILD:-1}
if [ $BUILD -eq 1 ]; then
prep_release_dir prep_release_dir
BUILD_TAR=${BUILD_TAR:-1} BUILD_TAR=${BUILD_TAR:-1}

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env awk -f #!/usr/bin/awk -f
BEGIN { BEGIN {
if ( from == "" || file == "" || to == "" ) { if ( from == "" || file == "" || to == "" ) {