Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PKG-259 Create release tag for - PXB 8.4.0-2 (Q4 2024) #1632

Merged
merged 10 commits into from
Dec 19, 2024
2 changes: 1 addition & 1 deletion XB_VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
XB_VERSION_MAJOR=8
XB_VERSION_MINOR=4
XB_VERSION_PATCH=0
XB_VERSION_EXTRA=-1
XB_VERSION_EXTRA=-2
39 changes: 30 additions & 9 deletions storage/innobase/xtrabackup/utils/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# Bail out on errors, be strict
set -ue

# Enable Pro build
FIPSMODE=0

# Examine parameters
TARGET="$(uname -m)"
TARGET_CFLAGS=''
Expand Down Expand Up @@ -99,13 +102,21 @@ if [ -f /etc/redhat-release ]; then
fi

# Create a temporary working directory
PRODUCT_FULL="percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER"
if [[ "x${FIPSMODE}" == "x1" ]]; then
PRODUCT_FULL="percona-xtrabackup-pro-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER"
else
PRODUCT_FULL="percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER"
fi
BASEINSTALLDIR="$(cd "$WORKDIR" && TMPDIR="$WORKDIR_ABS" mktemp -d xtrabackup-build.XXXXXX)"
INSTALLDIR="$WORKDIR_ABS/$BASEINSTALLDIR/$PRODUCT_FULL" # Make it absolute

mkdir "$INSTALLDIR"

# Build
BUILD_PARAMETER=""
if [[ "x${FIPSMODE}" == "x1" ]]; then
BUILD_PARAMETER="-DPROBUILD=1"
fi
(
cd "$WORKDIR"

Expand All @@ -118,7 +129,7 @@ mkdir "$INSTALLDIR"
$CMAKE_BIN -DBUILD_CONFIG=xtrabackup_release -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" \
-DINSTALL_MYSQLTESTDIR=percona-xtrabackup-${XB_VERSION_MAJOR}.${XB_VERSION_MINOR}-test -DINSTALL_MANDIR=${INSTALLDIR}/man \
-DDOWNLOAD_BOOST=1 -DWITH_BOOST=${WORKDIR_ABS}/libboost \
-DMINIMAL_RELWITHDEBINFO=OFF \
-DMINIMAL_RELWITHDEBINFO=OFF ${BUILD_PARAMETER}\
-DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock -DFORCE_INSOURCE_BUILD=1 -DWITH_ZLIB=bundled -DWITH_ZSTD=bundled .
make $MAKE_JFLAG
make install
Expand Down Expand Up @@ -244,13 +255,23 @@ mkdir "$INSTALLDIR"
link

cd "$WORKDIR"
$TAR czf "percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER.tar.gz" \
--owner=0 --group=0 -C "$INSTALLDIR/../" \
"percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER"

$TAR czf "percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER-minimal.tar.gz" \
--owner=0 --group=0 -C "$INSTALLDIR/../minimal/" \
"percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER-minimal"
if [[ "x${FIPSMODE}" == "x1" ]]; then
$TAR czf "percona-xtrabackup-pro-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER.tar.gz" \
--owner=0 --group=0 -C "$INSTALLDIR/../" \
"percona-xtrabackup-pro-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER"

$TAR czf "percona-xtrabackup-pro-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER-minimal.tar.gz" \
--owner=0 --group=0 -C "$INSTALLDIR/../minimal/" \
"percona-xtrabackup-pro-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER-minimal"
else
$TAR czf "percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER.tar.gz" \
--owner=0 --group=0 -C "$INSTALLDIR/../" \
"percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER"

$TAR czf "percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER-minimal.tar.gz" \
--owner=0 --group=0 -C "$INSTALLDIR/../minimal/" \
"percona-xtrabackup-$XTRABACKUP_VERSION-$(uname -s)-$(uname -m)$GLIBC_VER-minimal"
fi
fi

# Clean up build dir
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/xtrabackup/utils/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ percona-xtrabackup-82 (8.2) unstable; urgency=low

* Packaging changes for version 8.2

-- Vadim Yalovets <[email protected]> Fri, 11 Dec 202r3 09:01:20 +0300
-- Vadim Yalovets <[email protected]> Fri, 11 Dec 2023 09:01:20 +0300

percona-xtrabackup-81 (8.1) unstable; urgency=low

Expand Down
16 changes: 13 additions & 3 deletions storage/innobase/xtrabackup/utils/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ Homepage: http://www.percona.com/software/percona-xtrabackup

Package: percona-xtrabackup-84
Architecture: any
Depends: libdbd-mysql-perl, libcurl4-openssl-dev, rsync, zstd, ${misc:Depends}, ${shlibs:Depends}
Depends: libdbd-mysql-perl, libcurl4-openssl-dev, rsync, zstd, lz4, ${misc:Depends}, ${shlibs:Depends}
Provides: xtrabackup
Conflicts: percona-xtrabackup-21, percona-xtrabackup-22, percona-xtrabackup, percona-xtrabackup-24, percona-xtrabackup-80, percona-xtrabackup-81, percona-xtrabackup-82, percona-xtrabackup-83
Conflicts: percona-xtrabackup-21,
percona-xtrabackup-22,
percona-xtrabackup,
percona-xtrabackup-24,
percona-xtrabackup-80,
percona-xtrabackup-81,
percona-xtrabackup-82,
percona-xtrabackup-83,
percona-xtrabackup-pro-84
Breaks: xtrabackup (<< 2.0.0~)
Replaces: xtrabackup (<< 2.0.0~)
Enhances: mysql-server
Expand All @@ -43,13 +51,15 @@ Package: percona-xtrabackup-dbg-84
Section: debug
Architecture: any
Depends: percona-xtrabackup-84 (= ${binary:Version}), ${misc:Depends}
Conflicts: percona-xtrabackup-pro-dbg-84
Description: Debug symbols for Percona XtraBackup
Debug symbols for the binaries in percona-xtrabackup. Install this
package if you need to run any of those with gdb.

Package: percona-xtrabackup-test-84
Architecture: any
Depends: mysql-client, percona-xtrabackup-84, ${misc:Depends}
Depends: percona-xtrabackup-84, mysql-client, ${misc:Depends}
Conflicts: percona-xtrabackup-test-pro-84
Description: Test suite for Percona XtraBackup
Test suite for Percona XtraBackup. Install this package if you intend
to run XtraBackup's test suite.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

. /usr/share/debconf/confmodule

exit 0
5 changes: 3 additions & 2 deletions storage/innobase/xtrabackup/utils/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#export DH_VERBOSE=1

export FIPSFLAGS=
NCPU=$(shell grep -c processor /proc/cpuinfo)

# These are used for cross-compiling and for saving the configure script
Expand All @@ -28,14 +29,14 @@ ifeq "$(DEB_DUMMY)" ""
-DWITH_SSL=system -DINSTALL_MYSQLTESTDIR=/usr/share/percona-xtrabackup-test-84 \
-DINSTALL_MANDIR=/usr/share/man -DWITH_MAN_PAGES=1 -DMINIMAL_RELWITHDEBINFO=OFF \
-DDOWNLOAD_BOOST=1 -DWITH_BOOST=libboost -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
-DINSTALL_PLUGINDIR=lib/xtrabackup/plugin -DFORCE_INSOURCE_BUILD=1 -DWITH_ZLIB=bundled -DWITH_ZSTD=bundled -DWITH_PROTOBUF=bundled && \
-DINSTALL_PLUGINDIR=lib/xtrabackup/plugin -DFORCE_INSOURCE_BUILD=1 -DWITH_ZLIB=bundled -DWITH_ZSTD=bundled -DWITH_PROTOBUF=bundled $(FIPSFLAGS) && \
cd ..
( test -d $(builddir) || mkdir $(builddir) ) && cd $(builddir) && \
cmake .. -DBUILD_CONFIG=xtrabackup_release -DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_SSL=system -DINSTALL_MYSQLTESTDIR=/usr/share/percona-xtrabackup-test-84 \
-DINSTALL_MANDIR=/usr/share/man -DWITH_MAN_PAGES=1 -DMINIMAL_RELWITHDEBINFO=OFF \
-DDOWNLOAD_BOOST=1 -DWITH_BOOST=libboost -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
-DINSTALL_PLUGINDIR=lib/xtrabackup/plugin -DFORCE_INSOURCE_BUILD=1 -DWITH_ZLIB=bundled -DWITH_ZSTD=bundled -DWITH_PROTOBUF=bundled
-DINSTALL_PLUGINDIR=lib/xtrabackup/plugin -DFORCE_INSOURCE_BUILD=1 -DWITH_ZLIB=bundled -DWITH_ZSTD=bundled -DWITH_PROTOBUF=bundled $(FIPSFLAGS)
else
# Dummy binaries that avoid compilation
echo 'main() { return 300; }' | gcc -x c - -o xtrabackup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Usage: $0 [OPTIONS]
--install_deps Install build dependencies(root previlages are required)
--branch Branch for build
--repo Repo for build
--enable_fipsmode Build gated PXB
--rpm_release RPM version( default = 1)
--deb_release DEB version( default = 1)
--help) usage ;;
Expand Down Expand Up @@ -57,6 +58,7 @@ parse_arguments() {
--install_deps=*) INSTALL="$val" ;;
--branch=*) BRANCH="$val" ;;
--repo=*) REPO="$val" ;;
--enable_fipsmode=*) FIPSMODE="$val" ;;
--rpm_release=*) RPM_RELEASE="$val" ;;
--deb_release=*) DEB_RELEASE="$val" ;;
--help) usage ;;
Expand Down Expand Up @@ -178,6 +180,7 @@ get_sources(){
sed -i "s:@@XB_VERSION_EXTRA@@:${EXTRAVER}:g" storage/innobase/xtrabackup/utils/percona-xtrabackup.spec
sed -i "s:@@XB_RPM_VERSION_EXTRA@@:${RPM_EXTRAVER}:g" storage/innobase/xtrabackup/utils/percona-xtrabackup.spec
sed -i "s:@@XB_REVISION@@:${REVISION}:g" storage/innobase/xtrabackup/utils/percona-xtrabackup.spec
sed -i "s:@@RPM_RELEASE@@:${RPM_RELEASE}:g" storage/innobase/xtrabackup/utils/percona-xtrabackup.spec
#
# create a PXB tar
cd ${WORKDIR}/percona-xtrabackup
Expand Down Expand Up @@ -252,7 +255,7 @@ install_deps() {
yum-config-manager --enable ol9_codeready_builder
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
else
add_percona_yum_repo
# add_percona_yum_repo
percona-release enable tools testing
fi
else
Expand Down Expand Up @@ -464,13 +467,39 @@ build_srpm(){
sed -i "/^%changelog/a - Release ${VERSION}-${RELEASE}" percona-xtrabackup.spec
sed -i "/^%changelog/a * $(date "+%a") $(date "+%b") $(date "+%d") $(date "+%Y") Percona Development Team <[email protected]> - ${VERSION}-${RELEASE}" percona-xtrabackup.spec
#
if [[ "x${FIPSMODE}" == "x1" ]]; then
sed -i -e "s:Name\: percona-xtrabackup-%:Name\: percona-xtrabackup-pro-%:g" \
-e "s:Requires\: percona-xtrabackup-%:Requires\: percona-xtrabackup-pro-%:g" \
-e "s:percona-xtrabackup-test-%:percona-xtrabackup-test-pro-%:g" \
-e "s:Conflicts\: percona-xtrabackup-pro-%:Conflicts\: percona-xtrabackup-%:g" \
-e "s:Conflicts\: percona-xtrabackup-test-pro-%:Conflicts\: percona-xtrabackup-test-%:g" \
percona-xtrabackup.spec
fi
#
cd ${WORKDIR}/rpmbuild/SOURCES
wget https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh
cd ${WORKDIR}/rpmbuild/SPECS
line_number=$(grep -n SOURCE999 percona-xtrabackup.spec | awk -F ':' '{print $1}')
cp ../SOURCES/call-home.sh ./
awk -v n=$line_number 'NR <= n {print > "part1.txt"} NR > n {print > "part2.txt"}' percona-xtrabackup.spec
head -n -1 part1.txt > temp && mv temp part1.txt
echo "cat <<'CALLHOME' > /tmp/call-home.sh" >> part1.txt
cat call-home.sh >> part1.txt
echo "CALLHOME" >> part1.txt
cat part2.txt >> part1.txt
rm -f call-home.sh part2.txt
mv part1.txt percona-xtrabackup.spec
cd $WORKDIR
#
mv -fv $TARFILE $WORKDIR/rpmbuild/SOURCES
#
enable_venv

rpmbuild -bs --define "_topdir $WORKDIR/rpmbuild" --define "dist .generic" rpmbuild/SPECS/percona-xtrabackup.spec
if [[ "x${FIPSMODE}" == "x1" ]]; then
rpmbuild -bs --define "_topdir $WORKDIR/rpmbuild" --define "dist .generic" --define "enable_fipsmode 1" rpmbuild/SPECS/percona-xtrabackup.spec
else
rpmbuild -bs --define "_topdir $WORKDIR/rpmbuild" --define "dist .generic" rpmbuild/SPECS/percona-xtrabackup.spec
fi

mkdir -p ${WORKDIR}/srpm
mkdir -p ${CURDIR}/srpm
Expand Down Expand Up @@ -520,8 +549,11 @@ build_rpm(){
SRCRPM=$(basename $(find . -name '*.src.rpm' | sort | tail -n1))

enable_venv

rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --rebuild rpmbuild/SRPMS/${SRCRPM}
if [[ "x${FIPSMODE}" == "x1" ]]; then
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "enable_fipsmode 1" --rebuild rpmbuild/SRPMS/${SRCRPM}
else
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --rebuild rpmbuild/SRPMS/${SRCRPM}
fi
return_code=$?
if [ $return_code != 0 ]; then
exit $return_code
Expand Down Expand Up @@ -554,12 +586,37 @@ build_source_deb(){

echo "DEB_RELEASE=${DEB_RELEASE}" >> ${CURDIR}/percona-xtrabackup-8.0.properties

NEWTAR=${NAME}-84_${VERSION}.orig.tar.gz
if [[ "x${FIPSMODE}" == "x1" ]]; then
NEWTAR=${NAME}-pro-84_${VERSION}.orig.tar.gz
else
NEWTAR=${NAME}-84_${VERSION}.orig.tar.gz
fi
mv ${TARFILE} ${NEWTAR}

tar xzf ${NEWTAR}
cd percona-xtrabackup-$VERSION
cp -av storage/innobase/xtrabackup/utils/debian .
if [ x"${FIPSMODE}" == x1 ]; then
sed -i "s:FIPSFLAGS=:FIPSFLAGS=-DPROBUILD=1:g" debian/rules
sed -i "s:percona-xtrabackup-dbg-:percona-xtrabackup-pro-dbg-:g" debian/rules
sed -i "s:percona-xtrabackup-test-:percona-xtrabackup-test-pro-:g" debian/rules
sed -i "s:percona-xtrabackup-:percona-xtrabackup-pro-:g" debian/changelog
sed -i "s:Source\: percona-xtrabackup:Source\: percona-xtrabackup-pro:g" debian/control
sed -i "s:Package\: percona-xtrabackup-84:Package\: percona-xtrabackup-pro-84:g" debian/control
sed -i "s: percona-xtrabackup-pro: percona-xtrabackup:g" debian/control
sed -i "s:Package\: percona-xtrabackup-dbg:Package\: percona-xtrabackup-pro-dbg:g" debian/control
sed -i "s:Depends\: percona-xtrabackup:Depends\: percona-xtrabackup-pro:g" debian/control
sed -i "s:Conflicts\: percona-xtrabackup-pro-dbg:Conflicts\: percona-xtrabackup-dbg:g" debian/control
sed -i "s:Package\: percona-xtrabackup-test:Package\: percona-xtrabackup-test-pro:g" debian/control
sed -i "s:Conflicts\: percona-xtrabackup-test-pro:Conflicts\: percona-xtrabackup-test:g" debian/control
cp debian/percona-xtrabackup-84.docs debian/percona-xtrabackup-pro-84.docs
cp debian/percona-xtrabackup-84.install debian/percona-xtrabackup-pro-84.install
cp debian/percona-xtrabackup-84.postinst debian/percona-xtrabackup-pro-84.postinst
cp debian/percona-xtrabackup-84.lintian-overrides debian/percona-xtrabackup-pro-84.lintian-overrides
cp debian/percona-xtrabackup-test-84.install debian/percona-xtrabackup-test-pro-84.install
cp debian/percona-xtrabackup-test-84.lintian-overrides debian/percona-xtrabackup-test-pro-84.lintian-overrides
sed -i "s:percona-xtrabackup-test:percona-xtrabackup-test-pro:g" debian/percona-xtrabackup-test-pro-84.install
fi
dch -D unstable --force-distribution -v "${VERSION}-${DEB_RELEASE}" "Update to new upstream release Percona XtraBackup ${VERSION}"
dpkg-buildpackage -S

Expand Down Expand Up @@ -598,8 +655,13 @@ build_deb(){


DSC=$(basename $(find . -name '*.dsc' | sort | tail -n 1))
DIRNAME=$(echo $DSC | sed -e 's:_:-:g' | awk -F'-' '{print $1"-"$2"-"$3"-"$4"-"$5}')
VERSION=$(echo $DSC | sed -e 's:_:-:g' | awk -F'-' '{print $4"-"$5}')
if [[ "x${FIPSMODE}" == "x1" ]]; then
DIRNAME=$(echo $DSC | sed -e 's:_:-:g' | awk -F'-' '{print $1"-"$2"-"$3"-"$4"-"$5"-"$6}')
VERSION=$(echo $DSC | sed -e 's:_:-:g' | awk -F'-' '{print $5"-"$6}')
else
DIRNAME=$(echo $DSC | sed -e 's:_:-:g' | awk -F'-' '{print $1"-"$2"-"$3"-"$4"-"$5}')
VERSION=$(echo $DSC | sed -e 's:_:-:g' | awk -F'-' '{print $4"-"$5}')
fi
#
echo "DEB_RELEASE=${DEB_RELEASE}" >> ${CURDIR}/percona-xtrabackup-8.0.properties
echo "DEBIAN_VERSION=${OS_NAME}" >> ${CURDIR}/percona-xtrabackup-8.0.properties
Expand All @@ -608,6 +670,22 @@ build_deb(){
dpkg-source -x $DSC
cd $DIRNAME
dch -m -D "$OS_NAME" --force-distribution -v "$VERSION-$DEB_RELEASE.$OS_NAME" 'Update distribution'
postfix=""
if [ x"${FIPSMODE}" == x1 ]; then
postfix="-pro"
fi
cd debian/
wget https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh
sed -i 's:exit 0::' percona-xtrabackup"${postfix}"-84.postinst
echo "cat <<'CALLHOME' > /tmp/call-home.sh" >> percona-xtrabackup"${postfix}"-84.postinst
cat call-home.sh >> percona-xtrabackup"${postfix}"-84.postinst
echo "CALLHOME" >> percona-xtrabackup"${postfix}"-84.postinst
echo "bash +x /tmp/call-home.sh -f \"PRODUCT_FAMILY_PXB\" -v \"${VERSION}-${DEB_RELEASE}"${postfix}"\" -d \"PACKAGE\" &>/dev/null || :" >> percona-xtrabackup"${postfix}"-84.postinst
echo "rm -rf /tmp/call-home.sh" >> percona-xtrabackup"${postfix}"-84.postinst
echo "exit 0" >> percona-xtrabackup"${postfix}"-84.postinst
rm -f call-home.sh
cd ../

dpkg-buildpackage -rfakeroot -uc -us -b

cd ${WORKDIR}
Expand Down Expand Up @@ -640,6 +718,9 @@ build_tarball(){
tar xzf ${TARFILE}
cd ${TARFILE%.tar.gz}
#
if [[ "x${FIPSMODE}" == "x1" ]]; then
sed -i "s/FIPSMODE=0/FIPSMODE=1/g" ./storage/innobase/xtrabackup/utils/build-binary.sh
fi
bash -x ./storage/innobase/xtrabackup/utils/build-binary.sh ${WORKDIR}/TARGET

mkdir -p ${WORKDIR}/tarball
Expand Down
Loading
Loading