1 # TODO: sfcgal support (sfcgal-config, >= 1.3.1)
2 # xml2pot for translations
3 %define pg_version %(rpm -q --queryformat '%{VERSION}' postgresql-backend-devel)
6 %bcond_without raster # disable raster support
7 %bcond_without doc # HTML documentation
8 %bcond_without gui # data import GUI
10 Summary: Geographic Information Systems Extensions to PostgreSQL
11 Summary(pl.UTF-8): Rozszerzenie do PostgreSQL wspomagające Geograficzne Systemy Informacyjne
16 Group: Applications/Databases
17 Source0: https://download.osgeo.org/postgis/source/%{name}-%{version}.tar.gz
18 # Source0-md5: bf93409054c46c6306f9991989214e8d
19 Patch0: install-lwgeom.patch
20 URL: http://postgis.refractions.net/
24 %{?with_raster:BuildRequires: gdal-devel >= 2.0.0}
25 BuildRequires: geos-devel >= 3.6.0
26 BuildRequires: json-c-devel
27 BuildRequires: libstdc++-devel >= 6:4.7
28 BuildRequires: libxml2-devel >= 2.0
29 BuildRequires: pcre2-8-devel
30 BuildRequires: perl-base
31 BuildRequires: pkgconfig
32 BuildRequires: postgresql-backend-devel >= 11
33 BuildRequires: postgresql-devel >= 11
34 BuildRequires: proj-devel >= 4.9.0
35 BuildRequires: protobuf-c-devel >= 1.1.0
37 BuildRequires: ImageMagick
38 BuildRequires: docbook-style-xsl
39 BuildRequires: libxml2-progs
40 BuildRequires: libxslt-progs
41 # TODO: mathml DTD (http://www.w3.org/Math/DTD/mathml2/mathml2.dtd, e.g. /usr/share/xml/schema/w3c/mathml/dtd)
44 BuildRequires: gtk+2-devel >= 2:2.8.0
45 BuildRequires: pkgconfig
47 %{?with_raster:Requires: gdal >= 2.0.0}
48 Requires: liblwgeom = %{version}-%{release}
49 Requires: postgresql >= %{pg_version}
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 %define specflags_x86_64 -fPIC
54 # clang can't parse this
55 %define filterout -fvar-tracking-assignments
57 # oh well... I also don't understand this... ;)
60 This package contains a module which implements GIS simple features,
61 ties the features to rtree indexing, and provides some spatial
62 functions for accessing and analyzing geographic data.
64 %description -l pl.UTF-8
65 Pakiet ten zawiera moduł implementujący proste funkcje GIS, wiąże je z
66 indeksowaniem rtree oraz dostarcza funkcje dostępu oraz analizy danych
70 Summary: Data import GUI for PostGIS
71 Summary(pl.UTF-8): Graficzny interfejs użytkownika importujący dane dla PostGIS-a
72 Group: X11/Applications
73 Requires: %{name} = %{version}-%{release}
74 Requires: gtk+2 >= 2:2.8.0
77 Data import GUI for PostGIS.
79 %description gui -l pl.UTF-8
80 Graficzny interfejs użytkownika importujący dane dla PostGIS-a.
83 Summary: lwgeom library (a part of PostGIS project)
84 Summary(pl.UTF-8): Biblioteka lwgeom (część projektu PostGIS)
86 Requires: geos >= 3.6.0
87 Requires: proj >= 4.9.0
88 Conflicts: postgis < 2.0.0-2
90 %description -n liblwgeom
91 lwgeom library (a part of PostGIS project).
93 %description -n liblwgeom -l pl.UTF-8
94 Biblioteka lwgeom (część projektu PostGIS).
96 %package -n liblwgeom-devel
97 Summary: Header file for lwgeom library
98 Summary(pl.UTF-8): Plik nagłówkowy biblioteki lwgeom
99 Group: Development/Libraries
100 Requires: geos-devel >= 3.6.0
101 Requires: liblwgeom = %{version}-%{release}
102 Requires: proj-devel >= 4.9.0
104 %description -n liblwgeom-devel
105 Header file for lwgeom library.
107 %description -n liblwgeom-devel -l pl.UTF-8
108 Plik nagłówkowy biblioteki lwgeom.
110 %package -n liblwgeom-static
111 Summary: Static lwgeom library
112 Summary(pl.UTF-8): Statyczna biblioteka lwgeom
113 Group: Development/Libraries
114 Requires: liblwgeom-devel = %{version}-%{release}
116 %description -n liblwgeom-static
117 Static lwgeom library.
119 %description -n liblwgeom-static -l pl.UTF-8
120 Statyczna biblioteka lwgeom.
127 export CFLAGS="%{rpmcflags} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"
129 %{?with_gui:--with-gui} \
130 %{!?with_raster:--without-raster}
135 rm -rf $RPM_BUILD_ROOT
138 DESTDIR=$RPM_BUILD_ROOT
140 %{__sed} -e '/#include .*/d' postgis_config.h > $RPM_BUILD_ROOT%{_includedir}/postgis_config.h
141 %{__sed} -i -e 's/#include.*postgis_config.*/#include "postgis_config.h"/' $RPM_BUILD_ROOT%{_includedir}/liblwgeom.h
143 # Fix icons and desktop file locations
144 %{__mv} $RPM_BUILD_ROOT%{_datadir}/{postgresql,}/icons
145 %{__mv} $RPM_BUILD_ROOT%{_datadir}/{postgresql,}/applications
147 %{__rm} -r $RPM_BUILD_ROOT%{_iconsdir}/hicolor/40x40
150 rm -rf $RPM_BUILD_ROOT
152 %post -n liblwgeom -p /sbin/ldconfig
153 %postun -n liblwgeom -p /sbin/ldconfig
156 %defattr(644,root,root,755)
157 %doc CREDITS LICENSE.TXT NEWS README.postgis TODO %{?with_doc:doc/html}
158 %attr(755,root,root) %{_bindir}/pgsql2shp
159 %attr(755,root,root) %{_bindir}/pgtopo_export
160 %attr(755,root,root) %{_bindir}/pgtopo_import
161 %attr(755,root,root) %{_bindir}/shp2pgsql
162 %attr(755,root,root) %{_libdir}/postgresql/address_standardizer-3.so
163 %attr(755,root,root) %{_libdir}/postgresql/postgis-3.so
164 %attr(755,root,root) %{_libdir}/postgresql/postgis_topology-3.so
165 %dir %{_libdir}/postgresql/bitcode
166 %{_libdir}/postgresql/bitcode/address_standardizer-3.index.bc
167 %dir %{_libdir}/postgresql/bitcode/address_standardizer-3
168 %{_libdir}/postgresql/bitcode/address_standardizer-3/*.bc
169 %{_libdir}/postgresql/bitcode/postgis-3.index.bc
170 %dir %{_libdir}/postgresql/bitcode/postgis-3
171 %{_libdir}/postgresql/bitcode/postgis-3/*.bc
172 %{_libdir}/postgresql/bitcode/postgis_topology-3.index.bc
173 %dir %{_libdir}/postgresql/bitcode/postgis_topology-3
174 %{_libdir}/postgresql/bitcode/postgis_topology-3/*.bc
175 %{_datadir}/postgresql/contrib/postgis-3.3
176 %{_datadir}/postgresql/extension/address_standardizer*.sql
177 %{_datadir}/postgresql/extension/address_standardizer*.control
178 %{_datadir}/postgresql/extension/postgis*.control
179 %{_datadir}/postgresql/extension/postgis*.sql
181 %attr(755,root,root) %{_bindir}/raster2pgsql
182 %attr(755,root,root) %{_libdir}/postgresql/postgis_raster-3.so
183 %{_libdir}/postgresql/bitcode/postgis_raster-3.index.bc
184 %dir %{_libdir}/postgresql/bitcode/postgis_raster-3
185 %{_libdir}/postgresql/bitcode/postgis_raster-3/*.bc
190 %defattr(644,root,root,755)
191 %attr(755,root,root) %{_bindir}/shp2pgsql-gui
192 %{_desktopdir}/shp2pgsql-gui.desktop
193 %{_iconsdir}/hicolor/*x*/apps/shp2pgsql-gui.png
197 %defattr(644,root,root,755)
198 %attr(755,root,root) %{_libdir}/liblwgeom-3.3.so.*.*.*
199 %attr(755,root,root) %ghost %{_libdir}/liblwgeom-3.3.so.0
201 %files -n liblwgeom-devel
202 %defattr(644,root,root,755)
203 %attr(755,root,root) %{_libdir}/liblwgeom.so
204 %{_libdir}/liblwgeom.la
205 %{_includedir}/liblwgeom.h
206 %{_includedir}/liblwgeom_topo.h
207 %{_includedir}/lwinline.h
208 %{_includedir}/postgis_config.h
210 %files -n liblwgeom-static
211 %defattr(644,root,root,755)
212 %{_libdir}/liblwgeom.a