The package rpms/postgis.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/postgis.git/commit/?id=bc43e98a0b...
https://src.fedoraproject.org/cgit/rpms/postgis.git/commit/?id=4a17aef303....
Change:
+%ifarch s390x
+%ifnarch %ix86 ppc64 s390x
Thanks.
Full change:
============
commit bc43e98a0b64dc48163e908a050f9e0cc0857f5c
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Wed Oct 18 10:28:18 2017 +0200
hardening: ftbfs fix on f26 and f27+ s390x
Version: 2.4.0-1
diff --git a/postgis.spec b/postgis.spec
index 999aca9..6e3ef16 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -7,6 +7,14 @@
# rhbz#1503454
%global _smp_mflags -j1
+%ifarch s390x
+# rhbz#1503476
+%undefine _hardened_build
+%endif
+%if 0%{?fedora} == 26
+%undefine _hardened_build
+%endif
+
%global majorversion 2.4
%global prevmajorversion 2.3
%global prevversion %{prevmajorversion}.3
@@ -334,6 +342,7 @@ fi
- optimize build without %%upgrade
- drop explicit requires on libraries (resolved by implicit lib*.so*())
- enable build testsuite
+- disable hardening on f26 (all arches) and on s390x (all distros)
* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- provide postgis-upgrade package (rhbz#1475177)
commit 4a17aef303b8e246a8152090ce47ec4c5188bae0
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Wed Oct 18 09:35:28 2017 +0200
reference some bugs filed just now
Version: 2.4.0-1
diff --git a/postgis-2.4.0-check-gdal.patch b/postgis-2.4.0-check-gdal.patch
index 86ebf8e..c79b36f 100644
--- a/postgis-2.4.0-check-gdal.patch
+++ b/postgis-2.4.0-check-gdal.patch
@@ -1,3 +1,5 @@
+rhbz#1503453
+
diff --git a/raster/test/regress/check_gdal_expected
b/raster/test/regress/check_gdal_expected
index ab1eebe..0a4be7f 100644
--- a/raster/test/regress/check_gdal_expected
diff --git a/postgis.spec b/postgis.spec
index 36bd2a8..999aca9 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -4,6 +4,9 @@
%{!?upgrade:%global upgrade 1}
%{!?runselftest:%global runselftest 1}
+# rhbz#1503454
+%global _smp_mflags -j1
+
%global majorversion 2.4
%global prevmajorversion 2.3
%global prevversion %{prevmajorversion}.3
@@ -226,8 +229,17 @@ desktop-file-validate
%{buildroot}/%{_datadir}/applications/shp2pgsql-gui.deskto
%pgtests_init
%pgtests_start
export PGIS_REG_TMPDIR=`mktemp -d`
-LD_LIBRARY_PATH=%{buildroot}%_libdir make check %{_smp_mflags}
+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
+%ifnarch %ix86 ppc64 s390x
+ # rhbz#1503453
+ false
%endif
+fi
+%endif # runselftest
%if %javabuild
@@ -259,6 +271,7 @@ LD_LIBRARY_PATH=%{buildroot}%_libdir make check %{_smp_mflags}
%{_datadir}/postgis/create_unpackaged.pl
%{_datadir}/postgis/create_spatial_ref_sys_config_dump.pl
%{_datadir}/postgis/postgis_proc_set_search_path.pl
+# rhbz#1503456
%{_libdir}/liblwgeom-%majorversion.so.*
%{_libdir}/pgsql/address_standardizer-%{majorversion}.so
%{_libdir}/pgsql/rtpostgis-%{majorversion}.so
commit abf7e3f8ee5d3d2409d591de271c558fa021c404
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Tue Oct 17 22:16:23 2017 +0200
upgrade: install compat lwgeom properly
Version: 2.4.0-1
diff --git a/postgis.spec b/postgis.spec
index 485c452..36bd2a8 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -12,6 +12,8 @@
%global pg_version_minimum 9.2
+%global __provides_exclude_from %{_libdir}/pgsql
+
Summary: Geographic Information Systems Extensions to PostgreSQL
Name: postgis
Version: %majorversion.0
@@ -167,8 +169,14 @@ for so in %so_files; do
find -name $so-%prevmajorversion.so -exec cp -t ../compat-build/ {} +
done
-# second, build feature-full build against previous PostgreSQL version
-%configure %configure_opts --with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config
+# Second, build feature-full build 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
make %{?_smp_mflags}
)
%endif
@@ -251,7 +259,7 @@ LD_LIBRARY_PATH=%{buildroot}%_libdir make check %{_smp_mflags}
%{_datadir}/postgis/create_unpackaged.pl
%{_datadir}/postgis/create_spatial_ref_sys_config_dump.pl
%{_datadir}/postgis/postgis_proc_set_search_path.pl
-%{_libdir}/liblwgeom*.so.*
+%{_libdir}/liblwgeom-%majorversion.so.*
%{_libdir}/pgsql/address_standardizer-%{majorversion}.so
%{_libdir}/pgsql/rtpostgis-%{majorversion}.so
%{_libdir}/pgsql/postgis_topology-%{majorversion}.so
commit 3a1524b33042ca84a7f88d6feb734474076e6f25
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Tue Oct 17 22:15:56 2017 +0200
tests: enable build testsuite
Version: 2.4.0-1
diff --git a/postgis-2.4.0-check-gdal.patch b/postgis-2.4.0-check-gdal.patch
new file mode 100644
index 0000000..86ebf8e
--- /dev/null
+++ b/postgis-2.4.0-check-gdal.patch
@@ -0,0 +1,10 @@
+diff --git a/raster/test/regress/check_gdal_expected
b/raster/test/regress/check_gdal_expected
+index ab1eebe..0a4be7f 100644
+--- a/raster/test/regress/check_gdal_expected
++++ b/raster/test/regress/check_gdal_expected
+@@ -1,4 +1,5 @@
+ t
++t
+ DISABLE_ALL
+ ENABLE_ALL
+ t
diff --git a/postgis-2.4.0-code-check-only.patch b/postgis-2.4.0-code-check-only.patch
new file mode 100644
index 0000000..41ff0fd
--- /dev/null
+++ b/postgis-2.4.0-code-check-only.patch
@@ -0,0 +1,27 @@
+diff --git a/GNUmakefile.in b/GNUmakefile.in
+index 878548e..3c95a2f 100644
+--- a/GNUmakefile.in
++++ b/GNUmakefile.in
+@@ -35,7 +35,7 @@ clean-local:
+ # TODO: drop 'test' target..
+ test: check
+
+-check: all docs-check check-no-trailing-blanks
++check: all
+
+ check-no-trailing-blanks:
+ ! find . -name '*.c' -o -name '*.h' | \
+diff --git a/doc/Makefile.in b/doc/Makefile.in
+index 31fd778..6268e7f 100644
+--- a/doc/Makefile.in
++++ b/doc/Makefile.in
+@@ -397,6 +397,9 @@ check: $(XML_INPUTS)
+ $(XMLLINT) --loaddtd --xinclude --valid postgis-out.xml > /dev/null
+ endif
+
++check:
++ :
++
+ check-localized:
+ @for lang in $(translations); do \
+ echo "Creating html for language $$lang..."; \
diff --git a/postgis.spec b/postgis.spec
index 7835cf4..485c452 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -2,6 +2,7 @@
%{!?utils:%global utils 1}
%{!?gcj_support:%global gcj_support 0}
%{!?upgrade:%global upgrade 1}
+%{!?runselftest:%global runselftest 1}
%global majorversion 2.4
%global prevmajorversion 2.3
@@ -24,6 +25,8 @@ Source4: filter-requires-perl-Pg.sh
Patch1: postgis-configureac21.patch
Patch2: postgis-2.4.0-upgrade-2.3.3.patch
Patch3: postgis-2.4.0-install-desktop.patch
+Patch4: postgis-2.4.0-code-check-only.patch
+Patch5: postgis-2.4.0-check-gdal.patch
URL:
http://www.postgis.net
BuildRequires: perl-generators
@@ -35,6 +38,9 @@ BuildRequires: autoconf, automake, libtool
BuildRequires: postgresql-upgrade-devel
%endif
Requires: postgresql-server(:MODULE_COMPAT_%{postgresql_major})
+%if %runselftest
+BuildRequires: postgresql-server
+%endif
%description
@@ -122,6 +128,8 @@ cd %{name}-%{prevversion}
)
%endif
%patch3 -p1
+%patch4 -p1
+%patch5 -p1
cp -p %{SOURCE2} .
@@ -206,6 +214,12 @@ find %buildroot \( -name '*.la' -or -name '*.a' \)
-delete
%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/shp2pgsql-gui.desktop
+%if %runselftest
+%pgtests_init
+%pgtests_start
+export PGIS_REG_TMPDIR=`mktemp -d`
+LD_LIBRARY_PATH=%{buildroot}%_libdir make check %{_smp_mflags}
+%endif
%if %javabuild
@@ -298,6 +312,7 @@ desktop-file-validate
%{buildroot}/%{_datadir}/applications/shp2pgsql-gui.deskto
- install desktop files into /usr/share/applications
- optimize build without %%upgrade
- drop explicit requires on libraries (resolved by implicit lib*.so*())
+- enable build testsuite
* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- provide postgis-upgrade package (rhbz#1475177)
commit b95d41a06da0afd082965cdfd47cba343bdc56c0
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Tue Oct 17 18:56:09 2017 +0200
drop explicit requires
Version: 2.4.0-1.1
diff --git a/postgis.spec b/postgis.spec
index 7a3f3d0..7835cf4 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -35,7 +35,6 @@ BuildRequires: autoconf, automake, libtool
BuildRequires: postgresql-upgrade-devel
%endif
Requires: postgresql-server(:MODULE_COMPAT_%{postgresql_major})
-Requires: geos >= 3.4.2, proj, gdal >= 1.10.0, json-c
%description
@@ -298,6 +297,7 @@ desktop-file-validate
%{buildroot}/%{_datadir}/applications/shp2pgsql-gui.deskto
* Tue Oct 17 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- install desktop files into /usr/share/applications
- optimize build without %%upgrade
+- drop explicit requires on libraries (resolved by implicit lib*.so*())
* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- provide postgis-upgrade package (rhbz#1475177)
commit 6a7bf86376d7e81df398eb397d30868f840334dd
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Tue Oct 17 18:55:16 2017 +0200
upgrade: optimise build for --define 'upgrade 0'
Version: 2.4.0-1
diff --git a/postgis.spec b/postgis.spec
index 410444a..7a3f3d0 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -19,9 +19,7 @@ License: GPLv2+
Group: Applications/Databases
Source0:
http://download.osgeo.org/%{name}/source/%{name}-%{version}.tar.gz
Source2:
http://download.osgeo.org/%{name}/docs/%{name}-%{version}.pdf
-%if %upgrade
Source3:
http://download.osgeo.org/%{name}/source/%{name}-%{prevversion}.tar.gz
-%endif
Source4: filter-requires-perl-Pg.sh
Patch1: postgis-configureac21.patch
Patch2: postgis-2.4.0-upgrade-2.3.3.patch
@@ -114,6 +112,8 @@ necessary for correct dump of schema from previous version of
PostgreSQL.
%prep
%setup -q -n %{name}-%{version} -a 3
+
+%if %upgrade
(
cd %{name}-%{prevversion}
# Remove once we move to prevversion==2.4 (2.4 build works fine).
@@ -121,6 +121,7 @@ cd %{name}-%{prevversion}
./autogen.sh
%patch2 -p1
)
+%endif
%patch3 -p1
cp -p %{SOURCE2} .
@@ -145,6 +146,7 @@ popd
make %{?_smp_mflags} -C utils
%endif
+%if %upgrade
(
# TODO: report that out-of-tree (VPATH) build is broken
cd %{name}-%{prevversion}
@@ -162,6 +164,7 @@ done
%configure %configure_opts --with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config
make %{?_smp_mflags}
)
+%endif
%install
@@ -172,6 +175,7 @@ make %{?_smp_mflags} -C extensions install DESTDIR=%{buildroot}
# hack: this requires postgis-%version-install-desktop.patch
make -C loader install-rpm-desktop DESTDIR=%{buildroot} datadir=%{_datadir}
+%if %upgrade
cd %{name}-%{prevversion}
make install DESTDIR=%{buildroot}
cd ..
@@ -180,7 +184,7 @@ cd ..
for so in %so_files; do
%{__install} -m 644 compat-build/$so-%{prevmajorversion}.so
%{buildroot}/%{_libdir}/pgsql
done
-
+%endif
rm -f %{buildroot}%{_datadir}/*.sql
@@ -293,6 +297,7 @@ desktop-file-validate
%{buildroot}/%{_datadir}/applications/shp2pgsql-gui.deskto
%changelog
* Tue Oct 17 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- install desktop files into /usr/share/applications
+- optimize build without %%upgrade
* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- provide postgis-upgrade package (rhbz#1475177)
commit d5a07cd02ef004922ce5d19489080e2103570617
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Tue Oct 17 17:36:56 2017 +0200
desktop: install desktop files to /usr/share/{applications,files}
Version: 2.4.0-1
diff --git a/postgis-2.4.0-install-desktop.patch b/postgis-2.4.0-install-desktop.patch
new file mode 100644
index 0000000..5bb2a2b
--- /dev/null
+++ b/postgis-2.4.0-install-desktop.patch
@@ -0,0 +1,15 @@
+diff --git a/loader/Makefile.in b/loader/Makefile.in
+index cb8df63..0ab2670 100644
+--- a/loader/Makefile.in
++++ b/loader/Makefile.in
+@@ -130,7 +130,9 @@ ifdef gtk_build
+ done
+ endif
+
+-install: installdir install-desktop install-icons
++install-rpm-desktop: install-desktop install-icons
++
++install: installdir
+ ifdef gtk_build
+ $(LIBTOOL) --mode=install $(INSTALL) $(SHP2PGSQL-GUI)
"$(DESTDIR)$(bindir)/$(SHP2PGSQL-GUI)"
+ endif
diff --git a/postgis.spec b/postgis.spec
index 112f40b..410444a 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -25,11 +25,12 @@
Source3:
http://download.osgeo.org/%{name}/source/%{name}-%{prevversion}.tar.gz
Source4: filter-requires-perl-Pg.sh
Patch1: postgis-configureac21.patch
Patch2: postgis-2.4.0-upgrade-2.3.3.patch
+Patch3: postgis-2.4.0-install-desktop.patch
URL:
http://www.postgis.net
BuildRequires: perl-generators
BuildRequires: postgresql-devel >= %{pg_version_minimum}, proj-devel, geos-devel >=
3.4.2 byacc, proj-devel, flex, java, java-devel, ant
-BuildRequires: gtk2-devel, libxml2-devel, gdal-devel >= 1.10.0
+BuildRequires: gtk2-devel, libxml2-devel, gdal-devel >= 1.10.0, desktop-file-utils
BuildRequires: pcre-devel
BuildRequires: autoconf, automake, libtool
%if %upgrade
@@ -120,6 +121,7 @@ cd %{name}-%{prevversion}
./autogen.sh
%patch2 -p1
)
+%patch3 -p1
cp -p %{SOURCE2} .
@@ -167,6 +169,9 @@ make install DESTDIR=%{buildroot}
make %{?_smp_mflags} -C utils install DESTDIR=%{buildroot}
make %{?_smp_mflags} -C extensions install DESTDIR=%{buildroot}
+# hack: this requires postgis-%version-install-desktop.patch
+make -C loader install-rpm-desktop DESTDIR=%{buildroot} datadir=%{_datadir}
+
cd %{name}-%{prevversion}
make install DESTDIR=%{buildroot}
cd ..
@@ -196,6 +201,10 @@ install -m 755 utils/*.pl %{buildroot}%{_datadir}/%{name}
find %buildroot \( -name '*.la' -or -name '*.a' \) -delete
+%check
+desktop-file-validate %{buildroot}/%{_datadir}/applications/shp2pgsql-gui.desktop
+
+
%if %javabuild
%if %gcj_support
%post -p %{_bindir}/rebuild-gcj-db
@@ -230,8 +239,8 @@ find %buildroot \( -name '*.la' -or -name '*.a' \)
-delete
%{_libdir}/pgsql/rtpostgis-%{majorversion}.so
%{_libdir}/pgsql/postgis_topology-%{majorversion}.so
-%{_datadir}/pgsql/applications/shp2pgsql-gui.desktop
-%{_datadir}/pgsql/icons/hicolor/*/apps/shp2pgsql-gui.png
+%{_datadir}/applications/shp2pgsql-gui.desktop
+%{_datadir}/icons/hicolor/*/apps/shp2pgsql-gui.png
%files devel
@@ -282,6 +291,9 @@ find %buildroot \( -name '*.la' -or -name '*.a' \)
-delete
%changelog
+* Tue Oct 17 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
+- install desktop files into /usr/share/applications
+
* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- provide postgis-upgrade package (rhbz#1475177)
commit b500dd05b062b217b675921260a2154bb27ef722
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Sat Oct 14 06:58:39 2017 +0200
spec: lint after fedora-review run
Drop the doc/html as that's not built documentation anyway, thus
it seems to be useless.
Version: 2.4.0-1
diff --git a/postgis.spec b/postgis.spec
index 630ffd7..112f40b 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -7,6 +7,7 @@
%global prevmajorversion 2.3
%global prevversion %{prevmajorversion}.3
%global so_files rtpostgis postgis_topology postgis address_standardizer
+%global configure_opts --disable-rpath --enable-raster
%global pg_version_minimum 9.2
@@ -25,7 +26,6 @@ Source4: filter-requires-perl-Pg.sh
Patch1: postgis-configureac21.patch
Patch2: postgis-2.4.0-upgrade-2.3.3.patch
URL:
http://www.postgis.net
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: perl-generators
BuildRequires: postgresql-devel >= %{pg_version_minimum}, proj-devel, geos-devel >=
3.4.2 byacc, proj-devel, flex, java, java-devel, ant
@@ -47,6 +47,7 @@ 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 devel
Summary: The development files for PostGIS
Group: Applications/Databases
@@ -55,12 +56,14 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Development headers and libraries for PostGIS.
+
%package docs
Summary: Extra documentation for PostGIS
Group: Applications/Databases
%description docs
The postgis-docs package includes PDF documentation of PostGIS.
+
%if %javabuild
%package jdbc
Summary: The JDBC driver for PostGIS
@@ -80,21 +83,24 @@ Requires(postun): %{_bindir}/rebuild-gcj-db
The postgis-jdbc package provides the essential jdbc driver for PostGIS.
%endif
+
%if %utils
%package utils
Summary: The utils for PostGIS
Group: Applications/Databases
-Requires: %{name} = %{version}-%{release}, perl-DBD-Pg
+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 from the previous major release of Postgis
Group: Applications/Databases
-Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: postgresql-upgrade
%description upgrade
@@ -104,6 +110,7 @@ necessary for correct dump of schema from previous version of
PostgreSQL.
%define __perl_requires %{SOURCE4}
+
%prep
%setup -q -n %{name}-%{version} -a 3
(
@@ -117,7 +124,9 @@ cp -p %{SOURCE2} .
%build
-%configure --with-gui --enable-raster
+%configure %configure_opts --with-gui
+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 %{?_smp_mflags}
%if %javabuild
@@ -140,7 +149,7 @@ cd %{name}-%{prevversion}
# first perform compat-build (against the actual PostgreSQL version). We need
# only the so names.
-%configure --enable-raster
+%configure %configure_opts
make %{?_smp_mflags}
mkdir ../compat-build
for so in %so_files; do
@@ -148,18 +157,16 @@ for so in %so_files; do
done
# second, build feature-full build against previous PostgreSQL version
-%configure --enable-raster --with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config
+%configure %configure_opts --with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config
make %{?_smp_mflags}
)
+
%install
-rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
make %{?_smp_mflags} -C utils install DESTDIR=%{buildroot}
make %{?_smp_mflags} -C extensions install DESTDIR=%{buildroot}
-rm -f %{buildroot}%{_libdir}/liblwgeom.{a,la}
-
cd %{name}-%{prevversion}
make install DESTDIR=%{buildroot}
cd ..
@@ -169,6 +176,7 @@ for so in %so_files; do
%{__install} -m 644 compat-build/$so-%{prevmajorversion}.so
%{buildroot}/%{_libdir}/pgsql
done
+
rm -f %{buildroot}%{_datadir}/*.sql
%if %javabuild
@@ -185,8 +193,8 @@ install -d %{buildroot}%{_datadir}/%{name}
install -m 755 utils/*.pl %{buildroot}%{_datadir}/%{name}
%endif
-%clean
-rm -rf %{buildroot}
+find %buildroot \( -name '*.la' -or -name '*.a' \) -delete
+
%if %javabuild
%if %gcj_support
@@ -195,9 +203,10 @@ rm -rf %{buildroot}
%endif
%endif
+
%files
-%defattr(-,root,root)
-%doc COPYING CREDITS NEWS TODO README.%{name} doc/html loader/README.* doc/%{name}.xml
doc/ZMSgeoms.txt
+%license COPYING
+%doc CREDITS NEWS TODO README.%{name} loader/README.* doc/%{name}.xml doc/ZMSgeoms.txt
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_libdir}/pgsql/%{name}-%{majorversion}.so
%{_datadir}/pgsql/contrib/postgis-%{majorversion}/*.sql
@@ -216,7 +225,7 @@ rm -rf %{buildroot}
%{_datadir}/postgis/create_unpackaged.pl
%{_datadir}/postgis/create_spatial_ref_sys_config_dump.pl
%{_datadir}/postgis/postgis_proc_set_search_path.pl
-%{_libdir}/liblwgeom*
+%{_libdir}/liblwgeom*.so.*
%{_libdir}/pgsql/address_standardizer-%{majorversion}.so
%{_libdir}/pgsql/rtpostgis-%{majorversion}.so
%{_libdir}/pgsql/postgis_topology-%{majorversion}.so
@@ -228,11 +237,11 @@ rm -rf %{buildroot}
%files devel
%{_includedir}/liblwgeom.h
%{_includedir}/liblwgeom_topo.h
+%{_libdir}/liblwgeom.so
%if %javabuild
%files jdbc
-%defattr(-,root,root)
%doc java/jdbc/COPYING_LGPL java/jdbc/README
%attr(755,root,root) %{_javadir}/%{name}.jar
%if %{gcj_support}
@@ -252,7 +261,6 @@ rm -rf %{buildroot}
%if %utils
%files utils
-%defattr(755,root,root)
%doc utils/README
%dir %{_datadir}/%{name}/
%doc %{_datadir}/doc/pgsql/extension/README.address_standardizer
@@ -268,10 +276,11 @@ rm -rf %{buildroot}
%{_datadir}/%{name}/test_geography_joinestimation.pl
%endif
+
%files docs
-%defattr(-,root,root)
%doc postgis*.pdf
+
%changelog
* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- provide postgis-upgrade package (rhbz#1475177)
commit 1d9efbf23152a36a259be72cf1b5d8a546849a03
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Thu Oct 12 11:48:07 2017 +0200
upgrade: review fixes
Related: rhbz#1055293
Version: 2.4.0-1
diff --git a/postgis.spec b/postgis.spec
index a42041b..630ffd7 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -95,6 +95,7 @@ The postgis-utils package provides the utilities for PostGIS.
Summary: Support for upgrading from the previous major release of Postgis
Group: Applications/Databases
Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: postgresql-upgrade
%description upgrade
The postgis-upgrade package contains the previous version of postgis
@@ -147,7 +148,7 @@ for so in %so_files; do
done
# second, build feature-full build against previous PostgreSQL version
-%configure --enable-raster --with-pgconfig=/usr/lib64/pgsql/postgresql-9.6/bin/pg_config
+%configure --enable-raster --with-pgconfig=%postgresql_upgrade_prefix/bin/pg_config
make %{?_smp_mflags}
)
@@ -244,7 +245,7 @@ rm -rf %{buildroot}
%if %upgrade
%files upgrade
-%_libdir/pgsql/postgresql-9.6/*
+%postgresql_upgrade_prefix/*
%_libdir/pgsql/*-%{prevmajorversion}.so
%endif
commit d56a879057da6c77d15ccd04b6c2dc6a5dee9210
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Tue Oct 10 09:12:42 2017 +0200
upgrade: build compat so-version twice
Usually (when only postgis is updated, and not postgresql itself)
it is enough to maintain only the latest version of
postgis-%majorversion.so file. The upgrade scenario is then hit
(a) 'dnf upgrade -y', which brings 'postgis-X.Y+1.so', and
(b) run (manually) 'ALTER EXTENSION potgis' for all the databases.
For this scenario the compatibility library is not needed at all.
The situation is complicated in situations where also PostgreSQL
has major version upgrade (when upgrading from Fedora N to Fedora
N+1, usually). Then, you need to *also* have
(a) 'postgis-%prevversion.so' built against old server (against
postgresql-upgrade-devel), and (b) 'postgis-%prevversion.so' built
against the actual postgresql version (postgresql-devel). The
first library is needed to allow the old-stack dump properly, and
the second is needed to satisfy pg_upgrade's pre-upgrade checks
(pg_upgrade is checking that the same library exists for both
stacks, in the same version). Note that it seems like *it could
be* enough to have just symlink from %majorversion to
%prevmajorversion posgis.so to "silence" the pg_upgrade's checker,
but I'm not brave enough to go this way at this point.
There's one more (maybe theoretical) possibility that the
PostgreSQL version is updated, but PostGIS version is not. In
this case, the prevmajorversion should be eqal to majorversion
(for the build against older stack), and the compat build
shouldn't be needed. If this ever happens, we can twak the
buildsystem/macros more.
Version: 2.4.0-1
diff --git a/postgis-1.5.1-pgsql9.patch b/postgis-1.5.1-pgsql9.patch
deleted file mode 100644
index 5882e57..0000000
--- a/postgis-1.5.1-pgsql9.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -up postgis-1.5.1/postgis/Makefile.pgxs.pgsql9 postgis-1.5.1/postgis/Makefile.pgxs
---- postgis-1.5.1/postgis/Makefile.pgxs.pgsql9 2010-01-12 11:33:49.000000000 +0100
-+++ postgis-1.5.1/postgis/Makefile.pgxs 2011-04-03 13:45:33.972315988 +0200
-@@ -12,6 +12,11 @@ datamoduledir = contrib
- docmoduledir = contrib
- endif
-
-+# cope with PostgreSQL 9.0 build environment
-+ifndef mkinstalldirs
-+mkinstalldirs = $(MKDIR_P)
-+endif
-+
- install: all installdirs
- ifneq (,$(DATA)$(DATA_built))
- @for file in $(addprefix $(srcdir)/, $(DATA)) $(DATA_built); do \
diff --git a/postgis-2.4.0-upgrade-2.3.3.patch b/postgis-2.4.0-upgrade-2.3.3.patch
new file mode 100644
index 0000000..e890906
--- /dev/null
+++ b/postgis-2.4.0-upgrade-2.3.3.patch
@@ -0,0 +1,2475 @@
+From 19b8b9cd659363fcf32a5967546d5d7aa57fc57f Mon Sep 17 00:00:00 2001
+From: Paul Ramsey <pramsey(a)cleverelephant.ca>
+Date: Tue, 5 Sep 2017 20:37:59 +0000
+Subject: [PATCH 1/2] Support PgSQL 10 on PostGIS 2.3
+
+git-svn-id:
http://svn.osgeo.org/postgis/branches/2.3@15630
b70326c6-7e19-0410-871a-916f4a2858ee
+---
+ configure.ac | 9 +
+ libpgcommon/gserialized_gist.c | 4 +
+ postgis/gserialized_estimate.c | 65 +-
+ postgis/gserialized_gist_nd.c | 3 +
+ raster/rt_pg/rtpostgis.sql.in | 2 +-
+ raster/test/regress/rt_union.sql | 8 +-
+ raster/test/regress/rt_union_expected | 3 -
+ regress/regress_selectivity.sql | 2147 ++++++++++++++++++++++++++-
+ topology/sql/topogeometry/totopogeom.sql.in | 31 +-
+ topology/test/regress/copytopology.sql | 14 +-
+ topology/test/regress/copytopology_expected | 14 +-
+ 11 files changed, 2239 insertions(+), 61 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index df6dd88ad..ebf8eb402 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -433,6 +433,15 @@ if test "x$LIBLWGEOM_ONLY" = "xno"; then
+ PGSQL_MAJOR_VERSION=`echo $PGSQL_FULL_VERSION | sed
's/[[^0-9]]*\([[0-9]]*\).*/\1/'`
+ PGSQL_MINOR_VERSION=`echo $PGSQL_FULL_VERSION | sed
's/[[^\.]]*\.\([[0-9]]*\).*/\1/'`
+ PGSQL_MINOR_VERSION=`echo $PGSQL_MINOR_VERSION | sed 's/.*devel.*/0/'`
++
++ if test $PGSQL_MAJOR_VERSION -gt 9; then
++ dnl ==================================================================
++ dnl Starting with PostgreSQL 10, major is the new minor
++ dnl This is to prevent things like 10.31 ranking higher than 11.0
++ dnl===================================================================
++ PGSQL_MINOR_VERSION=0
++ fi
++
+ POSTGIS_PGSQL_VERSION="$PGSQL_MAJOR_VERSION$PGSQL_MINOR_VERSION"
+
+ PGSQL_PKGLIBDIR=`$PG_CONFIG --pkglibdir`
+diff --git a/libpgcommon/gserialized_gist.c b/libpgcommon/gserialized_gist.c
+index d379fb26a..ec2585d6a 100644
+--- a/libpgcommon/gserialized_gist.c
++++ b/libpgcommon/gserialized_gist.c
+@@ -22,6 +22,10 @@
+ #include "lwgeom_pg.h" /* For debugging macros. */
+ #include "gserialized_gist.h"
+
++#if POSTGIS_PGSQL_VERSION >= 100
++#include <float.h>
++#endif
++
+ #define FLAGS_NDIMS_GIDX(f) ( FLAGS_GET_GEODETIC(f) ? 3 : \
+ FLAGS_GET_M(f) ? 4 : \
+ FLAGS_GET_Z(f) ? 3 : 2 )
+diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c
+index 5f967059b..ea343495b 100644
+--- a/postgis/gserialized_estimate.c
++++ b/postgis/gserialized_estimate.c
+@@ -827,31 +827,52 @@ nd_increment(ND_IBOX *ibox, int ndims, int *counter)
+ static ND_STATS*
+ pg_nd_stats_from_tuple(HeapTuple stats_tuple, int mode)
+ {
+- int stats_kind = STATISTIC_KIND_ND;
+- int rv, nvalues;
++ int stats_kind = STATISTIC_KIND_ND;
++ int rv;
++ ND_STATS *nd_stats;
++
++ /* If we're in 2D mode, set the kind appropriately */
++ if ( mode == 2 ) stats_kind = STATISTIC_KIND_2D;
++
++ /* Then read the geom status histogram from that */
++
++#if POSTGIS_PGSQL_VERSION < 100
+ float4 *floatptr;
+- ND_STATS *nd_stats;
+-
+- /* If we're in 2D mode, set the kind appropriately */
+- if ( mode == 2 ) stats_kind = STATISTIC_KIND_2D;
+-
+- /* Then read the geom status histogram from that */
+- rv = get_attstatsslot(stats_tuple, 0, 0, stats_kind, InvalidOid,
+- NULL, NULL, NULL, &floatptr, &nvalues);
+- if ( ! rv ) {
+- POSTGIS_DEBUGF(2,
+- "no slot of kind %d in stats tuple", stats_kind);
+- return NULL;
+- }
++ int nvalues;
+
+- /* Clone the stats here so we can release the attstatsslot immediately */
+- nd_stats = palloc(sizeof(float) * nvalues);
+- memcpy(nd_stats, floatptr, sizeof(float) * nvalues);
+-
+- /* Clean up */
+- free_attstatsslot(0, NULL, 0, floatptr, nvalues);
++ rv = get_attstatsslot(stats_tuple, 0, 0, stats_kind, InvalidOid,
++ NULL, NULL, NULL, &floatptr, &nvalues);
++
++ if ( ! rv ) {
++ POSTGIS_DEBUGF(2,
++ "no slot of kind %d in stats tuple", stats_kind);
++ return NULL;
++ }
++
++ /* Clone the stats here so we can release the attstatsslot immediately */
++ nd_stats = palloc(sizeof(float) * nvalues);
++ memcpy(nd_stats, floatptr, sizeof(float) * nvalues);
++
++ /* Clean up */
++ free_attstatsslot(0, NULL, 0, floatptr, nvalues);
++#else /* PostgreSQL 10 or higher */
++ AttStatsSlot sslot;
++ rv = get_attstatsslot(&sslot, stats_tuple, stats_kind, InvalidOid,
++ ATTSTATSSLOT_NUMBERS);
++ if ( ! rv ) {
++ POSTGIS_DEBUGF(2,
++ "no slot of kind %d in stats tuple", stats_kind);
++ return NULL;
++ }
++
++ /* Clone the stats here so we can release the attstatsslot immediately */
++ nd_stats = palloc(sizeof(float4) * sslot.nnumbers);
++ memcpy(nd_stats, sslot.numbers, sizeof(float4) * sslot.nnumbers);
++
++ free_attstatsslot(&sslot);
++#endif
+
+- return nd_stats;
++ return nd_stats;
+ }
+
+ /**
+diff --git a/postgis/gserialized_gist_nd.c b/postgis/gserialized_gist_nd.c
+index 4fc5fa476..e8c16c5ad 100644
+--- a/postgis/gserialized_gist_nd.c
++++ b/postgis/gserialized_gist_nd.c
+@@ -52,6 +52,9 @@
+
+ #include <assert.h>
+
++#if POSTGIS_PGSQL_VERSION >= 100
++#include <float.h>
++#endif
+
+ /* Fall back to older finite() if necessary */
+ #ifndef HAVE_ISFINITE
+diff --git a/raster/rt_pg/rtpostgis.sql.in b/raster/rt_pg/rtpostgis.sql.in
+index 295892d22..9175705d2 100644
+--- a/raster/rt_pg/rtpostgis.sql.in
++++ b/raster/rt_pg/rtpostgis.sql.in
+@@ -7037,7 +7037,7 @@ CREATE OR REPLACE FUNCTION
_raster_constraint_info_blocksize(rastschema name, ra
+ SELECT
+ CASE
+ WHEN strpos(s.consrc, 'ANY (ARRAY[') > 0 THEN
+- split_part((regexp_matches(s.consrc, E'ARRAY\\[(.*?){1}\\]'))[1],
',', 1)::integer
++ split_part((substring(s.consrc FROM E'ARRAY\\[(.*?){1}\\]')),
',', 1)::integer
+ ELSE
+ regexp_replace(
+ split_part(s.consrc, '= ', 2),
+diff --git a/raster/test/regress/rt_union.sql b/raster/test/regress/rt_union.sql
+index 8b47e877f..a64b23a1c 100644
+--- a/raster/test/regress/rt_union.sql
++++ b/raster/test/regress/rt_union.sql
+@@ -143,13 +143,13 @@ INSERT INTO raster_union_out
+
+ SELECT
+ uniontype,
+- x,
+- y,
+- val
++ (pp).x,
++ (pp).y,
++ (pp).val
+ FROM (
+ SELECT
+ uniontype,
+- (ST_PixelAsPoints(rast)).*
++ (ST_PixelAsPoints(rast)) AS pp
+ FROM raster_union_out
+ ) foo
+ ORDER BY uniontype, y, x;
+diff --git a/raster/test/regress/rt_union_expected
b/raster/test/regress/rt_union_expected
+index ac32ef69d..51cc3e3d2 100644
+--- a/raster/test/regress/rt_union_expected
++++ b/raster/test/regress/rt_union_expected
+@@ -53,9 +53,6 @@ SUM|3|2|2
+ SUM|2|3|2
+ SUM|3|3|2
+ NOTICE: No pixels found for band 1
+-NOTICE: No pixels found for band 1
+-NOTICE: No pixels found for band 1
+-NOTICE: No pixels found for band 1
+ COUNT|1|1|1
+ COUNT|2|1|1
+ COUNT|3|1|1
+diff --git a/regress/regress_selectivity.sql b/regress/regress_selectivity.sql
+index 82c5e70d8..ca7f2722d 100644
+--- a/regress/regress_selectivity.sql
++++ b/regress/regress_selectivity.sql
+@@ -1,3 +1,2140 @@
++-- Make example data
++
++CREATE TABLE regular_overdots_ab (
++ a integer,
++ b integer
++);
++
++COPY regular_overdots_ab (a, b) FROM stdin;
++1 1
++1 1
++1 2
++1 1
++1 2
++1 3
++1 1
++1 2
++1 3
++1 4
++1 1
++1 2
++1 3
++1 4
++1 5
++1 1
++1 2
++1 3
++1 4
++1 5
++1 6
++1 1
++1 2
++1 3
++1 4
++1 5
++1 6
++1 7
++1 1
++1 2
++1 3
++1 4
++1 5
++1 6
++1 7
++1 8
++1 1
++1 2
++1 3
++1 4
++1 5
++1 6
++1 7
++1 8
++1 9
++1 1
++1 2
++1 3
++1 4
++1 5
++1 6
++1 7
++1 8
++1 9
++1 10
++1 1
++2 1
++1 1
++2 2
++1 1
++2 2
++1 3
++2 1
++1 2
++2 3
++1 1
++2 2
++1 3
++2 4
++1 1
++2 2
++1 3
++2 4
++1 5
++2 1
++1 2
++2 3
++1 4
++2 5
++1 1
++2 2
++1 3
++2 4
++1 5
++2 6
++1 1
++2 2
++1 3
++2 4
++1 5
++2 6
++1 7
++2 1
++1 2
++2 3
++1 4
++2 5
++1 6
++2 7
++1 1
++2 2
++1 3
++2 4
++1 5
++2 6
++1 7
++2 8
++1 1
++2 2
++1 3
++2 4
++1 5
++2 6
++1 7
++2 8
++1 9
++2 1
++1 2
++2 3
++1 4
++2 5
++1 6
++2 7
++1 8
++2 9
++1 1
++2 2
++1 3
++2 4
++1 5
++2 6
++1 7
++2 8
++1 9
++2 10
++1 1
++2 1
++3 1
++1 1
++2 2
++3 1
++1 2
++2 1
++3 2
++1 1
++2 2
++3 3
++1 1
++2 2
++3 3
++1 4
++2 1
++3 2
++1 3
++2 4
++3 1
++1 2
++2 3
++3 4
++1 1
++2 2
++3 3
++1 4
++2 5
++3 1
++1 2
++2 3
++3 4
++1 5
++2 1
++3 2
++1 3
++2 4
++3 5
++1 1
++2 2
++3 3
++1 4
++2 5
++3 6
++1 1
++2 2
++3 3
++1 4
++2 5
++3 6
++1 7
++2 1
++3 2
++1 3
++2 4
++3 5
++1 6
++2 7
++3 1
++1 2
++2 3
++3 4
++1 5
++2 6
++3 7
++1 1
++2 2
++3 3
++1 4
++2 5
++3 6
++1 7
++2 8
++3 1
++1 2
++2 3
++3 4
++1 5
++2 6
++3 7
++1 8
++2 1
++3 2
++1 3
++2 4
++3 5
++1 6
++2 7
++3 8
++1 1
++2 2
++3 3
++1 4
++2 5
++3 6
++1 7
++2 8
++3 9
++1 1
++2 2
++3 3
++1 4
++2 5
++3 6
++1 7
++2 8
++3 9
++1 10
++2 1
++3 2
++1 3
++2 4
++3 5
++1 6
++2 7
++3 8
++1 9
++2 10
++3 1
++1 2
++2 3
++3 4
++1 5
++2 6
++3 7
++1 8
++2 9
++3 10
++1 1
++2 1
++3 1
++4 1
++1 1
++2 2
++3 1
++4 2
++1 1
++2 2
++3 3
++4 1
++1 2
++2 3
++3 1
++4 2
++1 3
++2 1
++3 2
++4 3
++1 1
++2 2
++3 3
++4 4
++1 1
++2 2
++3 3
++4 4
++1 5
++2 1
++3 2
++4 3
++1 4
++2 5
++3 1
++4 2
++1 3
++2 4
++3 5
++4 1
++1 2
++2 3
++3 4
++4 5
++1 1
++2 2
++3 3
++4 4
++1 5
++2 6
++3 1
++4 2
++1 3
++2 4
++3 5
++4 6
++1 1
++2 2
++3 3
++4 4
++1 5
++2 6
++3 7
++4 1
++1 2
++2 3
++3 4
++4 5
++1 6
++2 7
++3 1
++4 2
++1 3
++2 4
++3 5
++4 6
++1 7
++2 1
++3 2
++4 3
++1 4
++2 5
++3 6
++4 7
++1 1
++2 2
++3 3
++4 4
++1 5
++2 6
++3 7
++4 8
++1 1
++2 2
++3 3
++4 4
++1 5
++2 6
++3 7
++4 8
++1 9
++2 1
++3 2
++4 3
++1 4
++2 5
++3 6
++4 7
++1 8
++2 9
++3 1
++4 2
++1 3
++2 4
++3 5
++4 6
++1 7
++2 8
++3 9
++4 1
++1 2
++2 3
++3 4
++4 5
++1 6
++2 7
++3 8
++4 9
++1 1
++2 2
++3 3
++4 4
++1 5
++2 6
++3 7
++4 8
++1 9
++2 10
++3 1
++4 2
++1 3
++2 4
++3 5
++4 6
++1 7
++2 8
++3 9
++4 10
++1 1
++2 1
++3 1
++4 1
++5 1
++1 1
++2 2
++3 1
++4 2
++5 1
++1 2
++2 1
++3 2
++4 1
++5 2
++1 1
++2 2
++3 3
++4 1
++5 2
++1 3
++2 1
++3 2
++4 3
++5 1
++1 2
++2 3
++3 1
++4 2
++5 3
++1 1
++2 2
++3 3
++4 4
++5 1
++1 2
++2 3
++3 4
++4 1
++5 2
++1 3
++2 4
++3 1
++4 2
++5 3
++1 4
++2 1
++3 2
++4 3
++5 4
++1 1
++2 2
++3 3
++4 4
++5 5
++1 1
++2 2
++3 3
++4 4
++5 5
++1 6
++2 1
++3 2
++4 3
++5 4
++1 5
++2 6
++3 1
++4 2
++5 3
++1 4
++2 5
++3 6
++4 1
++5 2
++1 3
++2 4
++3 5
++4 6
++5 1
++1 2
++2 3
++3 4
++4 5
++5 6
++1 1
++2 2
++3 3
++4 4
++5 5
++1 6
++2 7
++3 1
++4 2
++5 3
++1 4
++2 5
++3 6
++4 7
++5 1
++1 2
++2 3
++3 4
++4 5
++5 6
++1 7
++2 1
++3 2
++4 3
++5 4
++1 5
++2 6
++3 7
++4 1
++5 2
++1 3
++2 4
++3 5
++4 6
++5 7
++1 1
++2 2
++3 3
++4 4
++5 5
++1 6
++2 7
++3 8
++4 1
++5 2
++1 3
++2 4
++3 5
++4 6
++5 7
++1 8
++2 1
++3 2
++4 3
++5 4
++1 5
++2 6
++3 7
++4 8
++5 1
++1 2
++2 3
++3 4
++4 5
++5 6
++1 7
++2 8
++3 1
++4 2
++5 3
++1 4
++2 5
++3 6
++4 7
++5 8
++1 1
++2 2
++3 3
++4 4
++5 5
++1 6
++2 7
++3 8
++4 9
++5 1
++1 2
++2 3
++3 4
++4 5
++5 6
++1 7
++2 8
++3 9
++4 1
++5 2
++1 3
++2 4
++3 5
++4 6
++5 7
++1 8
++2 9
++3 1
++4 2
++5 3
++1 4
++2 5
++3 6
++4 7
++5 8
++1 9
++2 1
++3 2
++4 3
++5 4
++1 5
++2 6
++3 7
++4 8
++5 9
++1 1
++2 2
++3 3
++4 4
++5 5
++1 6
++2 7
++3 8
++4 9
++5 10
++1 1
++2 1
++3 1
++4 1
++5 1
++6 1
++1 1
++2 2
++3 1
++4 2
++5 1
++6 2
++1 1
++2 2
++3 3
++4 1
++5 2
++6 3
++1 1
++2 2
++3 3
++4 4
++5 1
++6 2
++1 3
++2 4
++3 1
++4 2
++5 3
++6 4
++1 1
++2 2
++3 3
++4 4
++5 5
++6 1
++1 2
++2 3
++3 4
++4 5
++5 1
++6 2
++1 3
++2 4
++3 5
++4 1
++5 2
++6 3
++1 4
++2 5
++3 1
++4 2
++5 3
++6 4
++1 5
++2 1
++3 2
++4 3
++5 4
++6 5
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++1 7
++2 1
++3 2
++4 3
++5 4
++6 5
++1 6
++2 7
++3 1
++4 2
++5 3
++6 4
++1 5
++2 6
++3 7
++4 1
++5 2
++6 3
++1 4
++2 5
++3 6
++4 7
++5 1
++6 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++1 7
++2 8
++3 1
++4 2
++5 3
++6 4
++1 5
++2 6
++3 7
++4 8
++5 1
++6 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++1 7
++2 8
++3 9
++4 1
++5 2
++6 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 9
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++1 7
++2 8
++3 9
++4 10
++5 1
++6 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++1 9
++2 10
++3 1
++4 2
++5 3
++6 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 10
++1 1
++2 1
++3 1
++4 1
++5 1
++6 1
++7 1
++1 1
++2 2
++3 1
++4 2
++5 1
++6 2
++7 1
++1 2
++2 1
++3 2
++4 1
++5 2
++6 1
++7 2
++1 1
++2 2
++3 3
++4 1
++5 2
++6 3
++7 1
++1 2
++2 3
++3 1
++4 2
++5 3
++6 1
++7 2
++1 3
++2 1
++3 2
++4 3
++5 1
++6 2
++7 3
++1 1
++2 2
++3 3
++4 4
++5 1
++6 2
++7 3
++1 4
++2 1
++3 2
++4 3
++5 4
++6 1
++7 2
++1 3
++2 4
++3 1
++4 2
++5 3
++6 4
++7 1
++1 2
++2 3
++3 4
++4 1
++5 2
++6 3
++7 4
++1 1
++2 2
++3 3
++4 4
++5 5
++6 1
++7 2
++1 3
++2 4
++3 5
++4 1
++5 2
++6 3
++7 4
++1 5
++2 1
++3 2
++4 3
++5 4
++6 5
++7 1
++1 2
++2 3
++3 4
++4 5
++5 1
++6 2
++7 3
++1 4
++2 5
++3 1
++4 2
++5 3
++6 4
++7 5
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 1
++7 2
++1 3
++2 4
++3 5
++4 6
++5 1
++6 2
++7 3
++1 4
++2 5
++3 6
++4 1
++5 2
++6 3
++7 4
++1 5
++2 6
++3 1
++4 2
++5 3
++6 4
++7 5
++1 6
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++1 8
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++1 7
++2 8
++3 1
++4 2
++5 3
++6 4
++7 5
++1 6
++2 7
++3 8
++4 1
++5 2
++6 3
++7 4
++1 5
++2 6
++3 7
++4 8
++5 1
++6 2
++7 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 1
++7 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++1 8
++2 9
++3 1
++4 2
++5 3
++6 4
++7 5
++1 6
++2 7
++3 8
++4 9
++5 1
++6 2
++7 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 9
++7 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++1 9
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++1 7
++2 8
++3 9
++4 1
++5 2
++6 3
++7 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 1
++7 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 9
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++1 8
++2 9
++3 10
++4 1
++5 2
++6 3
++7 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 10
++7 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++1 9
++2 10
++3 1
++4 2
++5 3
++6 4
++7 5
++1 6
++2 7
++3 8
++4 9
++5 10
++6 1
++7 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 9
++1 10
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++1 7
++2 8
++3 9
++4 10
++5 1
++6 2
++7 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 9
++7 10
++1 1
++2 1
++3 1
++4 1
++5 1
++6 1
++7 1
++8 1
++1 1
++2 2
++3 1
++4 2
++5 1
++6 2
++7 1
++8 2
++1 1
++2 2
++3 3
++4 1
++5 2
++6 3
++7 1
++8 2
++1 3
++2 1
++3 2
++4 3
++5 1
++6 2
++7 3
++8 1
++1 2
++2 3
++3 1
++4 2
++5 3
++6 1
++7 2
++8 3
++1 1
++2 2
++3 3
++4 4
++5 1
++6 2
++7 3
++8 4
++1 1
++2 2
++3 3
++4 4
++5 5
++6 1
++7 2
++8 3
++1 4
++2 5
++3 1
++4 2
++5 3
++6 4
++7 5
++8 1
++1 2
++2 3
++3 4
++4 5
++5 1
++6 2
++7 3
++8 4
++1 5
++2 1
++3 2
++4 3
++5 4
++6 5
++7 1
++8 2
++1 3
++2 4
++3 5
++4 1
++5 2
++6 3
++7 4
++8 5
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 1
++8 2
++1 3
++2 4
++3 5
++4 6
++5 1
++6 2
++7 3
++8 4
++1 5
++2 6
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 1
++8 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 1
++7 2
++8 3
++1 4
++2 5
++3 6
++4 7
++5 1
++6 2
++7 3
++8 4
++1 5
++2 6
++3 7
++4 1
++5 2
++6 3
++7 4
++8 5
++1 6
++2 7
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++1 7
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++1 9
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++1 8
++2 9
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++1 7
++2 8
++3 9
++4 1
++5 2
++6 3
++7 4
++8 5
++1 6
++2 7
++3 8
++4 9
++5 1
++6 2
++7 3
++8 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 1
++7 2
++8 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 9
++7 1
++8 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 9
++8 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++8 9
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++1 9
++2 10
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++1 7
++2 8
++3 9
++4 10
++5 1
++6 2
++7 3
++8 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 10
++7 1
++8 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 9
++8 10
++1 1
++2 1
++3 1
++4 1
++5 1
++6 1
++7 1
++8 1
++9 1
++1 1
++2 2
++3 1
++4 2
++5 1
++6 2
++7 1
++8 2
++9 1
++1 2
++2 1
++3 2
++4 1
++5 2
++6 1
++7 2
++8 1
++9 2
++1 1
++2 2
++3 3
++4 1
++5 2
++6 3
++7 1
++8 2
++9 3
++1 1
++2 2
++3 3
++4 4
++5 1
++6 2
++7 3
++8 4
++9 1
++1 2
++2 3
++3 4
++4 1
++5 2
++6 3
++7 4
++8 1
++9 2
++1 3
++2 4
++3 1
++4 2
++5 3
++6 4
++7 1
++8 2
++9 3
++1 4
++2 1
++3 2
++4 3
++5 4
++6 1
++7 2
++8 3
++9 4
++1 1
++2 2
++3 3
++4 4
++5 5
++6 1
++7 2
++8 3
++9 4
++1 5
++2 1
++3 2
++4 3
++5 4
++6 5
++7 1
++8 2
++9 3
++1 4
++2 5
++3 1
++4 2
++5 3
++6 4
++7 5
++8 1
++9 2
++1 3
++2 4
++3 5
++4 1
++5 2
++6 3
++7 4
++8 5
++9 1
++1 2
++2 3
++3 4
++4 5
++5 1
++6 2
++7 3
++8 4
++9 5
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 1
++8 2
++9 3
++1 4
++2 5
++3 6
++4 1
++5 2
++6 3
++7 4
++8 5
++9 6
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 1
++9 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 1
++7 2
++8 3
++9 4
++1 5
++2 6
++3 7
++4 1
++5 2
++6 3
++7 4
++8 5
++9 6
++1 7
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++9 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 1
++8 2
++9 3
++1 4
++2 5
++3 6
++4 7
++5 1
++6 2
++7 3
++8 4
++9 5
++1 6
++2 7
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 7
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++9 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++8 1
++9 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 1
++8 2
++9 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 1
++7 2
++8 3
++9 4
++1 5
++2 6
++3 7
++4 8
++5 1
++6 2
++7 3
++8 4
++9 5
++1 6
++2 7
++3 8
++4 1
++5 2
++6 3
++7 4
++8 5
++9 6
++1 7
++2 8
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 7
++1 8
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++9 8
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++9 9
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++9 9
++1 10
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++9 8
++1 9
++2 10
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 7
++1 8
++2 9
++3 10
++4 1
++5 2
++6 3
++7 4
++8 5
++9 6
++1 7
++2 8
++3 9
++4 10
++5 1
++6 2
++7 3
++8 4
++9 5
++1 6
++2 7
++3 8
++4 9
++5 10
++6 1
++7 2
++8 3
++9 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 10
++7 1
++8 2
++9 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 9
++7 10
++8 1
++9 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 9
++8 10
++9 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++8 9
++9 10
++1 1
++2 1
++3 1
++4 1
++5 1
++6 1
++7 1
++8 1
++9 1
++10 1
++1 1
++2 2
++3 1
++4 2
++5 1
++6 2
++7 1
++8 2
++9 1
++10 2
++1 1
++2 2
++3 3
++4 1
++5 2
++6 3
++7 1
++8 2
++9 3
++10 1
++1 2
++2 3
++3 1
++4 2
++5 3
++6 1
++7 2
++8 3
++9 1
++10 2
++1 3
++2 1
++3 2
++4 3
++5 1
++6 2
++7 3
++8 1
++9 2
++10 3
++1 1
++2 2
++3 3
++4 4
++5 1
++6 2
++7 3
++8 4
++9 1
++10 2
++1 3
++2 4
++3 1
++4 2
++5 3
++6 4
++7 1
++8 2
++9 3
++10 4
++1 1
++2 2
++3 3
++4 4
++5 5
++6 1
++7 2
++8 3
++9 4
++10 5
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 1
++8 2
++9 3
++10 4
++1 5
++2 6
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 1
++10 2
++1 3
++2 4
++3 5
++4 6
++5 1
++6 2
++7 3
++8 4
++9 5
++10 6
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 1
++9 2
++10 3
++1 4
++2 5
++3 6
++4 7
++5 1
++6 2
++7 3
++8 4
++9 5
++10 6
++1 7
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++9 1
++10 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 1
++7 2
++8 3
++9 4
++10 5
++1 6
++2 7
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 7
++10 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 1
++8 2
++9 3
++10 4
++1 5
++2 6
++3 7
++4 1
++5 2
++6 3
++7 4
++8 5
++9 6
++10 7
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++9 1
++10 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 1
++8 2
++9 3
++10 4
++1 5
++2 6
++3 7
++4 8
++5 1
++6 2
++7 3
++8 4
++9 5
++10 6
++1 7
++2 8
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 7
++10 8
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++9 9
++10 1
++1 2
++2 3
++3 4
++4 5
++5 6
++6 7
++7 8
++8 9
++9 1
++10 2
++1 3
++2 4
++3 5
++4 6
++5 7
++6 8
++7 9
++8 1
++9 2
++10 3
++1 4
++2 5
++3 6
++4 7
++5 8
++6 9
++7 1
++8 2
++9 3
++10 4
++1 5
++2 6
++3 7
++4 8
++5 9
++6 1
++7 2
++8 3
++9 4
++10 5
++1 6
++2 7
++3 8
++4 9
++5 1
++6 2
++7 3
++8 4
++9 5
++10 6
++1 7
++2 8
++3 9
++4 1
++5 2
++6 3
++7 4
++8 5
++9 6
++10 7
++1 8
++2 9
++3 1
++4 2
++5 3
++6 4
++7 5
++8 6
++9 7
++10 8
++1 9
++2 1
++3 2
++4 3
++5 4
++6 5
++7 6
++8 7
++9 8
++10 9
++1 1
++2 2
++3 3
++4 4
++5 5
++6 6
++7 7
++8 8
++9 9
++10 10
++\.
++
+
+ -- Check for error messages
+ create table no_stats ( g geometry, id integer );
+@@ -8,15 +2145,12 @@ select _postgis_join_selectivity('no_stats', 'g',
'no_stats_join', 'g');
+ insert into no_stats (g, id) values ('POINT(0 0)', 0);
+ analyze no_stats;
+ select _postgis_join_selectivity('no_stats', 'g',
'no_stats_join', 'g');
+-drop table no_stats;
+-drop table no_stats_join;
++drop table if exists no_stats;
++drop table if exists no_stats_join;
+
+ -- Table with uniformly variable density, highest at 1,1, lowest at 10,10
+ create table regular_overdots as
+-with
+-ij as ( select i, j from generate_series(1, 10) i, generate_series(1, 10) j),
+-iijj as (select generate_series(1, i) as a, generate_series(1, j) b from ij)
+-select st_makepoint(a, b) as g from iijj;
++ select st_makepoint(a, b) as g from regular_overdots_ab;
+
+ -- Generate the stats
+ analyze regular_overdots;
+@@ -49,4 +2183,5 @@ select 'selectivity_09', 'estimated',
_postgis_selectivity('regular_overdots','g
+
+ -- Clean
+ drop table if exists regular_overdots;
++drop table if exists regular_overdots_ab;
+
+diff --git a/topology/sql/topogeometry/totopogeom.sql.in
b/topology/sql/topogeometry/totopogeom.sql.in
+index 79520c64e..6d3192de0 100644
+--- a/topology/sql/topogeometry/totopogeom.sql.in
++++ b/topology/sql/topogeometry/totopogeom.sql.in
+@@ -139,6 +139,7 @@ DECLARE
+ tolerance FLOAT8;
+ alayer INT;
+ atopology TEXT;
++ var_dims integer;
+ BEGIN
+
+ #ifdef POSTGIS_TOPOLOGY_DEBUG
+@@ -230,23 +231,31 @@ BEGIN
+ 'Unexpected feature dimension %', ST_Dimension(ageom);
+ END IF;
+
++
+ -- Now that we have an empty topogeometry, we loop over distinct components
+ -- and add them to the definition of it. We add them as soon
+ -- as possible so that each element can further edit the
+ -- definition by splitting
+ FOR rec IN SELECT id(tg), alayer as lyr,
+- geom, ST_Dimension(geom) as dims
+- FROM (SELECT (ST_Dump(ageom)).geom) as f
+- WHERE NOT ST_IsEmpty(geom)
++ geom, ST_Dimension(gd.geom) as dims
++ FROM ST_Dump(ageom) AS gd
++ WHERE NOT ST_IsEmpty(gd.geom)
+ LOOP
+- FOR rec2 IN SELECT CASE
+- WHEN rec.dims = 0 THEN
+- topology.topogeo_addPoint(atopology, rec.geom, tolerance)
+- WHEN rec.dims = 1 THEN
+- topology.topogeo_addLineString(atopology, rec.geom, tolerance)
+- WHEN rec.dims = 2 THEN
+- topology.topogeo_addPolygon(atopology, rec.geom, tolerance)
+- END as primitive
++ -- NOTE: Switched from using case to this because of PG 10 behavior change
++ -- Using a UNION ALL only one will be processed because of the WHERE
++ -- Since the WHERE clause will be processed first
++ FOR rec2 IN SELECT primitive
++ FROM
++ (
++ SELECT topology.topogeo_addPoint(atopology, rec.geom, tolerance)
++ WHERE rec.dims = 0
++ UNION ALL
++ SELECT topology.topogeo_addLineString(atopology, rec.geom, tolerance)
++ WHERE rec.dims = 1
++ UNION ALL
++ SELECT topology.topogeo_addPolygon(atopology, rec.geom, tolerance)
++ WHERE rec.dims = 2
++ ) AS f(primitive)
+ LOOP
+ elem := ARRAY[rec.dims+1, rec2.primitive]::text;
+ IF elems @> ARRAY[elem] THEN
+diff --git a/topology/test/regress/copytopology.sql
b/topology/test/regress/copytopology.sql
+index 414e01993..182ff493c 100644
+--- a/topology/test/regress/copytopology.sql
++++ b/topology/test/regress/copytopology.sql
+@@ -39,13 +39,13 @@ WHERE l.topology_id = t.id and t.name = 'CITY_data_UP_down'
+ ORDER BY l.layer_id;
+
+ -- Check sequences
+-SELECT * from "CITY_data_UP_down".node_node_id_seq;
+-SELECT * from "CITY_data_UP_down".edge_data_edge_id_seq;
+-SELECT * from "CITY_data_UP_down".face_face_id_seq;
+-SELECT sequence_name, last_value, start_value, increment_by, max_value, min_value,
cache_value, is_cycled, is_called from "CITY_data_UP_down".layer_id_seq;
+-SELECT * from "CITY_data_UP_down".topogeo_s_1;
+-SELECT * from "CITY_data_UP_down".topogeo_s_2;
+-SELECT * from "CITY_data_UP_down".topogeo_s_3;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".node_node_id_seq;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".edge_data_edge_id_seq;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".face_face_id_seq;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".layer_id_seq;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".topogeo_s_1;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".topogeo_s_2;
++SELECT tableoid::regclass AS sequence_name, last_value, is_called from
"CITY_data_UP_down".topogeo_s_3;
+
+ SELECT topology.DropTopology('CITY_data_UP_down');
+ SELECT topology.DropTopology('city_data');
+diff --git a/topology/test/regress/copytopology_expected
b/topology/test/regress/copytopology_expected
+index 95083dbbf..ffdb1316b 100644
+--- a/topology/test/regress/copytopology_expected
++++ b/topology/test/regress/copytopology_expected
+@@ -19,13 +19,13 @@ layers|3
+ 1|CITY_data_UP_down|LAYER1|
+ 2|CITY_data_UP_down|LAYER2|
+ 3|CITY_data_UP_down|LAYER3|
+-node_node_id_seq|22|1|1|9223372036854775807|1|1|0|f|t
+-edge_data_edge_id_seq|26|1|1|9223372036854775807|1|1|0|f|t
+-face_face_id_seq|9|1|1|9223372036854775807|1|1|0|f|t
+-layer_id_seq|1|1|1|9223372036854775807|1|1|f|f
+-topogeo_s_1|9|1|1|9223372036854775807|1|1|0|f|t
+-topogeo_s_2|8|1|1|9223372036854775807|1|1|0|f|t
+-topogeo_s_3|8|1|1|9223372036854775807|1|1|0|f|t
++"CITY_data_UP_down".node_node_id_seq|22|t
++"CITY_data_UP_down".edge_data_edge_id_seq|26|t
++"CITY_data_UP_down".face_face_id_seq|9|t
++"CITY_data_UP_down".layer_id_seq|1|f
++"CITY_data_UP_down".topogeo_s_1|9|t
++"CITY_data_UP_down".topogeo_s_2|8|t
++"CITY_data_UP_down".topogeo_s_3|8|t
+ Topology 'CITY_data_UP_down' dropped
+ Topology 'city_data' dropped
+ #2184.1|t
+--
+2.13.6
+
diff --git a/postgis.spec b/postgis.spec
index fd7cbe2..a42041b 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -6,6 +6,7 @@
%global majorversion 2.4
%global prevmajorversion 2.3
%global prevversion %{prevmajorversion}.3
+%global so_files rtpostgis postgis_topology postgis address_standardizer
%global pg_version_minimum 9.2
@@ -17,10 +18,12 @@ License: GPLv2+
Group: Applications/Databases
Source0:
http://download.osgeo.org/%{name}/source/%{name}-%{version}.tar.gz
Source2:
http://download.osgeo.org/%{name}/docs/%{name}-%{version}.pdf
+%if %upgrade
Source3:
http://download.osgeo.org/%{name}/source/%{name}-%{prevversion}.tar.gz
+%endif
Source4: filter-requires-perl-Pg.sh
-# CFLAGS are reset before AC_CHECK_LIBRARY, but -fPIC is necessary to link against gdal
Patch1: postgis-configureac21.patch
+Patch2: postgis-2.4.0-upgrade-2.3.3.patch
URL:
http://www.postgis.net
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -29,6 +32,9 @@ BuildRequires: postgresql-devel >= %{pg_version_minimum}, proj-devel,
geos-devel
BuildRequires: gtk2-devel, libxml2-devel, gdal-devel >= 1.10.0
BuildRequires: pcre-devel
BuildRequires: autoconf, automake, libtool
+%if %upgrade
+BuildRequires: postgresql-upgrade-devel
+%endif
Requires: postgresql-server(:MODULE_COMPAT_%{postgresql_major})
Requires: geos >= 3.4.2, proj, gdal >= 1.10.0, json-c
@@ -89,7 +95,6 @@ The postgis-utils package provides the utilities for PostGIS.
Summary: Support for upgrading from the previous major release of Postgis
Group: Applications/Databases
Requires: %{name}%{?_isa} = %{version}-%{release}
-BuildRequires: postgresql-upgrade-devel
%description upgrade
The postgis-upgrade package contains the previous version of postgis
@@ -99,16 +104,20 @@ necessary for correct dump of schema from previous version of
PostgreSQL.
%define __perl_requires %{SOURCE4}
%prep
-%setup -q -n %{name}-%{version}
+%setup -q -n %{name}-%{version} -a 3
+(
+cd %{name}-%{prevversion}
+# Remove once we move to prevversion==2.4 (2.4 build works fine).
%patch1 -p0 -b .configureac21
-# Copy .pdf file to top directory before installing.
+./autogen.sh
+%patch2 -p1
+)
cp -p %{SOURCE2} .
+
%build
-./autogen.sh
%configure --with-gui --enable-raster
-# FIXME {_smp_mflags} macro doesn't work
-make LPATH=`pg_config --pkglibdir` shlib="%{name}.so"
+make %{?_smp_mflags}
%if %javabuild
export BUILDXML_DIR=%{_builddir}/%{name}-%{version}/java/jdbc
@@ -121,16 +130,26 @@ popd
%endif
%if %utils
- make %{?_smp_mflags} -C utils
+make %{?_smp_mflags} -C utils
%endif
-# PostGIS 2.1 breaks compatibility with 2.0, and we need to ship
-# postgis-2.0.so file along with 2.1 package, so that we can upgrade:
-tar zxf %{SOURCE3}
+(
+# TODO: report that out-of-tree (VPATH) build is broken
cd %{name}-%{prevversion}
-%configure --without-raster --disable-rpath --without-json
-make %{?_smp_mflags} LPATH=`%[_bindir}/pg_config --pkglibdir`
shlib="%{name}-%{prevmajorversion}.so"
+# first perform compat-build (against the actual PostgreSQL version). We need
+# only the so names.
+%configure --enable-raster
+make %{?_smp_mflags}
+mkdir ../compat-build
+for so in %so_files; do
+ find -name $so-%prevmajorversion.so -exec cp -t ../compat-build/ {} +
+done
+
+# second, build feature-full build against previous PostgreSQL version
+%configure --enable-raster --with-pgconfig=/usr/lib64/pgsql/postgresql-9.6/bin/pg_config
+make %{?_smp_mflags}
+)
%install
rm -rf %{buildroot}
@@ -140,10 +159,14 @@ make %{?_smp_mflags} -C extensions install DESTDIR=%{buildroot}
rm -f %{buildroot}%{_libdir}/liblwgeom.{a,la}
-# (moved into install section:
-# Install postgis-2.0.so file manually:
-%{__mkdir} -p %{buildroot}/%{_libdir}/pgsql
-%{__install} -m 644 %{name}-%{prevversion}/postgis/postgis-%{prevmajorversion}.so
%{buildroot}/%{_libdir}/pgsql/postgis-%{prevmajorversion}.so
+cd %{name}-%{prevversion}
+make install DESTDIR=%{buildroot}
+cd ..
+
+# Manually install compat-build binary.
+for so in %so_files; do
+%{__install} -m 644 compat-build/$so-%{prevmajorversion}.so
%{buildroot}/%{_libdir}/pgsql
+done
rm -f %{buildroot}%{_datadir}/*.sql
@@ -175,7 +198,6 @@ rm -rf %{buildroot}
%defattr(-,root,root)
%doc COPYING CREDITS NEWS TODO README.%{name} doc/html loader/README.* doc/%{name}.xml
doc/ZMSgeoms.txt
%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_libdir}/pgsql/%{name}-%{prevmajorversion}.so
%attr(755,root,root) %{_libdir}/pgsql/%{name}-%{majorversion}.so
%{_datadir}/pgsql/contrib/postgis-%{majorversion}/*.sql
#if {_lib} == lib64
@@ -206,6 +228,7 @@ rm -rf %{buildroot}
%{_includedir}/liblwgeom.h
%{_includedir}/liblwgeom_topo.h
+
%if %javabuild
%files jdbc
%defattr(-,root,root)
@@ -218,6 +241,14 @@ rm -rf %{buildroot}
%endif
%endif
+
+%if %upgrade
+%files upgrade
+%_libdir/pgsql/postgresql-9.6/*
+%_libdir/pgsql/*-%{prevmajorversion}.so
+%endif
+
+
%if %utils
%files utils
%defattr(755,root,root)
@@ -241,6 +272,9 @@ rm -rf %{buildroot}
%doc postgis*.pdf
%changelog
+* Tue Oct 10 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
+- provide postgis-upgrade package (rhbz#1475177)
+
* Mon Oct 09 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
- update to 2.4.0, per upstream release notes
https://postgis.net/2017/09/30/postgis-2.4.0/
commit cb221143c3f8973c45966b40a786d51fa8079581
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Mon Oct 9 16:31:26 2017 +0200
upgrade: Pepa's postgis-upgrade stub
Related: rhbz#1475177
Version: 2.4.0-1
diff --git a/postgis.spec b/postgis.spec
index 77e738c..fd7cbe2 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -1,6 +1,7 @@
%{!?javabuild:%global javabuild 0}
%{!?utils:%global utils 1}
%{!?gcj_support:%global gcj_support 0}
+%{!?upgrade:%global upgrade 1}
%global majorversion 2.4
%global prevmajorversion 2.3
@@ -83,6 +84,18 @@ Requires: %{name} = %{version}-%{release}, perl-DBD-Pg
The postgis-utils package provides the utilities for PostGIS.
%endif
+%if %upgrade
+%package upgrade
+Summary: Support for upgrading from the previous major release of Postgis
+Group: Applications/Databases
+Requires: %{name}%{?_isa} = %{version}-%{release}
+BuildRequires: postgresql-upgrade-devel
+
+%description upgrade
+The postgis-upgrade package contains the previous version of postgis
+necessary for correct dump of schema from previous version of PostgreSQL.
+%endif
+
%define __perl_requires %{SOURCE4}
%prep
commit 1ea80e27c746eef2bccd0ee4a0f6a7e4ac74531a
Author: Pavel Raiskup <praiskup(a)redhat.com>
Date: Mon Oct 9 15:56:52 2017 +0200
update to 2.4.0
Per upstream release notes:
https://postgis.net/2017/09/30/postgis-2.4.0/
Version: 2.4.0-1
diff --git a/.gitignore b/.gitignore
index 31ce1ac..fb7df74 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-/filter-requires-perl-Pg.sh
-/postgis-2.2.5.tar.gz
-/postgis-2.3.3.pdf
+/postgis-2.4.0.pdf
/postgis-2.3.3.tar.gz
+/postgis-2.4.0.tar.gz
diff --git a/generate-sources-and-gitignore.sh b/generate-sources-and-gitignore.sh
new file mode 100755
index 0000000..7d8aaec
--- /dev/null
+++ b/generate-sources-and-gitignore.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+rm sources .gitignore
+set -e
+spectool -S *.spec | cut -d' ' -f2 \
+ | grep -E -e 'postgis-.*\.tar\.*' -e 'postgis.*\.pdf' | sort | \
+while read line
+do
+ base=`basename "$line"`
+ echo " * handling $base"
+ sha512sum --tag "$base" >> sources
+ echo "/$base" >> .gitignore
+done
diff --git a/postgis.spec b/postgis.spec
index 7ece69c..77e738c 100644
--- a/postgis.spec
+++ b/postgis.spec
@@ -2,16 +2,16 @@
%{!?utils:%global utils 1}
%{!?gcj_support:%global gcj_support 0}
-%global majorversion 2.3
-%global prevmajorversion 2.2
-%global prevversion %{prevmajorversion}.5
+%global majorversion 2.4
+%global prevmajorversion 2.3
+%global prevversion %{prevmajorversion}.3
%global pg_version_minimum 9.2
Summary: Geographic Information Systems Extensions to PostgreSQL
Name: postgis
-Version: 2.3.3
-Release: 3%{?dist}
+Version: %majorversion.0
+Release: 1%{?dist}
License: GPLv2+
Group: Applications/Databases
Source0:
http://download.osgeo.org/%{name}/source/%{name}-%{version}.tar.gz
@@ -228,6 +228,10 @@ rm -rf %{buildroot}
%doc postgis*.pdf
%changelog
+* Mon Oct 09 2017 Pavel Raiskup <praiskup(a)redhat.com> - 2.4.0-1
+- update to 2.4.0, per upstream release notes
+
https://postgis.net/2017/09/30/postgis-2.4.0/
+
* Thu Aug 03 2017 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.3.3-3
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
diff --git a/sources b/sources
index 60de5b4..e3aa52a 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
-SHA512 (postgis-2.3.3.pdf) =
8bfba804c6e112d7a1855bdc3cf6bd855f9e600ab70aa346cbb2c4bff949483fdc1c3251b207f8c69db5d1dc03923d4f37d4d58f0a9ed628648bf3e35b8d256d
+SHA512 (postgis-2.4.0.pdf) =
b081cd5007f5927ab3fba42822e4bcfd60af8e3215cecaab579f72e1f259f2fafd0788dff0002a2fd98297a3073ceec2c01be46439630b8db7420ba7922c07e3
SHA512 (postgis-2.3.3.tar.gz) =
c0ec4b4b5c470e5f88d1bb72c528269a0cf954981385580db3333502c2da74e431b5a86e3d6427c839c3d4440122be18a69261c8205aa71c8aa4b790550c5e9c
-SHA512 (postgis-2.2.5.tar.gz) =
13069d6e6c0429acff5d6475d6b75783c3e81bc61fb528c5eba28ff125c31513b8a4df1a0870c4c835560d310bba4abf5ac8b9aa4722731f0988d617eca78ea8
+SHA512 (postgis-2.4.0.tar.gz) =
813e8e9feb75b58673afaec2dda3b5d8fc586a0f483c553795c8ae2b917bb67a9741e8c901787a0b914c327848323239346f1d816aa60b47d5a7065596de0067