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

Build fixes #650

Open
wants to merge 5 commits into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ else
CXX=${CXX:-"g++"}
fi

if ccache -V > /dev/null 2>&1
then
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
fi
export CC CXX LD_LIBRARY_PATH

CFLAGS=${CFLAGS:-"-O2"}
Expand Down Expand Up @@ -217,7 +212,7 @@ done
# check whether sudo accepts -E to preserve environment
if [ "$PACKAGE" == "yes" ]
then
if which dpkg >/dev/null 2>&1
if which dpkg-buildpackage >/dev/null 2>&1
then
echo "Error: Package build not supported on Debian, use dpkg-buildpackage"
exit 1
Expand Down Expand Up @@ -313,7 +308,6 @@ build_packages()
else # build RPM
./rpm.sh $GALERA_VER
fi
local RET=$?

set -e

Expand Down Expand Up @@ -385,6 +379,10 @@ fi
if [ "$CMAKE" == "yes" ] # Build using CMake
then
cmake_args="$CMAKE_OPTS -DGALERA_REVISION=$GALERA_REV"
if ccache -V > /dev/null 2>&1
then
cmake_args="$cmake_args -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
fi
[ -n "$TARGET" ] && \
echo "WARN: TARGET=$TARGET ignored by CMake build"
[ -n "$RELEASE" ] && \
Expand Down
7 changes: 0 additions & 7 deletions scripts/packages/galera-obs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ BuildRequires: boost-devel >= 1.41
BuildRequires: check-devel
BuildRequires: glibc-devel
BuildRequires: %{ssl_package_devel}
%if 0%{?rhel} >= 8 || 0%{?centos} >= 8
BuildRequires: python3-scons
%define scons_cmd scons-3
%else
BuildRequires: scons
%define scons_cmd scons
%endif
%if 0%{?suse_version} == 1110
# On SLES11 SPx use the linked gcc47 to build instead of default gcc43
BuildRequires: gcc47 gcc47-c++
Expand Down
40 changes: 31 additions & 9 deletions scripts/packages/rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,46 @@ fast_cflags="-O3 -fno-omit-frame-pointer"
uname -m | grep -q i686 && \
cpu_cflags="-mtune=i686" || cpu_cflags="-mtune=core2"
RPM_OPT_FLAGS="$fast_cflags $cpu_cflags"
GALERA_SPEC=$SCRIPT_ROOT/galera.spec
GALERA_SPEC=$SCRIPT_ROOT/galera-obs.spec

RELEASE=${RELEASE:-"1"}
DISTRO_VERSION=

if [ -r /etc/fedora-release ]
if [ -r /etc/os-release ]
then
DISTRO_VERSION=fc$(rpm -qf --qf '%{version}\n' /etc/fedora-release)
elif [ -r /etc/redhat-release ]
then
DISTRO_VERSION=rhel$(rpm -qf --qf '%{version}\n' /etc/redhat-release)
source /etc/os-release
elif [ -r /etc/SuSE-release ]
then
DISTRO_VERSION=sles$(rpm -qf --qf '%{version}\n' /etc/SuSE-release | cut -d. -f1)
else
DISTRO_VERSION=
fi

[ -n "$DISTRO_VERSION" ] && RELEASE=$RELEASE.$DISTRO_VERSION
DIST_TAG=
# %dist does not return a value for sles12
# https://bugs.centos.org/view.php?id=3239
if [ "${DISTRO_VERSION}" = "sles12" ]
then
DIST_TAG=".sles12"
fi

if [ "${DISTRO_VERSION}" = "sles42" ]
then
DIST_TAG=".sles42"
fi

if [ -z "$DIST_TAG" ]
then
DIST_TAG=$(rpm --eval "%{dist}")
if [ "$DIST_TAG" = "%{dist}" ]
then
DIST_TAG=
fi
fi

# from /etc/os-release
if [ -z "$DIST_TAG" ]
then
DIST_TAG=".${ID}${VERSION_ID%%.*}"
fi

$(which rpmbuild) --clean --define "_topdir $RPM_TOP_DIR" \
--define "optflags $RPM_OPT_FLAGS" \
Expand Down