Skip to content

Commit

Permalink
Merge branch '2.4.4-5' of github.com:nasa-gibs/mrf into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroberts committed Apr 23, 2023
2 parents 65129f8 + 60ccf9d commit d488f41
Show file tree
Hide file tree
Showing 9 changed files with 227 additions and 30 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
4 changes: 2 additions & 2 deletions bin/build_el7_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ rm -f docker/el7/rpms/gibs-gdal-debuginfo-*.rpm
cd docker/el7

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

Expand Down
28 changes: 28 additions & 0 deletions bin/build_el8_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-*.el8.*.rpm >/dev/null 2>&1; then
echo "No RPMs found in ./dist/" >&2
exit 1
fi

TAG="$1"

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

(
set -e
cd docker/el8

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

rm -rf docker/el8/rpms
47 changes: 47 additions & 0 deletions bin/build_el8_rpms_in_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/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 powertools
dnf install -y python3
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" \
centos:8 /dist/build_rpms.sh

rm dist/build_rpms.sh
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
80 changes: 56 additions & 24 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 1%{?dist}
%global gdal_release 5%{?dist}

Name: gibs-gdal
Version: %{gdal_version}
Expand All @@ -13,26 +13,32 @@ Source0: gibs-gdal-%{gdal_version}.tar.bz2
Source1: http://download.osgeo.org/gdal/%{gdal_version}/gdal-%{gdal_version}.tar.gz

BuildRequires: make
BuildRequires: libtool
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: libpng-devel
BuildRequires: libungif-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: jpackage-utils
BuildRequires: python3
BuildRequires: python3-devel
BuildRequires: libpng-devel
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: jpackage-utils
BuildRequires: jasper-devel
BuildRequires: zlib-devel
BuildRequires: curl-devel
BuildRequires: chrpath
BuildRequires: swig
BuildRequires: zlib-devel
BuildRequires: curl-devel
BuildRequires: chrpath
BuildRequires: swig
BuildRequires: doxygen
BuildRequires: expat-devel
BuildRequires: numpy
BuildRequires: geos-devel >= 3.3.2
Requires: gcc-c++
Requires: geos >= 3.3.2

BuildRequires: expat-devel
BuildRequires: geos-devel
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel
BuildRequires: bzip2
BuildRequires: python3-numpy
BuildRequires: /usr/bin/pathfix.py
BuildRequires: openjpeg2

Requires: proj


%description
The GDAL library provides support to handle multiple GIS file formats.

Expand Down Expand Up @@ -86,11 +92,12 @@ rm -rf swig/python/samples
rm -rf %{buildroot}/usr/etc/bash_completion.d/gdal-bash-completion.sh
%endif

# Fix python shebangs
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch} %{buildroot}%{_bindir}/*.py

%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%{_bindir}/*
Expand All @@ -99,11 +106,12 @@ rm -rf %{buildroot}
%{_libdir}/*.so.*
%{_datadir}/gdal
%{_mandir}/man1/*.1*
%{python_sitearch}/*.egg-info
%{python_sitearch}/gdal*
%{python_sitearch}/ogr*
%{python_sitearch}/osr*
%{python_sitearch}/osgeo
%{python3_sitearch}/*.egg-info
%{python3_sitearch}/gdal*
%{python3_sitearch}/ogr*
%{python3_sitearch}/osr*
%{python3_sitearch}/osgeo
%{python3_sitearch}/__pycache__/*
%{_libdir}/pkgconfig/gdal.pc

%files devel
Expand All @@ -116,6 +124,7 @@ rm -rf %{buildroot}

%files apps
%defattr(-,root,root,-)
%{_bindir}/can
%{_bindir}/mrf_insert
%{_bindir}/mrf_clean.py
%{_bindir}/mrf_join.py
Expand All @@ -127,10 +136,33 @@ rm -rf %{buildroot}

%post
/sbin/ldconfig
# Fix python shebangs post install
sed -i 's@\/usr\/libexec\/platform-python -s@\/usr\/bin\/env python3@g' /usr/bin/gdal*.py /usr/bin/gcps2wld.py /usr/bin/mkgraticule.py /usr/bin/pct2rgb.py /usr/bin/epsg_tr.py /usr/bin/gcps2vec.py /usr/bin/rgb2pct.py /usr/bin/esri2wkt.py /usr/bin/ogrmerge.py

# Link /usr/lib64/libproj.so to /usr/lib64/libproj.so.##
ln -s $(ls /usr/lib64/libproj.so.[0-9]?) /usr/lib64/libproj.so

%post apps
# Fix python shebangs post install apps
sed -i 's@\/usr\/libexec\/platform-python -s@\/usr\/bin\/env python3@g' /usr/bin/mrf*.py /usr/bin/tiles2mrf.py


%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

* Mon Apr 19 2021 Joe T. Roberts <[email protected]> - 2.4.4-3
- Support for CentOS 8 builds

* Wed Dec 16 2020 Joe T. Roberts <[email protected]> - 2.4.4-2
- Use Python3 apps, include can, and moved gcc-c++ to BuildRequires

* Thu Mar 19 2020 Joe T. Roberts <[email protected]> - 2.4.4-1
- Update to GDAL 2.4.4

Expand Down
6 changes: 6 additions & 0 deletions docker/el8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM centos:8

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

RUN yum install -y epel-release python36 && yum clean all
RUN yum install -y /rpms/gibs-gdal-*.el8.*.rpm
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

0 comments on commit d488f41

Please sign in to comment.