Build packages changes

This commit is contained in:
Evgeniy Patlan
2017-02-03 17:45:42 +02:00
parent 6fa66b4e97
commit 4ad2ccc423
3 changed files with 24 additions and 2 deletions

9
config/deb/preinst Normal file
View 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

View File

@@ -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 {} ';' find $RPM_BUILD_ROOT -type f -name 'percona-toolkit.pod' -exec rm -f {} ';'
chmod -R u+w $RPM_BUILD_ROOT/* 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 %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT

View File

@@ -385,7 +385,7 @@ build_rpm() {
} }
build_deb() { 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... " echo -n "Building $deb_pkg... "
cd $RELEASE_DIR cd $RELEASE_DIR
@@ -480,14 +480,17 @@ fi
if [ $OS_ARCH == "linux-amd64" ]; then if [ $OS_ARCH == "linux-amd64" ]; then
ARCH="x86_64" ARCH="x86_64"
DEB_ARCH="amd64"
elif [ $OS_ARCH == "linux-386" ]; then elif [ $OS_ARCH == "linux-386" ]; then
ARCH="i386" ARCH="i386"
DEB_ARCH="i386"
else else
ARCH="noarch" ARCH="noarch"
ARCH="all"
fi fi
sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $RPM_CONFIG_DIR/percona-toolkit.spec sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $RPM_CONFIG_DIR/percona-toolkit.spec
sed -i'.bak' -e "s/@@ARHITECTURE@@/$ARCH/" $DEB_CONFIG_DIR/control sed -i'.bak' -e "s/@@ARHITECTURE@@/$DEB_ARCH/" $DEB_CONFIG_DIR/control
if [ ! -f $REL_NOTES ]; then if [ ! -f $REL_NOTES ]; then
die "$REL_NOTES does not exist" die "$REL_NOTES does not exist"