From 0a40e9329a08c13325b4457ea016abc698db2b52 Mon Sep 17 00:00:00 2001 From: Vadim Yalovets Date: Wed, 20 Nov 2024 13:47:15 +0200 Subject: [PATCH] PKG-299 Release tasks for PS 8.4.2 pro --- build-ps/build-binary.sh | 36 +++-- build-ps/debian/compat | 2 +- build-ps/debian/percona-server-server.install | 2 - build-ps/debian/rules | 10 +- build-ps/percona-server-8.0_builder.sh | 139 ++++++++++++++++-- build-ps/percona-server.spec | 27 ++++ 6 files changed, 190 insertions(+), 26 deletions(-) diff --git a/build-ps/build-binary.sh b/build-ps/build-binary.sh index ef6c5f6e1b52..20634a5dd017 100755 --- a/build-ps/build-binary.sh +++ b/build-ps/build-binary.sh @@ -31,6 +31,7 @@ COMMON_FLAGS='' TOKUDB_BACKUP_VERSION='' # enable asan ENABLE_ASAN=0 +FIPSMODE=0 # # Some programs that may be overriden TAR=${TAR:-tar} @@ -39,7 +40,7 @@ TAR=${TAR:-tar} if ! getopt --test then go_out="$(getopt --options=iqdvj:m:t: \ - --longoptions=i686,quiet,debug,valgrind,with-jemalloc:,with-mecab:,with-ssl:,tag: \ + --longoptions=i686,quiet,debug,valgrind,with-jemalloc:,enable-fipsmode,with-mecab:,with-ssl:,tag: \ --name="$(basename "$0")" -- "$@")" test $? -eq 0 || exit 1 eval set -- $go_out @@ -104,6 +105,12 @@ do exit 3 fi ;; + --enable-fipsmode ) + shift + FIPSMODE=1 + WITH_SSL="OFF" + BUILD_COMMENT="${BUILD_COMMENT:-}-pro" + ;; -t | --tag ) shift TAG="$1" @@ -169,10 +176,19 @@ elif [ -n "$(command -v git)" -a -d "$SOURCEDIR/.git" ]; then REVISION="$(git rev-parse --short HEAD)" fi -PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" +if [ x"${FIPSMODE}" == x1 ]; then + PRODUCT_FULL="Percona-Server-Pro-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" +else + PRODUCT_FULL="Percona-Server-$MYSQL_VERSION-$PERCONA_SERVER_VERSION" +fi PRODUCT_FULL="$PRODUCT_FULL-$TAG$(uname -s)${DIST_NAME:-}.$TARGET${GLIBC_VER:-}${TARBALL_SUFFIX:-}" -COMMENT="Percona Server (GPL), Release ${MYSQL_VERSION_EXTRA#-}" -COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}" +if [ x"${FIPSMODE}" == x1 ]; then + COMMENT="Percona Server Pro (GPL), Release ${MYSQL_VERSION_EXTRA#-}" + COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}" +else + COMMENT="Percona Server (GPL), Release ${MYSQL_VERSION_EXTRA#-}" + COMMENT="$COMMENT, Revision $REVISION${BUILD_COMMENT:-}" +fi # Compilation flags export CC=${CC:-gcc} @@ -214,9 +230,8 @@ if [ -n "$(command -v rpm)" ]; then if test "x$CMAKE_BUILD_TYPE" = "xDebug" then COMMON_FLAGS=`echo " ${COMMON_FLAGS} " | \ - sed -e 's/-Wall/-Wall -Wno-error=stringop-overflow -Wno-error=restrict -Wno-error=maybe-uninitialized -Wno-error=array-bounds -Wno-error=alloc-size-larger-than= -Wno-error=stringop-truncation/' \ - # sed -e 's/ -O[0-9]* / /' \ - -e 's/-Wp,-D_FORTIFY_SOURCE=2//' \ + sed -e 's/ -O[0-9]* / /' \ + -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ -e 's/ -unroll2 / /' \ -e 's/ -ip / /' \ -e 's/^ //' \ @@ -302,8 +317,11 @@ fi ) ( - - LIBLIST="libaio.so.1 libnuma.so.1 libgssapi.so libldap_r-2.4.so.2 libldap.so.2 liblber-2.4.so.2 liblber.so.2 libtinfo.so libsasl2.so libbrotlidec.so libbrotlicommon.so librtmp.so libgssapi_krb5.so libkrb5.so libk5crypto.so libsmime3.so libnss3.so libssl3.so libnssutil3.so libplc4.so libnspr4.so libplds4.so libncurses.so.5 libtinfo.so.5 component_encryption_udf.so component_uuid_vx_udf.so component_keyring_kms.so component_masking_functions.so" +if [ x"${FIPSMODE}" == x1 ]; then + LIBLIST="libgssapi.so libldap_r-2.4.so.2 libldap.so.2 liblber-2.4.so.2 liblber.so.2 libreadline.so libtinfo.so libbrotlidec.so libbrotlicommon.so librtmp.so libgssapi_krb5.so libkrb5.so libssl3.so libsmime3.so libnss3.so libnssutil3.so libplc4.so libnspr4.so libplds4.so libncurses.so.5 libtinfo.so.5 component_encryption_udf.so component_keyring_kms.so component_masking_functions.so" +else + LIBLIST="libgssapi.so libldap_r-2.4.so.2 libldap.so.2 liblber-2.4.so.2 liblber.so.2 libcrypto.so libssl.so libreadline.so libtinfo.so libsasl2.so libbrotlidec.so libbrotlicommon.so librtmp.so libgssapi_krb5.so libkrb5.so libk5crypto.so libssl3.so libsmime3.so libnss3.so libnssutil3.so libplc4.so libnspr4.so libssl3.so libplds4.so libncurses.so.5 libtinfo.so.5 component_encryption_udf.so component_keyring_kms.so component_masking_functions.so" +fi DIRLIST="bin lib lib/private lib/plugin lib/mysqlrouter/plugin lib/mysqlrouter/private" LIBPATH="" diff --git a/build-ps/debian/compat b/build-ps/debian/compat index ec635144f600..f599e28b8ab0 100644 --- a/build-ps/debian/compat +++ b/build-ps/debian/compat @@ -1 +1 @@ -9 +10 diff --git a/build-ps/debian/percona-server-server.install b/build-ps/debian/percona-server-server.install index f39f0e4de4cf..f79596af5d72 100644 --- a/build-ps/debian/percona-server-server.install +++ b/build-ps/debian/percona-server-server.install @@ -145,7 +145,6 @@ usr/lib/mysql/plugin/mysql_no_login.so usr/lib/mysql/plugin/rewriter.so usr/lib/mysql/plugin/semisync_master.so usr/lib/mysql/plugin/semisync_slave.so -usr/lib/mysql/plugin/test_security_context.so usr/lib/mysql/plugin/validate_password.so usr/lib/mysql/plugin/version_token.so usr/lib/mysql/plugin/connection_control.so @@ -177,7 +176,6 @@ usr/lib/mysql/plugin/debug/mysql_no_login.so usr/lib/mysql/plugin/debug/rewriter.so usr/lib/mysql/plugin/debug/semisync_master.so usr/lib/mysql/plugin/debug/semisync_slave.so -usr/lib/mysql/plugin/debug/test_security_context.so usr/lib/mysql/plugin/debug/validate_password.so usr/lib/mysql/plugin/debug/version_token.so usr/lib/mysql/plugin/debug/keyring_udf.so diff --git a/build-ps/debian/rules b/build-ps/debian/rules index f5aa228e580f..9187142f1912 100755 --- a/build-ps/debian/rules +++ b/build-ps/debian/rules @@ -7,12 +7,18 @@ export DH_VERBOSE=1 export CFLAGS= export CXXFLAGS= export CPPFLAGS= +export FIPSMODE=0 PACKAGE=percona-server PS_VERSION_EXTRA = '@@PERCONA_VERSION_EXTRA@@' REVISION = '@@REVISION@@' -COMPILATION_COMMENT_RELEASE = "Percona Server (GPL), Release $(PS_VERSION_EXTRA), Revision $(REVISION)" -COMPILATION_COMMENT_DEBUG = "Percona Server - Debug (GPL), Release $(PS_VERSION_EXTRA), Revision $(REVISION)" +ifeq ($(FIPSMODE),1) + COMPILATION_COMMENT_RELEASE = "Percona Server Pro (GPL), Release $(PS_VERSION_EXTRA), Revision $(REVISION)" + COMPILATION_COMMENT_DEBUG = "Percona Server Pro - Debug (GPL), Release $(PS_VERSION_EXTRA), Revision $(REVISION)" +else + COMPILATION_COMMENT_RELEASE = "Percona Server (GPL), Release $(PS_VERSION_EXTRA), Revision $(REVISION)"$ + COMPILATION_COMMENT_DEBUG = "Percona Server - Debug (GPL), Release $(PS_VERSION_EXTRA), Revision $(REVISION)"$ +endif TOKUDB_BACKUP_VERSION = "@@TOKUDB_BACKUP_VERSION@@" TMP=$(CURDIR)/debian/tmp/ diff --git a/build-ps/percona-server-8.0_builder.sh b/build-ps/percona-server-8.0_builder.sh index 4333a6870a3f..c68c08026712 100644 --- a/build-ps/percona-server-8.0_builder.sh +++ b/build-ps/percona-server-8.0_builder.sh @@ -27,6 +27,7 @@ Usage: $0 [OPTIONS] --rpm_release RPM version( default = 1) --deb_release DEB version( default = 1) --debug Build debug tarball + --enable_fipsmode Build gated PS --help) usage ;; Example $0 --builddir=/tmp/PS57 --get_sources=1 --build_src_rpm=1 --build_rpm=1 EOF @@ -68,6 +69,7 @@ parse_arguments() { --rpm_release=*) RPM_RELEASE="$val" ;; --deb_release=*) DEB_RELEASE="$val" ;; --debug=*) DEBUG="$val" ;; + --enable_fipsmode=*) FIPSMODE="$val" ;; --help) usage ;; *) if test -n "$pick_args" @@ -613,6 +615,33 @@ build_srpm(){ sed -i "/^%changelog/a - Release ${VERSION}-${RELEASE}" percona-server.spec sed -i "/^%changelog/a * $(date "+%a") $(date "+%b") $(date "+%d") $(date "+%Y") Percona Development Team - ${VERSION}-${RELEASE}" percona-server.spec # + if [[ "x${FIPSMODE}" == "x1" ]]; then + sed -i -e "s:percona-server-server$:percona-server-server-pro:g" \ + -e "s:percona-server-server =:percona-server-server-pro =:g" \ + -e "s:percona-server-client$:percona-server-client-pro:g" \ + -e "s:percona-server-client =:percona-server-client-pro =:g" \ + -e "s:percona-server-devel$:percona-server-devel-pro:g" \ + -e "s:percona-mysql-router$:percona-mysql-router-pro:g" \ + -e "s:percona-mysql-router :percona-mysql-router-pro :g" \ + -e "s:percona-mysql-router-devel$:percona-mysql-router-devel-pro:g" \ + -e "s:percona-mysql-router-devel =:percona-mysql-router-devel-pro =:g" \ + -e "s:percona-server-rocksdb$:percona-server-rocksdb-pro:g" \ + -e "s:percona-server-test$:percona-server-test-pro:g" \ + -e "s:percona-server-shared$:percona-server-shared-pro:g" \ + -e "s:percona-server-shared :percona-server-shared-pro :g" \ + -e "s:Conflicts\: percona-server-server-pro:Conflicts\: percona-server-server:g" \ + -e "s:Conflicts\: percona-server-client-pro:Conflicts\: percona-server-client:g" \ + -e "s:Conflicts\: percona-server-test-pro:Conflicts\: percona-server-test:g" \ + -e "s:Conflicts\: percona-server-devel-pro:Conflicts\: percona-server-devel:g" \ + -e "s:Conflicts\: percona-server-rocksdb-pro:Conflicts\: percona-server-rocksdb:g" \ + -e "s:Conflicts\: percona-mysql-router-pro:Conflicts\: percona-mysql-router:g" \ + -e "s:Conflicts\: percona-mysql-router-devel-pro:Conflicts\: percona-mysql-router-devel:g" \ + -e "s:Conflicts\: percona-server-test-pro:Conflicts\: percona-server-test:g" \ + -e "s:Conflicts\: percona-server-shared-pro:Conflicts\: percona-server-shared:g" \ + -e "s:Name\: percona-server:Name\: percona-server-pro:g" \ + percona-server.spec + fi + # cd ${WORKDIR}/rpmbuild/SOURCES wget https://raw.githubusercontent.com/Percona-Lab/telemetry-agent/phase-0/call-home.sh tar vxzf ${WORKDIR}/${TARFILE} --wildcards '*/build-ps/rpm/*.patch' --strip=3 @@ -764,9 +793,17 @@ build_rpm(){ source /opt/rh/devtoolset-11/enable fi if [ ${ARCH} = x86_64 ]; then - rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM} + if [[ "x${FIPSMODE}" == "x1" ]]; then + rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --define "enable_fipsmode 1" --rebuild rpmbuild/SRPMS/${SRCRPM} + else + rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM} + fi else - rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM} + if [[ "x${FIPSMODE}" == "x1" ]]; then + rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --define "enable_fipsmode 1" --rebuild rpmbuild/SRPMS/${SRCRPM} + else + rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM} + fi fi if [ $RHEL = 6 ]; then @@ -809,13 +846,79 @@ build_source_deb(){ TMPREL=$(echo ${TARFILE}| awk -F '-' '{print $4}') RELEASE=${TMPREL%.tar.gz} - NEWTAR=percona-server_${VERSION}-${RELEASE}.orig.tar.gz + if [[ "x${FIPSMODE}" == "x1" ]]; then + NEWTAR=percona-server-pro_${VERSION}-${RELEASE}.orig.tar.gz + else + NEWTAR=percona-server_${VERSION}-${RELEASE}.orig.tar.gz + fi mv ${TARFILE} ${NEWTAR} tar xzf ${NEWTAR} ls -la cd percona-server-${VERSION}-${RELEASE} cp -ap build-ps/debian/ . + if [ x"${FIPSMODE}" == x1 ]; then + sed -i "s:FIPSMODE=0:FIPSMODE=1:g" debian/rules + sed -i "s:percona-server-server:percona-server-server-pro:g" debian/rules + sed -i "s:percona-server-dbg:percona-server-pro-dbg:g" debian/rules + sed -i "s:percona-server:percona-server-pro:g" debian/changelog + sed -i "s:Source\: percona-server:Source\: percona-server-pro:g" debian/control + sed -i "s:percona-server-rocksdb-pro:percona-server-rocksdb:g" debian/control + sed -i "s:Package\: percona-server-rocksdb:Package\: percona-server-rocksdb-pro:g" debian/control + sed -i "s:Depends\: percona-server-common:Depends\: percona-server-pro-common:g" debian/control + sed -i "s:Package\: percona-server-common:Package\: percona-server-pro-common:g" debian/control + sed -i "s:, percona-server-pro-common:, percona-server-common:g" debian/control + sed -i "s:Conflicts\: percona-server-pro-common:Conflicts\: percona-server-common:g" debian/control + sed -i "s:percona-server-client-pro:percona-server-client:g" debian/control + sed -i "s:Package\: percona-server-client:Package\: percona-server-client-pro:g" debian/control + sed -i "s:percona-server-client (=:percona-server-client-pro (=:g" debian/control + sed -i "s:percona-server-server-pro:percona-server-server:g" debian/control + sed -i "s:Package\: percona-server-server:Package\: percona-server-server-pro:g" debian/control + sed -i "s:percona-server-server (=:percona-server-server-pro (=:g" debian/control + sed -i "s:percona-server-test-pro:percona-server-test:g" debian/control + sed -i "s:Package\: percona-server-test:Package\: percona-server-test-pro:g" debian/control + sed -i "s:Package\: percona-server-source:Package\: percona-server-pro-source:g" debian/control + sed -i "s:percona-server-pro-dbg:percona-server-dbg:g" debian/control + sed -i "s:Package\: percona-server-dbg:Package\: percona-server-pro-dbg:g" debian/control + sed -i "s:percona-mysql-router-pro:percona-mysql-router:g" debian/control + sed -i "s:Package\: percona-mysql-router:Package\: percona-mysql-router-pro:g" debian/control + cp debian/percona-mysql-router.init debian/percona-mysql-router-pro.init + cp debian/percona-mysql-router.install debian/percona-mysql-router-pro.install + cp debian/percona-mysql-router.mysqlrouter.init debian/percona-mysql-router-pro.mysqlrouter.init + cp debian/percona-mysql-router.mysqlrouter.service debian/percona-mysql-router-pro.mysqlrouter.service + cp debian/percona-mysql-router.mysqlrouter.tmpfile debian/percona-mysql-router-pro.mysqlrouter.tmpfile + cp debian/percona-mysql-router.postinst debian/percona-mysql-router-pro.postinst + cp debian/percona-mysql-router.postrm debian/percona-mysql-router-pro.postrm + cp debian/percona-mysql-router.preinst debian/percona-mysql-router-pro.preinst + cp debian/percona-mysql-router.prerm debian/percona-mysql-router-pro.prerm + cp debian/percona-server-client.install debian/percona-server-client-pro.install + cp debian/percona-server-client.links debian/percona-server-client-pro.links + cp debian/percona-server-client.lintian-overrides debian/percona-server-client-pro.lintian-overrides + cp debian/percona-server-common.install debian/percona-server-pro-common.install + cp debian/percona-server-common.postinst debian/percona-server-pro-common.postinst + cp debian/percona-server-common.postrm debian/percona-server-pro-common.postrm + cp debian/percona-server-rocksdb.install debian/percona-server-rocksdb-pro.install + cp debian/percona-server-rocksdb.postinst debian/percona-server-rocksdb-pro.postinst + cp debian/percona-server-server.config debian/percona-server-server-pro.config + cp debian/percona-server-server.dirs debian/percona-server-server-pro.dirs + cp debian/percona-server-server.docs debian/percona-server-server-pro.docs + cp debian/percona-server-server.install debian/percona-server-server-pro.install + cp debian/percona-server-server.lintian-overrides debian/percona-server-server-pro.lintian-overrides + cp debian/percona-server-server.mysql.init debian/percona-server-server-pro.mysql.init + cp debian/percona-server-server.mysql.service debian/percona-server-server-pro.mysql.service + cp debian/percona-server-server.mysql.tmpfile debian/percona-server-server-pro.mysql.tmpfile + cp debian/percona-server-server.mysql@.service debian/percona-server-server-pro.mysql@.service + cp debian/percona-server-server.postinst debian/percona-server-server-pro.postinst + cp debian/percona-server-server.postrm debian/percona-server-server-pro.postrm + cp debian/percona-server-server.preinst debian/percona-server-server-pro.preinst + cp debian/percona-server-server.prerm debian/percona-server-server-pro.prerm + cp debian/percona-server-server.templates debian/percona-server-server-pro.templates + cp debian/percona-server-source.install debian/percona-server-pro-source.install + cp debian/percona-server-test.dirs debian/percona-server-test-pro.dirs + cp debian/percona-server-test.install debian/percona-server-test-pro.install + cp debian/percona-server-test.links debian/percona-server-test-pro.links + sed -i "s:percona-server_:percona-server-pro_:g" debian/percona-server-pro-source.install + fi dch -D unstable --force-distribution -v "${VERSION}-${RELEASE}-${DEB_RELEASE}" "Update to new upstream release Percona Server ${VERSION}-${RELEASE}-1" copyright-update -d debian/copyright dpkg-buildpackage -S @@ -858,6 +961,10 @@ build_deb(){ DIRNAME=$(echo ${DSC%-${DEB_RELEASE}.dsc} | sed -e 's:_:-:g') VERSION=$(echo ${DSC} | sed -e 's:_:-:g' | awk -F'-' '{print $3}') RELEASE=$(echo ${DSC} | sed -e 's:_:-:g' | awk -F'-' '{print $4}') + if [[ "x${FIPSMODE}" == "x1" ]]; then + VERSION=$(echo ${DSC} | sed -e 's:_:-:g' | awk -F'-' '{print $4}') + RELEASE=$(echo ${DSC} | sed -e 's:_:-:g' | awk -F'-' '{print $5}') + fi ARCH=$(uname -m) export EXTRAVER=${MYSQL_VERSION_EXTRA#-} # @@ -871,17 +978,21 @@ build_deb(){ cd ${DIRNAME} dch -b -m -D "$DEBIAN_VERSION" --force-distribution -v "${VERSION}-${RELEASE}-${DEB_RELEASE}.${DEBIAN_VERSION}" '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-server-server.postinst - echo "cat <<'CALLHOME' > /tmp/call-home.sh" >> percona-server-server.postinst - cat call-home.sh >> percona-server-server.postinst - echo "CALLHOME" >> percona-server-server.postinst - echo "bash +x /tmp/call-home.sh -f \"PRODUCT_FAMILY_PS\" -v \"${VERSION}-${RELEASE}-${DEB_RELEASE}\" -d \"PACKAGE\" &>/dev/null || :" >> percona-server-server.postinst + sed -i 's:exit 0::' percona-server-server"${postfix}".postinst + echo "cat <<'CALLHOME' > /tmp/call-home.sh" >> percona-server-server"${postfix}".postinst + cat call-home.sh >> percona-server-server"${postfix}".postinst + echo "CALLHOME" >> percona-server-server"${postfix}".postinst + echo "bash +x /tmp/call-home.sh -f \"PRODUCT_FAMILY_PS\" -v \"${VERSION}-${RELEASE}-${DEB_RELEASE}\" -d \"PACKAGE\" &>/dev/null || :" >> percona-server-server"${postfix}".postinst echo "chgrp percona-telemetry /usr/local/percona/telemetry_uuid &>/dev/null || :" >> percona-server-server"${postfix}".postinst echo "chmod 664 /usr/local/percona/telemetry_uuid &>/dev/null || :" >> percona-server-server"${postfix}".postinst - echo "rm -rf /tmp/call-home.sh" >> percona-server-server.postinst - echo "exit 0" >> percona-server-server.postinst + echo "rm -rf /tmp/call-home.sh" >> percona-server-server"${postfix}".postinst + echo "exit 0" >> percona-server-server"${postfix}".postinst rm -f call-home.sh cd ../ @@ -982,16 +1093,20 @@ build_tarball(){ cp -av /usr/include/openssl ${WORKDIR}/ssl/include/ fi + if [[ "x${FIPSMODE}" == "x1" ]]; then + BUILD_PARAMETER="--enable-fipsmode " + fi + cd ${TARFILE%.tar.gz} if [ "x$WITH_SSL" = "x1" ]; then CMAKE_OPTS="-DMINIMAL_RELWITHDEBINFO=OFF -DWITH_ROCKSDB=1 -DINSTALL_LAYOUT=STANDALONE -DWITH_SSL=$PWD/../ssl/ " bash -xe ./build-ps/build-binary.sh --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET DIRNAME="yassl" else if [[ "${DEBUG}" == 1 ]]; then - CMAKE_OPTS="-DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --debug --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET + CMAKE_OPTS="-DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --debug ${BUILD_PARAMETER}--with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET DIRNAME="tarball" else - CMAKE_OPTS="-DMINIMAL_RELWITHDEBINFO=OFF -DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET + CMAKE_OPTS="-DMINIMAL_RELWITHDEBINFO=OFF -DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh ${BUILD_PARAMETER}--with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET DIRNAME="tarball" fi fi diff --git a/build-ps/percona-server.spec b/build-ps/percona-server.spec index 73ab6563ada5..2c3ac448b833 100644 --- a/build-ps/percona-server.spec +++ b/build-ps/percona-server.spec @@ -28,6 +28,9 @@ %global percona_server_vendor Percona, Inc %global mysqldatadir /var/lib/mysql +# By default a build will be done in normal mode +%{?enable_fipsmode: %global enable_fipsmode 1} + %global mysql_version @@MYSQL_VERSION@@ %global percona_server_version @@PERCONA_VERSION@@ %global revision @@REVISION@@ @@ -66,8 +69,13 @@ %{!?with_debuginfo: %global nodebuginfo 0} %{!?product_suffix: %global product_suffix -80} %{!?feature_set: %global feature_set community} +%if 0%{?enable_fipsmode} +%{!?compilation_comment_release: %global compilation_comment_release Percona Server Pro (GPL), Release %{percona_server_version}, Revision %{revision}} +%{!?compilation_comment_debug: %global compilation_comment_debug Percona Server Pro - Debug (GPL), Release %{percona_server_version}, Revision %{revision}} +%else %{!?compilation_comment_release: %global compilation_comment_release Percona Server (GPL), Release %{percona_server_version}, Revision %{revision}} %{!?compilation_comment_debug: %global compilation_comment_debug Percona Server - Debug (GPL), Release %{percona_server_version}, Revision %{revision}} +%endif$ %{!?src_base: %global src_base percona-server} # Setup cmake flags for TokuDB @@ -268,6 +276,7 @@ Provides: MySQL-server%{?_isa} = %{version}-%{release} Provides: mysql-server = %{version}-%{release} Provides: mysql-server%{?_isa} = %{version}-%{release} Conflicts: Percona-SQL-server-50 Percona-Server-server-51 Percona-Server-server-55 Percona-Server-server-56 Percona-Server-server-57 +Conflicts: percona-server-server-pro %if 0%{?systemd} Requires(post): systemd @@ -309,6 +318,7 @@ Group: Applications/Databases Requires: percona-server-shared Provides: mysql-client MySQL-client mysql MySQL Conflicts: Percona-SQL-client-50 Percona-Server-client-51 Percona-Server-client-55 Percona-Server-client-56 Percona-Server-client-57 +Conflicts: percona-server-client-pro %description -n percona-server-client This package contains the standard Percona Server client and administration tools. @@ -353,6 +363,7 @@ Obsoletes: mariadb-test Provides: mysql-test = %{version}-%{release} Provides: mysql-test%{?_isa} = %{version}-%{release} Conflicts: Percona-SQL-test-50 Percona-Server-test-51 Percona-Server-test-55 Percona-Server-test-56 Percona-Server-test-57 +Conflicts: percona-server-test-pro %description -n percona-server-test This package contains the Percona Server regression test suite. @@ -368,6 +379,7 @@ Obsoletes: mysql-connector-c-devel < 6.2 Provides: mysql-devel = %{version}-%{release} Provides: mysql-devel%{?_isa} = %{version}-%{release} Conflicts: Percona-SQL-devel-50 Percona-Server-devel-51 Percona-Server-devel-55 Percona-Server-devel-56 Percona-Server-devel-57 +Conflicts: percona-server-devel-pro Obsoletes: mariadb-connector-c-devel %if 0%{?rhel} > 6 Obsoletes: mariadb-devel @@ -387,6 +399,7 @@ Provides: mysql-libs%{?_isa} = %{version}-%{release} Obsoletes: mariadb-libs Obsoletes: mysql-connector-c-shared < 6.2 Obsoletes: mysql-libs < %{version}-%{release} +Conflicts: percona-server-shared-pro Provides: mysql-shared %ifarch x86_64 %if 0%{?rhel} < 9 @@ -449,6 +462,7 @@ Group: Applications/Databases Requires: percona-server-server = %{version}-%{release} Requires: percona-server-shared = %{version}-%{release} Requires: percona-server-client = %{version}-%{release} +Conflicts: percona-server-rocksdb-pro %description -n percona-server-rocksdb This package contains the RocksDB plugin for Percona Server %{version}-%{release} @@ -460,6 +474,7 @@ Group: Applications/Databases Provides: percona-mysql-router = %{version}-%{release} Obsoletes: percona-mysql-router < %{version}-%{release} Provides: mysql-router +Conflicts: percona-mysql-router-pro %description -n percona-mysql-router The Percona MySQL Router software delivers a fast, multi-threaded way of @@ -470,6 +485,7 @@ Summary: Development header files and libraries for Percona MySQL Router Group: Applications/Databases Provides: percona-mysql-router-devel = %{version}-%{release} Obsoletes: mysql-router-devel +Conflicts: percona-mysql-router-devel-pro %description -n percona-mysql-router-devel This package contains the development header files and libraries @@ -840,6 +856,17 @@ if [ ! -d %{_datadir}/mysql ] && [ ! -L %{_datadir}/mysql ]; then ln -s %{_datadir}/percona-server %{_datadir}/mysql fi +%if 0%{?rhel} >= 9 +if [ -f /usr/lib/systemd/system/mysqld.service ]; then + if [ ! -e /etc/systemd/system/mysql.service ] && [ -d /etc/systemd/system ]; then + ln -s /usr/lib/systemd/system/mysqld.service /etc/systemd/system/mysql.service + fi + if [ ! -e /etc/systemd/system/multi-user.target.wants/mysqld.service ] && [ -d /etc/systemd/system/multi-user.target.wants ]; then + ln -s /usr/lib/systemd/system/mysqld.service /etc/systemd/system/multi-user.target.wants/mysqld.service + fi +fi +%endif + %post -n percona-server-shared -p /sbin/ldconfig %postun -n percona-server-shared -p /sbin/ldconfig