Skip to content
Merged
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
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export PXF_VERSION

export SKIP_EXTERNAL_TABLE_BUILD_REASON
export SKIP_FDW_BUILD_REASON
export SKIP_EXTERNAL_TABLE_PACKAGE_REASON
export SKIP_FDW_PACKAGE_REASON

SOURCE_EXTENSION_DIR = external-table
TARGET_EXTENSION_DIR = gpextable
Expand Down Expand Up @@ -65,7 +67,7 @@ it:

install:
ifneq ($(SKIP_EXTERNAL_TABLE_BUILD_REASON),)
@echo "Skipping installing FDW extension because $(SKIP_EXTERNAL_TABLE_BUILD_REASON)"
@echo "Skipping installing external-table extension because $(SKIP_EXTERNAL_TABLE_BUILD_REASON)"
$(eval PXF_MODULES := $(filter-out external-table,$(PXF_MODULES)))
endif
ifneq ($(SKIP_FDW_BUILD_REASON),)
Expand All @@ -85,10 +87,15 @@ install-server:
stage:
rm -rf build/stage
make -C $(SOURCE_EXTENSION_DIR) stage
ifeq ($(SKIP_FDW_PACKAGE_REASON),)
make -C fdw stage
else
@echo "Skipping staging FDW extension because $(SKIP_FDW_PACKAGE_REASON)"
endif
make -C cli stage
make -C server stage
ifneq ($(SKIP_EXTERNAL_TABLE_PACKAGE_REASON),)
@echo "Skipping staging FDW extension because $(SKIP_EXTERNAL_TABLE_PACKAGE_REASON)"
@echo "Skipping staging external-table extension because $(SKIP_EXTERNAL_TABLE_PACKAGE_REASON)"
$(eval PXF_MODULES := $(filter-out external-table,$(PXF_MODULES)))
endif
ifneq ($(SKIP_FDW_PACKAGE_REASON),)
Expand All @@ -101,6 +108,9 @@ endif
PXF_PACKAGE_NAME=pxf-cloudberry$${GP_MAJOR_VERSION}-$${PXF_VERSION}-$${GP_BUILD_ARCH} ;\
mkdir -p build/stage/$${PXF_PACKAGE_NAME} ;\
cp -a $(SOURCE_EXTENSION_DIR)/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
if [[ -z "$${SKIP_FDW_PACKAGE_REASON:-}" ]]; then \
cp -a fdw/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
fi ;\
cp -a cli/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
cp -a server/build/stage/* build/stage/$${PXF_PACKAGE_NAME} ;\
echo $$(git rev-parse --verify HEAD) > build/stage/$${PXF_PACKAGE_NAME}/commit.sha ;\
Expand Down Expand Up @@ -169,6 +179,9 @@ deb: stage
rm -rf build/debbuild ;\
mkdir -p build/debbuild/usr/local/cloudberry-pxf/$(TARGET_EXTENSION_DIR) ;\
cp -a $(SOURCE_EXTENSION_DIR)/build/stage/* build/debbuild/usr/local/cloudberry-pxf/ ;\
if [[ -z "$${SKIP_FDW_PACKAGE_REASON:-}" ]] && [[ -d fdw/build/stage ]]; then \
cp -a fdw/build/stage/* build/debbuild/usr/local/cloudberry-pxf/ ;\
fi ;\
cp -a cli/build/stage/* build/debbuild/usr/local/cloudberry-pxf ;\
cp -a server/build/stage/* build/debbuild/usr/local/cloudberry-pxf ;\
echo $$(git rev-parse --verify HEAD) > build/debbuild/usr/local/cloudberry-pxf/commit.sha ;\
Expand Down
7 changes: 6 additions & 1 deletion package/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/sh

sed -i "s|directory =.*|directory = '/usr/local/cloudberry-pxf/gpextable/'|g" "/usr/local/cloudberry-pxf/gpextable/pxf.control"
sed -i "s|module_pathname =.*|module_pathname = '/usr/local/cloudberry-pxf/gpextable/pxf'|g" "/usr/local/cloudberry-pxf/gpextable/pxf.control"
sed -i "s|module_pathname =.*|module_pathname = '/usr/local/cloudberry-pxf/gpextable/pxf'|g" "/usr/local/cloudberry-pxf/gpextable/pxf.control"

if [ -f "/usr/local/cloudberry-pxf/fdw/pxf_fdw.control" ]; then
sed -i "s|directory =.*|directory = '/usr/local/cloudberry-pxf/fdw/'|g" "/usr/local/cloudberry-pxf/fdw/pxf_fdw.control"
sed -i "s|module_pathname =.*|module_pathname = '/usr/local/cloudberry-pxf/fdw/pxf_fdw'|g" "/usr/local/cloudberry-pxf/fdw/pxf_fdw.control"
fi
2 changes: 1 addition & 1 deletion package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PXF Packaging

Apache Cloudberry PXF (Platform Extension Framework) consists of 3 groups of artifacts, each developed using a different underlying technology:

* Apache Cloudberry extension -- written in C; when built, produces a `pxf.so` library and configuration files
* Apache Cloudberry extensions -- written in C; when built, produces the `pxf` (external table) and `pxf_fdw` (foreign data wrapper) libraries and extension files
* PXF Server -- written in Java; when built, produces a `pxf.war` file, Tomcat server, dependent JAR files, templates and scripts
* Script Cluster Plugin -- written in Go; when built, produces a `pxf-cli` executable

Expand Down
5 changes: 5 additions & 0 deletions package/cloudberry-pxf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ fi
sed -i "s|directory =.*|directory = '${RPM_INSTALL_PREFIX}/gpextable/'|g" "${RPM_INSTALL_PREFIX}/gpextable/pxf.control"
sed -i "s|module_pathname =.*|module_pathname = '${RPM_INSTALL_PREFIX}/gpextable/pxf'|g" "${RPM_INSTALL_PREFIX}/gpextable/pxf.control"

if [ -f "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control" ]; then
sed -i "s|directory =.*|directory = '${RPM_INSTALL_PREFIX}/fdw/'|g" "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control"
sed -i "s|module_pathname =.*|module_pathname = '${RPM_INSTALL_PREFIX}/fdw/pxf_fdw'|g" "${RPM_INSTALL_PREFIX}/fdw/pxf_fdw.control"
fi

# Change ownership to gpadmin.gpadmin if the gpadmin user exists
if id "gpadmin" &>/dev/null; then
chown -R gpadmin:gpadmin ${RPM_INSTALL_PREFIX}
Expand Down
Loading