Skip to content

Commit

Permalink
GITC-4100 Support for el9 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroberts committed Jan 19, 2023
1 parent f2061f7 commit 60ccf9d
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 12 deletions.
12 changes: 8 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ build/gdal/VERSION:
cp mrf_apps/* build/gdal/mrf_apps/

gdal-compile:
( cd build/gdal ; ./configure \
( cd build/gdal ; sed -i 's/HAVE_CAD = yes/HAVE_CAD = no/g' GDALmake.opt.in ; ./configure \
--prefix=$(PREFIX) \
--libdir=$(PREFIX)/$(LIB_DIR) \
--mandir=$(PREFIX)/share/man \
Expand All @@ -67,7 +67,7 @@ gdal-compile:
--without-ogdi \
--with-libz \
--with-geos \
--with-jasper \
--with-jasper=no \
--with-png \
--with-gif \
--with-jpeg \
Expand All @@ -79,8 +79,12 @@ gdal-compile:
--with-gdal-ver=$(GDAL_VERSION) \
--disable-rpath \
--with-expat \
--without-teigha \
--without-cad \
--without-pg \
--with-openjpeg \
)
$(MAKE) -C build/gdal $(SMP_FLAGS) all man
$(MAKE) -C build/gdal $(SMP_FLAGS) man

#-----------------------------------------------------------------------------
# Install
Expand Down Expand Up @@ -146,7 +150,7 @@ mock: gdal-mock

gdal-mock:
mock --clean
mock --root=gibs-epel-7-$(shell arch) \
mock --root=gibs-epel-9-$(shell arch) \
dist/gibs-gdal-$(GDAL_VERSION)-*.src.rpm

#-----------------------------------------------------------------------------
Expand Down
28 changes: 28 additions & 0 deletions bin/build_el9_docker_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

set -e

if ! ls dist/gibs-gdal-*.el9.*.rpm >/dev/null 2>&1; then
echo "No RPMs found in ./dist/" >&2
exit 1
fi

TAG="$1"

mkdir -p docker/el9/rpms
cp dist/gibs-gdal-*.el9.*.rpm docker/el9/rpms/
rm -f docker/el9/rpms/gibs-gdal-*.src.rpm
rm -f docker/el9/rpms/gibs-gdal-*debuginfo-*.rpm

(
set -e
cd docker/el9

if [ -z "$TAG" ]; then
docker build --no-cache .
else
docker build --no-cache -t "$TAG" .
fi
)

rm -rf docker/el9/rpms
46 changes: 46 additions & 0 deletions bin/build_el9_rpms_in_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

set -evx

DOCKER_UID=$(id -u)
DOCKER_GID=$(id -g)
mkdir -p dist
cat > dist/build_rpms.sh <<EOS
#!/bin/sh
set -evx
yum install -y epel-release
dnf install -y 'dnf-command(config-manager)'
dnf config-manager --set-enabled crb
yum install -y \
ccache \
wget \
rpmdevtools \
mock \
rsync
mkdir -p /build
rsync -av --exclude .git /source/ /build/
chown -R root:root /build
(
set -evx
cd /build
dnf builddep -y deploy/gibs-gdal/gibs-gdal.spec
make download gdal-rpm
)
cp /build/dist/gibs-gdal-*.rpm /dist/
EOS
chmod +x dist/build_rpms.sh

docker run \
--rm \
--volume "$(pwd):/source:ro" \
--volume "$(pwd)/dist:/dist" \
rockylinux:9.1 /dist/build_rpms.sh

rm dist/build_rpms.sh
16 changes: 11 additions & 5 deletions deploy/gibs-gdal/gibs-gdal.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%global gdal_version 2.4.4
%global gdal_release 4%{?dist}
%global gdal_release 5%{?dist}

Name: gibs-gdal
Version: %{gdal_version}
Expand All @@ -15,8 +15,8 @@ Source1: http://download.osgeo.org/gdal/%{gdal_version}/gdal-%{gdal_version}.tar
BuildRequires: make
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: python36
BuildRequires: python36-devel
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
Expand All @@ -30,8 +30,11 @@ BuildRequires: doxygen
BuildRequires: expat-devel
BuildRequires: geos-devel
BuildRequires: gcc-c++
BuildRequires: bzip2
BuildRequires: /usr/bin/pathfix.py
BuildRequires: libstdc++-devel
BuildRequires: bzip2
BuildRequires: python3-numpy
BuildRequires: /usr/bin/pathfix.py
BuildRequires: openjpeg2

Requires: proj

Expand Down Expand Up @@ -147,6 +150,9 @@ sed -i 's@\/usr\/libexec\/platform-python -s@\/usr\/bin\/env python3@g' /usr/bin
%postun -p /sbin/ldconfig

%changelog
* Wed Jan 18 2023 Joe T. Roberts <[email protected]> - 2.4.4-5
- Support for el9 builds

* Wed Jul 7 2021 Matthew Cechini <[email protected]> - 2.4.4-4
- Adding install requirement for proj.4
- Updating linking of /usr/lib64/libproj.so
Expand Down
6 changes: 6 additions & 0 deletions docker/el9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM rockylinux:9.1

COPY rpms/gibs-gdal-*.el9.*.rpm /rpms/

RUN yum install -y epel-release && yum clean all
RUN yum install -y /rpms/gibs-gdal-*.el9.*.rpm
6 changes: 3 additions & 3 deletions mrf_apps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
include Makefile.lcl

TARGETS = can mrf_insert
GDAL_INCLUDE = -I $(PREFIX)/include -I $(GDAL_ROOT) -I /build/build/rpmbuild/BUILDROOT/gibs-gdal-2.4.4-4.el8.x86_64/usr/include/ -I /build/build/rpmbuild/BUILD/gibs-gdal-2.4.4/build/gdal/
LIBDIR = /build/build/rpmbuild/BUILDROOT/gibs-gdal-2.4.4-4.el8.x86_64/usr/lib64
BINDIR = /build/build/rpmbuild/BUILDROOT/gibs-gdal-2.4.4-4.el8.x86_64/usr/bin/
GDAL_INCLUDE = -I $(PREFIX)/include -I $(GDAL_ROOT) -I /build/build/rpmbuild/BUILDROOT/gibs-gdal-2.4.4-5.el9.x86_64/usr/include/ -I /build/build/rpmbuild/BUILD/gibs-gdal-2.4.4/build/gdal/
LIBDIR = /build/build/rpmbuild/BUILDROOT/gibs-gdal-2.4.4-5.el9.x86_64/usr/lib64
BINDIR = /build/build/rpmbuild/BUILDROOT/gibs-gdal-2.4.4-5.el9.x86_64/usr/bin/
CP=cp

INCLUDES = $(GDAL_INCLUDE)
Expand Down

0 comments on commit 60ccf9d

Please sign in to comment.