@@ -201,6 +201,12 @@ get_system(){
201201 export ARCH=$( echo $( uname -m) | sed -e ' s:i686:i386:g' )
202202 export OS_NAME=" el$RHEL "
203203 export OS=" rpm"
204+ elif [ -f /etc/amazon-linux-release ]; then
205+ GLIBC_VER_TMP=" $( rpm glibc -qa --qf %{VERSION}) "
206+ export RHEL=$( rpm --eval %amzn)
207+ export ARCH=$( echo $( uname -m) | sed -e ' s:i686:i386:g' )
208+ export OS_NAME=" amzn$RHEL "
209+ export OS=" rpm"
204210 else
205211 GLIBC_VER_TMP=" $( dpkg-query -W -f=' ${Version}' libc6 | awk -F' -' ' {print $1}' ) "
206212 export ARCH=$( uname -m)
@@ -247,25 +253,30 @@ install_deps() {
247253 yum -y install git wget yum-utils curl
248254 yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm
249255 if [ x" $ARCH " = " xx86_64" ]; then
250- if [ $RHEL = 9 ]; then
251- yum-config-manager --enable ol9_distro_builder
252- yum-config-manager --enable ol9_codeready_builder
253- yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9 .noarch.rpm
256+ if [ ${ RHEL} = 9 -o ${RHEL} = 10 ]; then
257+ yum-config-manager --enable ol ${RHEL} _distro_builder
258+ yum-config-manager --enable ol ${RHEL} _codeready_builder
259+ yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL} .noarch.rpm
254260 else
255- add_percona_yum_repo
261+ # add_percona_yum_repo
256262 percona-release enable tools testing
257263 fi
258264 else
259265 yum-config-manager --enable ol" ${RHEL} " _codeready_builder
260- yum -y install epel-release
266+ if [ ${RHEL} = 10 ]; then
267+ yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
268+ yum -y install epel-release
269+ else
270+ yum -y install epel-release
271+ fi
261272 fi
262- if [ ${RHEL} = 8 -o ${RHEL} = 9 ]; then
263- PKGLIST+=" binutils-devel python3-pip python3-setuptools libtirpc-devel "
273+ if [[ " ${RHEL} " = " 8 " || " ${RHEL} " = " 9 " || " ${RHEL} " = " 2023 " || " ${RHEL} " = " 10 " ] ]; then
274+ PKGLIST+=" binutils-devel python3-pip python3-setuptools"
264275 PKGLIST+=" libcurl-devel cmake libaio-devel zlib-devel libev-devel bison make"
265276 PKGLIST+=" rpm-build libgcrypt-devel ncurses-devel readline-devel openssl-devel"
266- PKGLIST+=" vim-common rpmlint patchelf python3-wheel libudev-devel"
267- if [ $ RHEL = 9 ]; then
268- PKGLIST+=" rsync procps-ng-devel python3-sphinx gcc gcc-c++"
277+ PKGLIST+=" vim-common rpmlint patchelf python3-wheel libudev-devel libtirpc-devel "
278+ if [[ " ${ RHEL} " = " 9 " || " ${RHEL} " = " 2023 " || " ${RHEL} " = " 10 " ] ]; then
279+ PKGLIST+=" rsync procps-ng-devel python3-sphinx gcc gcc-c++ gcc-gfortran "
269280 else
270281 if [ x" $ARCH " = " xx86_64" ]; then
271282 yum-config-manager --enable powertools
@@ -357,12 +368,12 @@ install_deps() {
357368 PKGLIST+=" cmake debhelper libaio-dev libncurses-dev libtool libz-dev libsasl2-dev vim-common"
358369 PKGLIST+=" libgcrypt-dev libev-dev lsb-release libudev-dev pkg-config"
359370 PKGLIST+=" build-essential rsync libdbd-mysql-perl libnuma1 socat libssl-dev patchelf libicu-dev"
360- if [ " ${OS_NAME} " == " bookworm" -o " ${OS_NAME} " == " noble" ]; then
371+ if [ " ${OS_NAME} " == " bookworm" -o " ${OS_NAME} " == " noble" -o " ${OS_NAME} " == " trixie " ]; then
361372 PKGLIST+=" libproc2-dev"
362373 else
363374 PKGLIST+=" libprocps-dev"
364375 fi
365- if [ " ${OS_NAME} " == " noble" ]; then
376+ if [ " ${OS_NAME} " == " noble" -o " ${OS_NAME} " == " trixie " ]; then
366377 wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
367378 dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
368379 fi
@@ -372,10 +383,10 @@ install_deps() {
372383 if [ " ${OS_NAME} " == " focal" ]; then
373384 PKGLIST+=" gcc-10 g++-10"
374385 fi
375- if [ " ${OS_NAME} " == " noble" ]; then
386+ if [ " ${OS_NAME} " == " noble" -o " ${OS_NAME} " == " trixie " ]; then
376387 PKGLIST+=" libtirpc-dev"
377388 fi
378- if [ " ${OS_NAME} " == " focal" -o " ${OS_NAME} " == " bullseye" -o " ${OS_NAME} " == " bookworm" -o " ${OS_NAME} " == " jammy" -o " ${OS_NAME} " == " noble" ]; then
389+ if [ " ${OS_NAME} " == " focal" -o " ${OS_NAME} " == " bullseye" -o " ${OS_NAME} " == " bookworm" -o " ${OS_NAME} " == " jammy" -o " ${OS_NAME} " == " noble" -o " ${OS_NAME} " == " trixie " ]; then
379390 PKGLIST+=" python3-sphinx python3-docutils"
380391 else
381392 PKGLIST+=" python-sphinx python-docutils"
@@ -524,11 +535,18 @@ build_rpm(){
524535
525536 enable_venv
526537
527- rpmbuild --define " _topdir ${WORKDIR} /rpmbuild" --define " dist .el ${RHEL }" --rebuild rpmbuild/SRPMS/${SRCRPM}
538+ rpmbuild --define " _topdir ${WORKDIR} /rpmbuild" --define " dist .${OS_NAME }" --rebuild rpmbuild/SRPMS/${SRCRPM}
528539 return_code=$?
529540 if [ $return_code != 0 ]; then
530541 exit $return_code
531542 fi
543+
544+ # Verify RPMs were actually produced
545+ if [ -z " $( find ${WORKDIR} /rpmbuild/RPMS -name ' *.rpm' 2> /dev/null) " ]; then
546+ echo " ERROR: rpmbuild succeeded but no RPM files were generated!"
547+ exit 1
548+ fi
549+
532550 mkdir -p ${WORKDIR} /rpm
533551 mkdir -p ${CURDIR} /rpm
534552 cp rpmbuild/RPMS/* /* .rpm ${WORKDIR} /rpm
@@ -611,6 +629,18 @@ build_deb(){
611629 dpkg-source -x $DSC
612630 cd $DIRNAME
613631 dch -m -D " $OS_NAME " --force-distribution -v " $VERSION -$DEB_RELEASE .$OS_NAME " ' Update distribution'
632+ cd debian/
633+ wget https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh
634+ sed -i ' s:exit 0::' percona-xtrabackup-91.postinst
635+ echo " cat <<'CALLHOME' > /tmp/call-home.sh" >> percona-xtrabackup-91.postinst
636+ cat call-home.sh >> percona-xtrabackup-91.postinst
637+ echo " CALLHOME" >> percona-xtrabackup-91.postinst
638+ echo " bash +x /tmp/call-home.sh -f \" PRODUCT_FAMILY_PXB\" -v \" ${VERSION} -${DEB_RELEASE} \" -d \" PACKAGE\" &>/dev/null || :" >> percona-xtrabackup-91.postinst
639+ echo " rm -rf /tmp/call-home.sh" >> percona-xtrabackup-91.postinst
640+ echo " exit 0" >> percona-xtrabackup-91.postinst
641+ rm -f call-home.sh
642+ cd ../
643+
614644 dpkg-buildpackage -rfakeroot -uc -us -b
615645
616646 cd ${WORKDIR}
0 commit comments