mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
Merge branch '3.0-rc' of percona.github.com:percona/percona-toolkit into 3.0-rc
This commit is contained in:
@@ -10,7 +10,7 @@ Vcs-Browser: https://github.com/percona/percona-toolkit
|
||||
Vcs-Git: git://github.com/percona/percona-toolkit.git
|
||||
|
||||
Package: percona-toolkit
|
||||
Architecture: all
|
||||
Architecture: @@ARHITECTURE@@
|
||||
Depends: ${perl:Depends}, libdbi-perl (>= 1.13), libdbd-mysql-perl | libdbd-mysql-5.1-perl, libterm-readkey-perl (>=2.10),
|
||||
libio-socket-ssl-perl
|
||||
Description: Advanced MySQL and system command-line tools
|
||||
|
9
config/deb/preinst
Normal file
9
config/deb/preinst
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
INSTALLED=`dpkg-query -l | grep percona-toolkit | awk '{print $3}' | awk -F'.' '{print $1}'`
|
||||
if [ $INSTALLED != "0" -a "x$INSTALLED" != "x3" ]; then
|
||||
echo "** It is not possible to install percona-toolkit-3.0.0rc as it will replace already installed package"
|
||||
echo "** Please note that percona-toolkit-3.0.0 is RC"
|
||||
echo "** If you want to install it you need to remove already installed package"
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -8,7 +8,7 @@ Vendor: Percona
|
||||
URL: http://www.percona.com/software/percona-toolkit/
|
||||
Source: percona-toolkit-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
BuildArch: noarch
|
||||
BuildArch: @@ARHITECTURE@@
|
||||
Requires: perl(DBI) >= 1.13, perl(DBD::mysql) >= 1.0, perl(Time::HiRes), perl(IO::Socket::SSL), perl(Digest::MD5), perl(Term::ReadKey)
|
||||
AutoReq: no
|
||||
|
||||
@@ -41,6 +41,16 @@ 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/*
|
||||
|
||||
%pre
|
||||
INSTALLED=`rpm -q percona-toolkit | awk -F'-' '{print $3}' | awk -F'.' '{print $1}'`
|
||||
if [ $INSTALLED < 3 ]; then
|
||||
echo "** It is not possible to install percona-toolkit-3.0.0rc as it will replace already installed package"
|
||||
echo "** Please note that percona-toolkit-3.0.0 is RC"
|
||||
echo "** If you want to install it you need to remove already installed package"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
@@ -353,7 +353,7 @@ build_tar() {
|
||||
}
|
||||
|
||||
build_rpm() {
|
||||
echo -n "Building $PKG-1.noarch.rpm... "
|
||||
echo -n "Building $PKG-1.$ARCH.rpm... "
|
||||
cd $RELEASE_DIR
|
||||
if [ ! -f "$PKG.tar.gz" ]; then
|
||||
die "Cannot build RPM because $PKG.tar.gz does not exist"
|
||||
@@ -375,17 +375,17 @@ build_rpm() {
|
||||
warn "rpmbuild has warnings; see $tmpdir/rpmbuild"
|
||||
fi
|
||||
|
||||
if [ ! -f "RPMS/noarch/$PKG-1.noarch.rpm" ]; then
|
||||
die "RPMS/noarch/$PKG-1.noarch.rpm did not build"
|
||||
if [ ! -f "RPMS/$ARCH/$PKG-1.$ARCH.rpm" ]; then
|
||||
die "RPMS/$ARCH/$PKG-1.$ARCH.rpm did not build"
|
||||
fi
|
||||
mv "RPMS/noarch/$PKG-1.noarch.rpm" $RELEASE_DIR/RPM
|
||||
mv "RPMS/$ARCH/$PKG-1.$ARCH.rpm" $RELEASE_DIR/RPM
|
||||
rm -rf $RELEASE_DIR/rpm
|
||||
|
||||
echo "OK"
|
||||
}
|
||||
|
||||
build_deb() {
|
||||
local deb_pkg="percona-toolkit_$VERSION-1_all.deb"
|
||||
local deb_pkg="percona-toolkit_$VERSION-1_$DEB_ARCH.deb"
|
||||
echo -n "Building $deb_pkg... "
|
||||
|
||||
cd $RELEASE_DIR
|
||||
@@ -478,6 +478,20 @@ if [ $OS_ARCH != "linux-amd64" ] && [ $OS_ARCH != "linux-386" ] && [ $OS_ARCH !=
|
||||
die "Valid OS-ARCH combinations are: linux-amd64, linux-386, darwin-amd64"
|
||||
fi
|
||||
|
||||
if [ $OS_ARCH == "linux-amd64" ]; then
|
||||
ARCH="x86_64"
|
||||
DEB_ARCH="amd64"
|
||||
elif [ $OS_ARCH == "linux-386" ]; then
|
||||
ARCH="i386"
|
||||
DEB_ARCH="i386"
|
||||
else
|
||||
ARCH="noarch"
|
||||
ARCH="all"
|
||||
fi
|
||||
|
||||
sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $RPM_CONFIG_DIR/percona-toolkit.spec
|
||||
sed -i'.bak' -e "s/@@ARHITECTURE@@/$DEB_ARCH/" $DEB_CONFIG_DIR/control
|
||||
|
||||
if [ ! -f $REL_NOTES ]; then
|
||||
die "$REL_NOTES does not exist"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user