]>
Commit | Line | Data |
---|---|---|
9e8f98c3 | 1 | # TODO: sfcgal support (sfcgal-config, >= 1.1.0) |
32e16a3a | 2 | %define pg_version %(rpm -q --queryformat '%{VERSION}' postgresql-backend-devel) |
7045685f | 3 | # |
fc587bde | 4 | # Conditional build: |
7045685f JB |
5 | %bcond_without raster # disable raster support |
6 | %bcond_without doc # HTML documentation | |
7 | %bcond_without gui # data import GUI | |
8 | # | |
32e16a3a | 9 | Summary: Geographic Information Systems Extensions to PostgreSQL |
11d12754 | 10 | Summary(pl.UTF-8): Rozszerzenie do PostgreSQL wspomagające Geograficzne Systemy Informacyjne |
32e16a3a | 11 | Name: postgis |
9a40c348 | 12 | Version: 3.0.0 |
9e8f98c3 | 13 | %define subver %{nil} |
41f1b2ef | 14 | Release: 4 |
4203f720 | 15 | License: GPL v2+ |
32e16a3a | 16 | Group: Applications/Databases |
15bcb2cd | 17 | Source0: https://download.osgeo.org/postgis/source/%{name}-%{version}%{subver}.tar.gz |
9a40c348 JR |
18 | # Source0-md5: 725019e3a67ac52ccef4d00031cb0c77 |
19 | Patch0: install-lwgeom.patch | |
32e16a3a | 20 | URL: http://postgis.refractions.net/ |
7d560dbb | 21 | %{?with_raster:BuildRequires: gdal-devel >= 1.8.0} |
851079e2 | 22 | BuildRequires: clang |
7f47167e | 23 | BuildRequires: geos-devel >= 3.5.0 |
7045685f JB |
24 | BuildRequires: json-c-devel |
25 | BuildRequires: libstdc++-devel | |
9e8f98c3 JB |
26 | BuildRequires: libxml2-devel >= 2.0 |
27 | BuildRequires: pcre-devel | |
a6fb65b0 | 28 | BuildRequires: perl-base |
9e8f98c3 JB |
29 | BuildRequires: postgresql-backend-devel >= 9.1 |
30 | BuildRequires: postgresql-devel >= 9.1 | |
7d560dbb | 31 | BuildRequires: proj-devel >= 4.6.0 |
7045685f JB |
32 | %if %{with doc} |
33 | BuildRequires: ImageMagick | |
34 | BuildRequires: docbook-style-xsl | |
35 | BuildRequires: libxml2-progs | |
36 | BuildRequires: libxslt-progs | |
9e8f98c3 | 37 | # TODO: mathml DTD (http://www.w3.org/Math/DTD/mathml2/mathml2.dtd, e.g. /usr/share/xml/schema/w3c/mathml/dtd) |
7045685f JB |
38 | %endif |
39 | %if %{with gui} | |
40 | BuildRequires: gtk+2-devel >= 2:2.8.0 | |
41 | BuildRequires: pkgconfig | |
42 | %endif | |
7d560dbb | 43 | %{?with_raster:Requires: gdal >= 1.8.0} |
7045685f | 44 | Requires: liblwgeom = %{version}-%{release} |
9e8f98c3 | 45 | Requires: postgresql >= %{pg_version} |
32e16a3a MM |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
def64c02 | 48 | %define specflags_x86_64 -fPIC |
49 | ||
851079e2 JR |
50 | # clang can't parse this |
51 | %define filterout -fvar-tracking-assignments | |
52 | ||
32e16a3a MM |
53 | # oh well... I also don't understand this... ;) |
54 | ||
55 | %description | |
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. | |
59 | ||
c7a5e637 JR |
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 | |
32e16a3a MM |
63 | geograficznych. |
64 | ||
7045685f JB |
65 | %package gui |
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} | |
fc59c3d1 | 70 | Requires: gtk+2 >= 2:2.8.0 |
7045685f JB |
71 | |
72 | %description gui | |
73 | Data import GUI for PostGIS. | |
74 | ||
75 | %description gui -l pl.UTF-8 | |
76 | Graficzny interfejs użytkownika importujący dane dla PostGIS-a. | |
77 | ||
78 | %package -n liblwgeom | |
79 | Summary: lwgeom library (a part of PostGIS project) | |
80 | Summary(pl.UTF-8): Biblioteka lwgeom (część projektu PostGIS) | |
81 | Group: Libraries | |
7f47167e | 82 | Requires: geos >= 3.5.0 |
7d560dbb | 83 | Requires: proj >= 4.6.0 |
7045685f JB |
84 | Conflicts: postgis < 2.0.0-2 |
85 | ||
86 | %description -n liblwgeom | |
87 | lwgeom library (a part of PostGIS project). | |
88 | ||
89 | %description -n liblwgeom -l pl.UTF-8 | |
90 | Biblioteka lwgeom (część projektu PostGIS). | |
91 | ||
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 | |
7f47167e | 96 | Requires: geos-devel >= 3.5.0 |
7045685f | 97 | Requires: liblwgeom = %{version}-%{release} |
7d560dbb | 98 | Requires: proj-devel >= 4.6.0 |
7045685f JB |
99 | |
100 | %description -n liblwgeom-devel | |
101 | Header file for lwgeom library. | |
102 | ||
103 | %description -n liblwgeom-devel -l pl.UTF-8 | |
104 | Plik nagłówkowy biblioteki lwgeom. | |
105 | ||
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} | |
111 | ||
112 | %description -n liblwgeom-static | |
113 | Static lwgeom library. | |
114 | ||
115 | %description -n liblwgeom-static -l pl.UTF-8 | |
116 | Statyczna biblioteka lwgeom. | |
117 | ||
32e16a3a | 118 | %prep |
9e8f98c3 | 119 | %setup -q -n %{name}-%{version}%{subver} |
9a40c348 | 120 | %patch0 -p1 |
32e16a3a MM |
121 | |
122 | %build | |
7c6fbdb9 | 123 | export CFLAGS="%{rpmcflags} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" |
81e2cdad | 124 | %configure \ |
7045685f | 125 | %{?with_gui:--with-gui} \ |
fc587bde | 126 | %{!?with_raster:--without-raster} |
9dd90af9 | 127 | |
851079e2 | 128 | %{__make} |
32e16a3a MM |
129 | |
130 | %install | |
131 | rm -rf $RPM_BUILD_ROOT | |
1393aae1 | 132 | |
7045685f JB |
133 | %{__make} install \ |
134 | DESTDIR=$RPM_BUILD_ROOT | |
1393aae1 | 135 | |
dba6c935 | 136 | %{__sed} -e '/#include .*/d' postgis_config.h > $RPM_BUILD_ROOT%{_includedir}/postgis_config.h |
04824fa6 JR |
137 | %{__sed} -i -e 's/#include.*postgis_config.*/#include "postgis_config.h"/' $RPM_BUILD_ROOT%{_includedir}/liblwgeom.h |
138 | ||
15bcb2cd JR |
139 | # Fix icons and desktop file locations |
140 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/{postgresql,}/icons | |
141 | %{__mv} $RPM_BUILD_ROOT%{_datadir}/{postgresql,}/applications | |
142 | ||
dab5b797 JR |
143 | %{__rm} -r $RPM_BUILD_ROOT%{_iconsdir}/hicolor/40x40 |
144 | ||
32e16a3a MM |
145 | %clean |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | ||
7045685f JB |
148 | %post -n liblwgeom -p /sbin/ldconfig |
149 | %postun -n liblwgeom -p /sbin/ldconfig | |
150 | ||
32e16a3a MM |
151 | %files |
152 | %defattr(644,root,root,755) | |
92489202 | 153 | %doc CREDITS LICENSE.TXT NEWS README.postgis TODO %{?with_doc:doc/html} |
7045685f JB |
154 | %attr(755,root,root) %{_bindir}/pgsql2shp |
155 | %attr(755,root,root) %{_bindir}/shp2pgsql | |
9a40c348 JR |
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 | |
7045685f JB |
160 | %if %{with raster} |
161 | %attr(755,root,root) %{_bindir}/raster2pgsql | |
7045685f JB |
162 | %{_datadir}/postgresql/extension/postgis*.control |
163 | %{_datadir}/postgresql/extension/postgis*.sql | |
164 | %endif | |
9a40c348 | 165 | %{_libdir}/postgresql/address_standardizer-3.so |
15bcb2cd JR |
166 | %{_datadir}/postgresql/extension/address_standardizer*.sql |
167 | %{_datadir}/postgresql/extension/address_standardizer*.control | |
9a40c348 JR |
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 | |
7045685f JB |
181 | |
182 | %if %{with gui} | |
183 | %files gui | |
184 | %defattr(644,root,root,755) | |
185 | %attr(755,root,root) %{_bindir}/shp2pgsql-gui | |
15bcb2cd JR |
186 | %{_desktopdir}/shp2pgsql-gui.desktop |
187 | %{_iconsdir}/hicolor/*x*/apps/shp2pgsql-gui.png | |
7045685f JB |
188 | %endif |
189 | ||
190 | %files -n liblwgeom | |
191 | %defattr(644,root,root,755) | |
9a40c348 JR |
192 | %attr(755,root,root) %{_libdir}/liblwgeom-3.0.so.*.*.* |
193 | %attr(755,root,root) %ghost %{_libdir}/liblwgeom-3.0.so.0 | |
7045685f JB |
194 | |
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 | |
9e8f98c3 | 200 | %{_includedir}/liblwgeom_topo.h |
04824fa6 JR |
201 | %{_includedir}/lwinline.h |
202 | %{_includedir}/postgis_config.h | |
7045685f JB |
203 | |
204 | %files -n liblwgeom-static | |
205 | %defattr(644,root,root,755) | |
206 | %{_libdir}/liblwgeom.a |