|
|
|
@ -0,0 +1,398 @@
|
|
|
|
|
%{!?javabuild:%global javabuild 0}
|
|
|
|
|
%{!?utils:%global utils 1}
|
|
|
|
|
%{!?gcj_support:%global gcj_support 0}
|
|
|
|
|
%{!?upgrade:%global upgrade 0}
|
|
|
|
|
%{!?runselftest:%global runselftest 1}
|
|
|
|
|
|
|
|
|
|
# Re-enable upgrade packages on next major version bump!
|
|
|
|
|
%global majorversion 3.2
|
|
|
|
|
%global soversion 3
|
|
|
|
|
%global prevmajorversion 2.5
|
|
|
|
|
%global prevversion %{prevmajorversion}.5
|
|
|
|
|
%global so_files postgis postgis_topology rtpostgis address_standardizer
|
|
|
|
|
%global configure_opts --disable-rpath --enable-raster
|
|
|
|
|
|
|
|
|
|
%global __provides_exclude_from %{_libdir}/pgsql
|
|
|
|
|
|
|
|
|
|
Name: postgis
|
|
|
|
|
Version: %majorversion.0
|
|
|
|
|
Release: 1%{?commit:.git%shortcommit}%{?dist}
|
|
|
|
|
Summary: Geographic Information Systems Extensions to PostgreSQL
|
|
|
|
|
License: GPLv2+
|
|
|
|
|
|
|
|
|
|
URL: http://www.postgis.net
|
|
|
|
|
Source0: http://download.osgeo.org/%{name}/source/%{name}-%{version}.tar.gz
|
|
|
|
|
Source2: http://download.osgeo.org/%{name}/docs/%{name}-%{version}.pdf
|
|
|
|
|
Source3: http://download.osgeo.org/%{name}/source/%{name}-%{prevversion}.tar.gz
|
|
|
|
|
|
|
|
|
|
# From debian
|
|
|
|
|
# This should increase chances of tests passing even on busy or slow systems.
|
|
|
|
|
Patch0: relax-test-timing-constraints.patch
|
|
|
|
|
|
|
|
|
|
%ifnarch armv7hl
|
|
|
|
|
BuildRequires: SFCGAL-devel
|
|
|
|
|
%endif
|
|
|
|
|
BuildRequires: make autoconf automake byacc
|
|
|
|
|
BuildRequires: clang desktop-file-utils docbook-dtds
|
|
|
|
|
BuildRequires: flex gcc-c++ gdal-devel >= 3.4.0
|
|
|
|
|
BuildRequires: geos-devel >= 3.10.1 ggtk2-devel
|
|
|
|
|
BuildRequires: json-c-devel libtool libxml2-devel
|
|
|
|
|
BuildRequires: libxslt llvm pcre-devel
|
|
|
|
|
BuildRequires: perl-generators postgresql-server-devel
|
|
|
|
|
BuildRequires: proj-devel >= 8.2.0 protobuf-c-devel
|
|
|
|
|
%if %upgrade
|
|
|
|
|
BuildRequires: postgresql-upgrade-devel
|
|
|
|
|
%endif
|
|
|
|
|
%if %runselftest
|
|
|
|
|
BuildRequires: postgresql-test-rpm-macros
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
PostGIS adds support for geographic objects to the PostgreSQL object-relational
|
|
|
|
|
database. In effect, PostGIS "spatially enables" the PostgreSQL server,
|
|
|
|
|
allowing it to be used as a backend spatial database for geographic information
|
|
|
|
|
systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS
|
|
|
|
|
follows the OpenGIS "Simple Features Specification for SQL" and has been
|
|
|
|
|
certified as compliant with the "Types and Functions" profile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package llvmjit
|
|
|
|
|
Summary: Just-in-time compilation support for PostGIS
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description llvmjit
|
|
|
|
|
Just-in-time compilation support for PostGIS.
|
|
|
|
|
|
|
|
|
|
%package docs
|
|
|
|
|
Summary: Extra documentation for PostGIS
|
|
|
|
|
|
|
|
|
|
%description docs
|
|
|
|
|
The postgis-docs package includes PDF documentation of PostGIS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %javabuild
|
|
|
|
|
%package jdbc
|
|
|
|
|
Summary: The JDBC driver for PostGIS
|
|
|
|
|
License: LGPLv2+
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
Requires: postgresql-jdbc
|
|
|
|
|
BuildRequires: ant >= 0:1.6.2 java-devel
|
|
|
|
|
BuildRequires: junit >= 0:3.7 postgresql-jdbc
|
|
|
|
|
|
|
|
|
|
%if %{gcj_support}
|
|
|
|
|
BuildRequires: gcc-java java-1.5.0-gcj-devel
|
|
|
|
|
Requires(post): %{_bindir}/rebuild-gcj-db
|
|
|
|
|
Requires(postun): %{_bindir}/rebuild-gcj-db
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%description jdbc
|
|
|
|
|
The postgis-jdbc package provides the essential jdbc driver for PostGIS.
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %utils
|
|
|
|
|
%package utils
|
|
|
|
|
Summary: The utils for PostGIS
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
Requires: perl-DBD-Pg
|
|
|
|
|
|
|
|
|
|
%description utils
|
|
|
|
|
The postgis-utils package provides the utilities for PostGIS.
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %upgrade
|
|
|
|
|
%package upgrade
|
|
|
|
|
Summary: Support for upgrading Postgis
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
Requires: postgresql-upgrade
|
|
|
|
|
Provides: bundled(postgis) = %prevversion
|
|
|
|
|
|
|
|
|
|
%description upgrade
|
|
|
|
|
The postgis-upgrade package contains the previous version of Postgis as well as
|
|
|
|
|
the current version of Postgis built against the previous version of PostgreSQL
|
|
|
|
|
necessary for correct dump of schema from previous version of PostgreSQL.
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%package gui
|
|
|
|
|
Summary: The shp2pgsql-gui utility for PostGIS
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description gui
|
|
|
|
|
The gui package provides shp2pgsql-gui for PostGIS.
|
|
|
|
|
|
|
|
|
|
%package client
|
|
|
|
|
Summary: The CLI clients for PostGIS
|
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description client
|
|
|
|
|
The client package provides shp2pgsql, raster2pgsql and pgsql2shp for PostGIS.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -p1 -n %{name}-%{version} -a 3
|
|
|
|
|
# For patch1
|
|
|
|
|
./autogen.sh
|
|
|
|
|
|
|
|
|
|
%if %upgrade
|
|
|
|
|
# postgis-upgrade
|
|
|
|
|
(
|
|
|
|
|
cd %{name}-%{prevversion}
|
|
|
|
|
./autogen.sh
|
|
|
|
|
)
|
|
|
|
|
tar xf %{SOURCE0}
|
|
|
|
|
(
|
|
|
|
|
cd %{name}-%{version}
|
|
|
|
|
%patch1 -p1
|
|
|
|
|
./autogen.sh
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
cp -p %{SOURCE2} .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%ifnarch armv7hl
|
|
|
|
|
%configure %configure_opts --with-gui --with-pgconfig=%{_bindir}/pg_server_config --with-sfcgal
|
|
|
|
|
%else
|
|
|
|
|
%configure %configure_opts --with-gui --with-pgconfig=%{_bindir}/pg_server_config
|
|
|
|
|
%endif
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' postgis/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' raster/rt_pg/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' topology/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' extensions/address_standardizer/Makefile
|
|
|
|
|
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
|
|
|
|
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
|
|
%if %javabuild
|
|
|
|
|
export BUILDXML_DIR=%{_builddir}/%{name}-%{version}/java/jdbc
|
|
|
|
|
JDBC_VERSION_RPM=`rpm -ql postgresql-jdbc| grep 'jdbc2.jar$'|awk -F '/' '{print $5}'`
|
|
|
|
|
sed 's/postgresql.jar/'${JDBC_VERSION_RPM}'/g' $BUILDXML_DIR/build.xml > $BUILDXML_DIR/build.xml.new
|
|
|
|
|
mv -f $BUILDXML_DIR/build.xml.new $BUILDXML_DIR/build.xml
|
|
|
|
|
pushd java/jdbc
|
|
|
|
|
ant
|
|
|
|
|
popd
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %utils
|
|
|
|
|
%make_build -C utils
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %upgrade
|
|
|
|
|
(
|
|
|
|
|
# TODO: report that out-of-tree (VPATH) build is broken
|
|
|
|
|
cd %{name}-%{version}
|
|
|
|
|
|
|
|
|
|
# Build current Postgis version against the previous PostgreSQL version. We need only the so names.
|
|
|
|
|
# We intentionally don't use %%configure here since there is too many
|
|
|
|
|
# pre-defined directories, and not everything from postgis-%%prevversion
|
|
|
|
|
# directory respects the `pg_config` output (liblwgeom especially).
|
|
|
|
|
./configure %configure_opts \
|
|
|
|
|
--with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config \
|
|
|
|
|
--libdir=%postgresql_upgrade_prefix/lib \
|
|
|
|
|
--includedir=%postgresql_upgrade_prefix/include
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' postgis/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' raster/rt_pg/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' topology/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' extensions/address_standardizer/Makefile
|
|
|
|
|
%make_build
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
|
# TODO: report that out-of-tree (VPATH) build is broken
|
|
|
|
|
cd %{name}-%{prevversion}
|
|
|
|
|
|
|
|
|
|
# Build previous Postgis version against the current PostgreSQL version. We need only the so names.
|
|
|
|
|
%configure %configure_opts
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' postgis/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' raster/rt_pg/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' topology/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' extensions/address_standardizer/Makefile
|
|
|
|
|
%make_build
|
|
|
|
|
mkdir ../compat-build
|
|
|
|
|
for so in %so_files; do
|
|
|
|
|
find -name $so.so -exec cp {} ../compat-build/$so-%{prevmajorversion}.so \;
|
|
|
|
|
find -name $so-%{prevmajorversion}.so -exec cp -t ../compat-build/ {} +
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Full build of previous Postgis version against previous PostgreSQL version
|
|
|
|
|
# We intentionally don't use %%configure here since there is too many
|
|
|
|
|
# pre-defined directories, and not everything from postgis-%%prevversion
|
|
|
|
|
# directory respects the `pg_config` output (liblwgeom especially).
|
|
|
|
|
./configure %configure_opts \
|
|
|
|
|
--with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config \
|
|
|
|
|
--libdir=%postgresql_upgrade_prefix/lib \
|
|
|
|
|
--includedir=%postgresql_upgrade_prefix/include
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' postgis/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' raster/rt_pg/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' topology/Makefile
|
|
|
|
|
sed -i 's| -fstack-clash-protection | |' extensions/address_standardizer/Makefile
|
|
|
|
|
%make_build
|
|
|
|
|
)
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%make_install
|
|
|
|
|
%make_install -C utils
|
|
|
|
|
%make_install -C extensions
|
|
|
|
|
|
|
|
|
|
# move application metadata to correct location
|
|
|
|
|
mv %{buildroot}/%{_datadir}/pgsql/applications %{buildroot}/%{_datadir}
|
|
|
|
|
mv %{buildroot}/%{_datadir}/pgsql/icons %{buildroot}/%{_datadir}
|
|
|
|
|
|
|
|
|
|
%if %upgrade
|
|
|
|
|
(cd %{name}-%{version} && %make_install)
|
|
|
|
|
(cd %{name}-%{prevversion} && %make_install)
|
|
|
|
|
|
|
|
|
|
# drop unused stuff from upgrade-only installation
|
|
|
|
|
/bin/rm -rf %buildroot%postgresql_upgrade_prefix/bin
|
|
|
|
|
/bin/rm -rf %buildroot%postgresql_upgrade_prefix/lib/lib*
|
|
|
|
|
|
|
|
|
|
# Manually install compat-build binary.
|
|
|
|
|
for so in %so_files; do
|
|
|
|
|
%{__install} -m 644 compat-build/$so-%{prevmajorversion}.so %{buildroot}/%{_libdir}/pgsql
|
|
|
|
|
done
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
rm -f %{buildroot}%{_datadir}/*.sql
|
|
|
|
|
|
|
|
|
|
%if %javabuild
|
|
|
|
|
install -d %{buildroot}%{_javadir}
|
|
|
|
|
install -m 755 java/jdbc/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
|
|
|
|
|
%if %{gcj_support}
|
|
|
|
|
aot-compile-rpm
|
|
|
|
|
%endif
|
|
|
|
|
strip %{buildroot}/%{_libdir}/gcj/%{name}/*.jar.so
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %utils
|
|
|
|
|
install -d %{buildroot}%{_datadir}/%{name}
|
|
|
|
|
install -m 755 utils/*.pl %{buildroot}%{_datadir}/%{name}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
find %buildroot \( -name '*.la' -or -name '*.a' \) -delete
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
desktop-file-validate %{buildroot}/%{_datadir}/applications/shp2pgsql-gui.desktop
|
|
|
|
|
%if %runselftest
|
|
|
|
|
%postgresql_tests_run
|
|
|
|
|
export PGIS_REG_TMPDIR=`mktemp -d`
|
|
|
|
|
if ! LD_LIBRARY_PATH=%{buildroot}%_libdir make check %{_smp_mflags} ; then
|
|
|
|
|
for file in $(find $PGIS_REG_TMPDIR -name '*_diff'); do
|
|
|
|
|
echo "== $file =="
|
|
|
|
|
cat "$file"
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %javabuild
|
|
|
|
|
%if %gcj_support
|
|
|
|
|
%post jdbc -p %{_bindir}/rebuild-gcj-db
|
|
|
|
|
%postun jdbc -p %{_bindir}/rebuild-gcj-db
|
|
|
|
|
%endif
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%license COPYING
|
|
|
|
|
%doc CREDITS NEWS TODO README.%{name} loader/README.* doc/%{name}.xml doc/ZMSgeoms.txt
|
|
|
|
|
|
|
|
|
|
%{_libdir}/pgsql/%{name}-%{soversion}.so
|
|
|
|
|
%{_datadir}/pgsql/contrib/postgis-%{majorversion}/*.sql
|
|
|
|
|
%{_datadir}/pgsql/extension/address_standardizer*.sql
|
|
|
|
|
%{_datadir}/pgsql/extension/address_standardizer*.control
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis-*.sql
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_raster*.sql
|
|
|
|
|
%ifnarch armv7hl
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_sfcgal*.sql
|
|
|
|
|
%endif
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_topology*.sql
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis.control
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_raster.control
|
|
|
|
|
%ifnarch armv7hl
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_sfcgal.control
|
|
|
|
|
%endif
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_topology.control
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_tiger_geocoder*.sql
|
|
|
|
|
%{_datadir}/pgsql/extension/postgis_tiger_geocoder.control
|
|
|
|
|
%{_datadir}/postgis/create_unpackaged.pl
|
|
|
|
|
%{_datadir}/postgis/create_spatial_ref_sys_config_dump.pl
|
|
|
|
|
%{_datadir}/postgis/repo_revision.pl
|
|
|
|
|
%{_libdir}/pgsql/address_standardizer-%{soversion}.so
|
|
|
|
|
%{_libdir}/pgsql/postgis_raster-%{soversion}.so
|
|
|
|
|
%ifnarch armv7hl
|
|
|
|
|
%{_libdir}/pgsql/postgis_sfcgal-%{soversion}.so
|
|
|
|
|
%endif
|
|
|
|
|
%{_libdir}/pgsql/postgis_topology-%{soversion}.so
|
|
|
|
|
|
|
|
|
|
%files client
|
|
|
|
|
%{_bindir}/pgsql2shp
|
|
|
|
|
%{_bindir}/raster2pgsql
|
|
|
|
|
%{_bindir}/shp2pgsql
|
|
|
|
|
|
|
|
|
|
%files gui
|
|
|
|
|
%{_bindir}/shp2pgsql-gui
|
|
|
|
|
%{_datadir}/applications/shp2pgsql-gui.desktop
|
|
|
|
|
%{_datadir}/icons/hicolor/*/apps/shp2pgsql-gui.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files llvmjit
|
|
|
|
|
%{_libdir}/pgsql/bitcode/address_standardizer-*
|
|
|
|
|
%{_libdir}/pgsql/bitcode/postgis-*
|
|
|
|
|
%{_libdir}/pgsql/bitcode/postgis_raster-*
|
|
|
|
|
%ifnarch armv7hl
|
|
|
|
|
%{_libdir}/pgsql/bitcode/postgis_sfcgal-*
|
|
|
|
|
%endif
|
|
|
|
|
%{_libdir}/pgsql/bitcode/postgis_topology-*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %javabuild
|
|
|
|
|
%files jdbc
|
|
|
|
|
%license java/jdbc/COPYING_LGPL
|
|
|
|
|
%doc java/jdbc/README
|
|
|
|
|
%{_javadir}/%{name}.jar
|
|
|
|
|
%if %{gcj_support}
|
|
|
|
|
%dir %{_libdir}/gcj/%{name}
|
|
|
|
|
%{_libdir}/gcj/%{name}/*.jar.so
|
|
|
|
|
%{_libdir}/gcj/%{name}/*.jar.db
|
|
|
|
|
%endif
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %upgrade
|
|
|
|
|
%files upgrade
|
|
|
|
|
%postgresql_upgrade_prefix/*
|
|
|
|
|
%_libdir/pgsql/*-%{prevmajorversion}.so
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %utils
|
|
|
|
|
%files utils
|
|
|
|
|
%doc utils/README
|
|
|
|
|
%dir %{_datadir}/%{name}/
|
|
|
|
|
%doc %{_datadir}/doc/pgsql/extension/README.address_standardizer
|
|
|
|
|
%{_datadir}/%{name}/test_estimation.pl
|
|
|
|
|
%{_datadir}/%{name}/profile_intersects.pl
|
|
|
|
|
%{_datadir}/%{name}/test_joinestimation.pl
|
|
|
|
|
%{_datadir}/%{name}/create_extension_unpackage.pl
|
|
|
|
|
%{_datadir}/%{name}/create_undef.pl
|
|
|
|
|
%{_datadir}/%{name}/%{name}_proc_upgrade.pl
|
|
|
|
|
%{_datadir}/%{name}/%{name}_restore.pl
|
|
|
|
|
%{_datadir}/pgsql/contrib/postgis-%{majorversion}/postgis_restore.pl
|
|
|
|
|
%{_datadir}/%{name}/read_scripts_version.pl
|
|
|
|
|
%{_datadir}/%{name}/test_geography_estimation.pl
|
|
|
|
|
%{_datadir}/%{name}/test_geography_joinestimation.pl
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files docs
|
|
|
|
|
%doc postgis*.pdf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Tue Dec 21 2021 Devrim Gunduz <devrim@gunduz.org> - 3.2.0-1
|
|
|
|
|
- Initial packaging for EPEL 9
|