diff --git a/.github/workflows/test_rpm.yml b/.github/workflows/test_rpm.yml new file mode 100644 index 00000000000..6eb52feaf4f --- /dev/null +++ b/.github/workflows/test_rpm.yml @@ -0,0 +1,34 @@ +name: BabelfishDump RPM Test +on: [push, pull_request] + +jobs: + build-rpm: + name: Build BabelfishDump RPM + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + id: checkout + + - name: Install Dependencies + id: install-dependencies + if: always() + run: | + sudo apt clean && sudo apt-get update --fix-missing -y + sudo apt-get install alien libossp-uuid-dev uuid-dev zlib1g-dev liblz4-dev libicu-dev libxml2-dev openssl libssl-dev libpq-dev pkg-config bison flex libkrb5-dev libpam-dev libreadline-dev + + - name: Run RPM command + id: run-rpm-command + if: always() && steps.install-dependencies.outcome == 'success' + run: | + make rpm + + - name: Install RPM + id: install-rpm + if: always() && steps.run-rpm-command.outcome == 'success' + run: | + cd build + # Install RPM package + sudo alien -i BabelfishDump-* + # Verify that utilites installed correctly + bbf_dumpall -V + bbf_dump -V diff --git a/BabelfishDump.spec b/BabelfishDump.spec index 773d21c39cf..78702761822 100644 --- a/BabelfishDump.spec +++ b/BabelfishDump.spec @@ -1,5 +1,7 @@ # This spec file and ancillary files are licensed in accordance with # The PostgreSQL license. +# This spec file bundles the Babelfish dump utilities (bbf_dump/bbf_dumpall) +# into an RPM. # In this file you can find the default build package list macros. # These can be overridden by defining on the rpm command line: diff --git a/Makefile b/Makefile index ac4b4bebe37..4df0d2767b3 100644 --- a/Makefile +++ b/Makefile @@ -46,10 +46,13 @@ all check install installdirs installcheck installcheck-parallel uninstall clean false; \ fi +# Targets in the portion below can be used to generate source tarball +# and RPM containing Babelfish dump utilities (bbf_dump/bbf_dumpall). PACKAGE_NAME = BabelfishDump SOURCE_TARBALL = $(PACKAGE_NAME).tar.gz SPECFILE = $(PACKAGE_NAME).spec BUILD_DIR = build/rpmbuild +DIRS = 'SPECS' 'COORD_SOURCES' 'DATA_SOURCES' 'BUILD' 'RPMS' 'SOURCES' 'SRPMS' .PHONY: rpm-clean rpm-clean: @@ -72,12 +75,18 @@ tarball: rpm-clean .PHONY: sources sources: tarball +ifdef NODEPS +RPMOPT = -ba -v --nodeps +else +RPMOPT = -ba -v +endif + .PHONY: rpm-only rpm-only: - mkdir -p $(BUILD_DIR)/{SPECS,COORD_SOURCES,DATA_SOURCES,BUILD,RPMS,SOURCES,SRPMS} + mkdir -p $(addprefix $(BUILD_DIR)/,$(DIRS)) cp $(SPECFILE) $(BUILD_DIR)/SPECS cp $(SOURCE_TARBALL) $(BUILD_DIR)/SOURCES - rpmbuild -ba --define "_topdir `pwd`/$(BUILD_DIR)" $(BUILD_DIR)/SPECS/$(SPECFILE) + rpmbuild $(RPMOPT) --define "_topdir `pwd`/$(BUILD_DIR)" $(BUILD_DIR)/SPECS/$(SPECFILE) cp $(BUILD_DIR)/RPMS/*/*rpm build .PHONY: rpm