1 # TODO: sfcgal support (sfcgal-config, >= 1.1.0)
2 %define pg_version %(rpm -q --queryformat '%{VERSION}' postgresql-backend-devel)
5 %bcond_without raster # disable raster support
6 %bcond_without doc # HTML documentation
7 %bcond_without gui # data import GUI
9 Summary: Geographic Information Systems Extensions to PostgreSQL
10 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}%{subver}.tar.gz
18 # Source0-md5: 725019e3a67ac52ccef4d00031cb0c77
19 Patch0: install-lwgeom.patch
20 URL: http://postgis.refractions.net/
21 %{?with_raster:BuildRequires: gdal-devel >= 1.8.0}
23 BuildRequires: geos-devel >= 3.5.0
24 BuildRequires: json-c-devel
25 BuildRequires: libstdc++-devel
26 BuildRequires: libxml2-devel >= 2.0
27 BuildRequires: pcre-devel
28 BuildRequires: perl-base
29 BuildRequires: postgresql-backend-devel >= 9.1
30 BuildRequires: postgresql-devel >= 9.1
31 BuildRequires: proj-devel >= 4.6.0
33 BuildRequires: ImageMagick
34 BuildRequires: docbook-style-xsl
35 BuildRequires: libxml2-progs
36 BuildRequires: libxslt-progs
37 # TODO: mathml DTD (http://www.w3.org/Math/DTD/mathml2/mathml2.dtd, e.g. /usr/share/xml/schema/w3c/mathml/dtd)
40 BuildRequires: gtk+2-devel >= 2:2.8.0
41 BuildRequires: pkgconfig
43 %{?with_raster:Requires: gdal >= 1.8.0}
44 Requires: liblwgeom = %{version}-%{release}
45 Requires: postgresql >= %{pg_version}
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 %define specflags_x86_64 -fPIC
50 # clang can't parse this
51 %define filterout -fvar-tracking-assignments
53 # oh well... I also don't understand this... ;)
56 This package contains a module which implements GIS simple features,
57 ties the features to rtree indexing, and provides some spatial
58 functions for accessing and analyzing geographic data.
60 %description -l pl.UTF-8
61 Pakiet ten zawiera moduł implementujący proste funkcje GIS, wiąże je z
62 indeksowaniem rtree oraz dostarcza funkcje dostępu oraz analizy danych
66 Summary: Data import GUI for PostGIS
67 Summary(pl.UTF-8): Graficzny interfejs użytkownika importujący dane dla PostGIS-a
68 Group: X11/Applications
69 Requires: %{name} = %{version}-%{release}
70 Requires: gtk+2 >= 2:2.8.0
73 Data import GUI for PostGIS.
75 %description gui -l pl.UTF-8
76 Graficzny interfejs użytkownika importujący dane dla PostGIS-a.
79 Summary: lwgeom library (a part of PostGIS project)
80 Summary(pl.UTF-8): Biblioteka lwgeom (część projektu PostGIS)
82 Requires: geos >= 3.5.0
83 Requires: proj >= 4.6.0
84 Conflicts: postgis < 2.0.0-2
86 %description -n liblwgeom
87 lwgeom library (a part of PostGIS project).
89 %description -n liblwgeom -l pl.UTF-8
90 Biblioteka lwgeom (część projektu PostGIS).
92 %package -n liblwgeom-devel
93 Summary: Header file for lwgeom library
94 Summary(pl.UTF-8): Plik nagłówkowy biblioteki lwgeom
95 Group: Development/Libraries
96 Requires: geos-devel >= 3.5.0
97 Requires: liblwgeom = %{version}-%{release}
98 Requires: proj-devel >= 4.6.0
100 %description -n liblwgeom-devel
101 Header file for lwgeom library.
103 %description -n liblwgeom-devel -l pl.UTF-8
104 Plik nagłówkowy biblioteki lwgeom.
106 %package -n liblwgeom-static
107 Summary: Static lwgeom library
108 Summary(pl.UTF-8): Statyczna biblioteka lwgeom
109 Group: Development/Libraries
110 Requires: liblwgeom-devel = %{version}-%{release}
112 %description -n liblwgeom-static
113 Static lwgeom library.
115 %description -n liblwgeom-static -l pl.UTF-8
116 Statyczna biblioteka lwgeom.
119 %setup -q -n %{name}-%{version}%{subver}
123 export CFLAGS="%{rpmcflags} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H"
125 %{?with_gui:--with-gui} \
126 %{!?with_raster:--without-raster}
131 rm -rf $RPM_BUILD_ROOT
134 DESTDIR=$RPM_BUILD_ROOT
136 %{__sed} -e '/#include .*/d' postgis_config.h > $RPM_BUILD_ROOT%{_includedir}/postgis_config.h
137 %{__sed} -i -e 's/#include.*postgis_config.*/#include "postgis_config.h"/' $RPM_BUILD_ROOT%{_includedir}/liblwgeom.h
139 # Fix icons and desktop file locations
140 %{__mv} $RPM_BUILD_ROOT%{_datadir}/{postgresql,}/icons
141 %{__mv} $RPM_BUILD_ROOT%{_datadir}/{postgresql,}/applications
143 %{__rm} -r $RPM_BUILD_ROOT%{_iconsdir}/hicolor/40x40
146 rm -rf $RPM_BUILD_ROOT
148 %post -n liblwgeom -p /sbin/ldconfig
149 %postun -n liblwgeom -p /sbin/ldconfig
152 %defattr(644,root,root,755)
153 %doc CREDITS LICENSE.TXT NEWS README.postgis TODO %{?with_doc:doc/html}
154 %attr(755,root,root) %{_bindir}/pgsql2shp
155 %attr(755,root,root) %{_bindir}/shp2pgsql
156 %attr(755,root,root) %{_libdir}/postgresql/postgis-3.so
157 %attr(755,root,root) %{_libdir}/postgresql/postgis_raster-3.so
158 %attr(755,root,root) %{_libdir}/postgresql/postgis_topology-3.so
159 %{_datadir}/postgresql/contrib/postgis-3.0
161 %attr(755,root,root) %{_bindir}/raster2pgsql
162 %{_datadir}/postgresql/extension/postgis*.control
163 %{_datadir}/postgresql/extension/postgis*.sql
165 %{_libdir}/postgresql/address_standardizer-3.so
166 %{_datadir}/postgresql/extension/address_standardizer*.sql
167 %{_datadir}/postgresql/extension/address_standardizer*.control
168 %dir %{_libdir}/postgresql/bitcode
169 %{_libdir}/postgresql/bitcode/address_standardizer-3.index.bc
170 %dir %{_libdir}/postgresql/bitcode/address_standardizer-3/
171 %{_libdir}/postgresql/bitcode/address_standardizer-3/*.bc
172 %{_libdir}/postgresql/bitcode/postgis-3.index.bc
173 %dir %{_libdir}/postgresql/bitcode/postgis-3
174 %{_libdir}/postgresql/bitcode/postgis-3/*.bc
175 %{_libdir}/postgresql/bitcode/postgis_raster-3.index.bc
176 %dir %{_libdir}/postgresql/bitcode/postgis_raster-3
177 %{_libdir}/postgresql/bitcode/postgis_raster-3/*.bc
178 %{_libdir}/postgresql/bitcode/postgis_topology-3.index.bc
179 %dir %{_libdir}/postgresql/bitcode/postgis_topology-3
180 %{_libdir}/postgresql/bitcode/postgis_topology-3/*.bc
184 %defattr(644,root,root,755)
185 %attr(755,root,root) %{_bindir}/shp2pgsql-gui
186 %{_desktopdir}/shp2pgsql-gui.desktop
187 %{_iconsdir}/hicolor/*x*/apps/shp2pgsql-gui.png
191 %defattr(644,root,root,755)
192 %attr(755,root,root) %{_libdir}/liblwgeom-3.0.so.*.*.*
193 %attr(755,root,root) %ghost %{_libdir}/liblwgeom-3.0.so.0
195 %files -n liblwgeom-devel
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_libdir}/liblwgeom.so
198 %{_libdir}/liblwgeom.la
199 %{_includedir}/liblwgeom.h
200 %{_includedir}/liblwgeom_topo.h
201 %{_includedir}/lwinline.h
202 %{_includedir}/postgis_config.h
204 %files -n liblwgeom-static
205 %defattr(644,root,root,755)
206 %{_libdir}/liblwgeom.a