Skip to content
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
25 changes: 17 additions & 8 deletions bigtop-deploy/puppet/modules/gpdb/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,23 @@
# doesn't seem to provide it as a standard package. So we use get-pip.py
# (https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py)
# here to install it on all distros.
exec { 'download_get_pip':
cwd => '/tmp',
command => '/usr/bin/curl -sLO https://bootstrap.pypa.io/pip/2.7/get-pip.py'
}
exec { 'install_pip':
cwd => '/tmp',
command => '/usr/bin/python2 get-pip.py',
require => [Exec["download_get_pip"], Package["gpdb"]],
if ($operatingsystem == 'openEuler') {
exec { 'install_python_packages':
command => "/usr/bin/env pip install -q lockfile paramiko psutil",
timeout => 600,
}
package { ["gpdb"]:
ensure => latest,
}
} else {
exec { 'download_get_pip':
cwd => '/tmp',
command => '/usr/bin/curl -sLO https://bootstrap.pypa.io/pip/2.7/get-pip.py'
}
exec { 'install_pip':
cwd => '/tmp',
command => '/usr/bin/python2 get-pip.py',
require => [Exec["download_get_pip"], Package["gpdb"]],
}
# GPDB requires the following python packages as of v5.28.5. See
# https://github.com/greenplum-db/gpdb/tree/5X_STABLE#building-greenplum-database-with-gporca.
Expand Down
24 changes: 24 additions & 0 deletions bigtop-packages/src/rpm/gpdb/SPECS/gpdb.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,41 @@ Source2: install_gpdb.sh
Source3: do-component-configure
#BIGTOP_PATCH_FILES
AutoReqProv: %{autorequire}
%if 0%{?openEuler}
Requires: bigtop-utils >= 0.7, gcc, libffi-devel, make, openssl-devel, python3-devel
%else
Requires: bigtop-utils >= 0.7, gcc, libffi-devel, make, openssl-devel, python2-devel
%endif

%description
gpdb

%prep
%if 0%{?openEuler}
sed -i "s/python2/python3/g" $RPM_SOURCE_DIR/patch1-specify-python-version.diff
sed -i "s/python3.7/python2.7/g" $RPM_SOURCE_DIR/patch1-specify-python-version.diff
%endif

%setup -n %{name}-%{gpdb_base_version}

#BIGTOP_PATCH_COMMANDS

%build
%if 0%{?openEuler}
rm gpMgmt/bin/pythonSrc/PyGreSQL-4.0 -rf
cd gpMgmt/bin/pythonSrc/
wget https://github.com/PyGreSQL/PyGreSQL/archive/refs/tags/5.1.2.tar.gz --no-check-certificate
tar -xf 5.1.2.tar.gz
rm -rf 5.1.2.tar.gz
cd ../../../
pip install 2to3
python3 %{_bindir}/2to3 -w .
for i in `find . -name "*.bak"`;do rm -rf $i ;done
sed -i 's|PYGRESQL_VERSION=4.0|PYGRESQL_VERSION=5.1.2|g' gpMgmt/bin/Makefile
sed -i '191 c PYTHON_VERSION=$(shell python3 -c "import sys; print ('%s.%s' % (sys.version_info[0:2])"))' gpMgmt/bin/Makefile
sed -i "91 c inc_dirs = [os.path.join(pkginc.decode(encoding='UTF-8'), 'server'), os.path.join(pkginc.decode(encoding='UTF-8'), 'internal')]" src/test/regress/checkinc.py
sed -i 's|if os.path.exists(os.path.join(inc,i)):|if os.path.exists(os.path.join(inc.decode(encoding="UTF-8"),i)):|g' src/test/regress/checkinc.py
%endif
bash %{SOURCE3} %{bin_gpdb}
bash %{SOURCE1}

Expand Down