Merge pull request #162 from EvgeniyPatlan/3.0-rc

Allow to build arch-dependent packages
This commit is contained in:
EvgeniyPatlan
2017-02-01 23:04:13 +02:00
committed by GitHub
3 changed files with 17 additions and 6 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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,10 +375,10 @@ 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"
@@ -478,6 +478,17 @@ 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"
elif [ $OS_ARCH == "linux-386" ]; then
ARCH="i386"
else
ARCH="noarch"
fi
sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $RPM_CONFIG_DIR/percona-toolkit.spec
sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $DEB_CONFIG_DIR/control
if [ ! -f $REL_NOTES ]; then
die "$REL_NOTES does not exist"
fi