0

I've been trying to compile GDAL 3.2 on CentOS 8 (due to a java project requiring gdal bindings that should be provided by gdal32-java), however rpmbuild fails right at the start before I make any change:

$ rpmbuild --rebuild ../gdal32-3.2.3-1.rhel8.src.rpm
Installing ../gdal32-3.2.3-1.rhel8.src.rpm
error: line 23: Unknown tag: %pgdg_set_gis_variables

Note that the source RPM is from the pgdg-source-common repository provided by postgres at https://download.postgresql.org/pub/repos/yum/srpms/common/redhat/rhel-8-x86_64. All dependencies required by the spec file are installed.

The tag %pgdg_set_gis_variables in gdal32.spec appears only once (at the line where an error is reported) and seems to initialize some global variables used to retrieve other files/resolve dependencies.

By unpacking the file into SOURCES and commenting-out this tag - as well as manually setting the expected values that I see unused, I could get rpmbuild -ba SOURCES/gdal32.spec, however it fails at configure, presumably due to missing values that should have been set by %pgdg_set_gis_variables (+ In this case, I get an error that shows that there is an attempt to expand the tag despite its being commented-out).

Do you know where I could find a sample that provides this tag/How I could build this RPM ?

cg_foreau
  • 113
  • 7

1 Answers1

1

You need to install the package pgdg-srpm-macros from the PGDG repository to provide their custom RPM macros.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thank you. Since posting the question, I did get the spec file to work by installing several postgres rpms but I could not figure out why it made it work. I will try this to minimize the dependencies and install this package in a few days when i can get back this problem. – cg_foreau Aug 12 '21 at 08:11