summaryrefslogtreecommitdiff
path: root/postgis.spec
blob: b2265600dfa732ceab71bf0b09e864300aab3be3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# TODO: sfcgal support (sfcgal-config, >= 1.1.0)
%define pg_version	%(rpm -q --queryformat '%{VERSION}' postgresql-backend-devel)
#
# Conditional build:
%bcond_without  raster	# disable raster support
%bcond_without	doc	# HTML documentation
%bcond_without	gui	# data import GUI
#
Summary:	Geographic Information Systems Extensions to PostgreSQL
Summary(pl.UTF-8):	Rozszerzenie do PostgreSQL wspomagające Geograficzne Systemy Informacyjne
Name:		postgis
Version:	2.2.1
%define	subver %{nil}
Release:	1
License:	GPL v2+
Group:		Applications/Databases
Source0:	http://download.osgeo.org/postgis/source/%{name}-%{version}%{subver}.tar.gz
# Source0-md5:	dc3575a0aac5a7e0bbddde17eb6be400
Patch0:		%{name}-link.patch
URL:		http://postgis.refractions.net/
%{?with_raster:BuildRequires:	gdal-devel >= 1.8.0}
BuildRequires:	geos-devel >= 3.5.0
BuildRequires:	json-c-devel
BuildRequires:	libstdc++-devel
BuildRequires:	libxml2-devel >= 2.0
BuildRequires:	pcre-devel
BuildRequires:	perl-base
BuildRequires:	postgresql-backend-devel >= 9.1
BuildRequires:	postgresql-devel >= 9.1
BuildRequires:	proj-devel >= 4.6.0
%if %{with doc}
BuildRequires:	ImageMagick
BuildRequires:	docbook-style-xsl
BuildRequires:	libxml2-progs
BuildRequires:	libxslt-progs
# TODO: mathml DTD (http://www.w3.org/Math/DTD/mathml2/mathml2.dtd, e.g. /usr/share/xml/schema/w3c/mathml/dtd)
%endif
%if %{with gui}
BuildRequires:	gtk+2-devel >= 2:2.8.0
BuildRequires:	pkgconfig
%endif
%{?with_raster:Requires:	gdal >= 1.8.0}
Requires:	liblwgeom = %{version}-%{release}
Requires:	postgresql >= %{pg_version}
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define		specflags_x86_64	-fPIC

# oh well... I also don't understand this... ;)

%description
This package contains a module which implements GIS simple features,
ties the features to rtree indexing, and provides some spatial
functions for accessing and analyzing geographic data.

%description -l pl.UTF-8
Pakiet ten zawiera moduł implementujący proste funkcje GIS, wiąże je z
indeksowaniem rtree oraz dostarcza funkcje dostępu oraz analizy danych
geograficznych.

%package gui
Summary:	Data import GUI for PostGIS
Summary(pl.UTF-8):	Graficzny interfejs użytkownika importujący dane dla PostGIS-a
Group:		X11/Applications
Requires:	%{name} = %{version}-%{release}
Requires:	gtk+2 >= 2:2.8.0

%description gui
Data import GUI for PostGIS.

%description gui -l pl.UTF-8
Graficzny interfejs użytkownika importujący dane dla PostGIS-a.

%package -n liblwgeom
Summary:	lwgeom library (a part of PostGIS project)
Summary(pl.UTF-8):	Biblioteka lwgeom (część projektu PostGIS)
Group:		Libraries
Requires:	geos >= 3.5.0
Requires:	proj >= 4.6.0
Conflicts:	postgis < 2.0.0-2

%description -n liblwgeom
lwgeom library (a part of PostGIS project).

%description -n liblwgeom -l pl.UTF-8
Biblioteka lwgeom (część projektu PostGIS).

%package -n liblwgeom-devel
Summary:	Header file for lwgeom library
Summary(pl.UTF-8):	Plik nagłówkowy biblioteki lwgeom
Group:		Development/Libraries
Requires:	geos-devel >= 3.5.0
Requires:	liblwgeom = %{version}-%{release}
Requires:	proj-devel >= 4.6.0

%description -n liblwgeom-devel
Header file for lwgeom library.

%description -n liblwgeom-devel -l pl.UTF-8
Plik nagłówkowy biblioteki lwgeom.

%package -n liblwgeom-static
Summary:	Static lwgeom library
Summary(pl.UTF-8):	Statyczna biblioteka lwgeom
Group:		Development/Libraries
Requires:	liblwgeom-devel = %{version}-%{release}

%description -n liblwgeom-static
Static lwgeom library.

%description -n liblwgeom-static -l pl.UTF-8
Statyczna biblioteka lwgeom.

%prep
%setup -q -n %{name}-%{version}%{subver}
%patch0 -p1

%build
%configure \
	%{?with_gui:--with-gui} \
	%{!?with_raster:--without-raster}

%{__make}

%install
rm -rf $RPM_BUILD_ROOT

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

%clean
rm -rf $RPM_BUILD_ROOT

%post	-n liblwgeom -p /sbin/ldconfig
%postun	-n liblwgeom -p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc CREDITS LICENSE.TXT NEWS README.postgis TODO %{?with_doc:doc/html}
%attr(755,root,root) %{_bindir}/pgsql2shp
%attr(755,root,root) %{_bindir}/shp2pgsql
%attr(755,root,root) %{_libdir}/postgresql/postgis-2.2.so
%attr(755,root,root) %{_libdir}/postgresql/postgis_topology-2.2.so
%{_datadir}/postgresql/contrib/postgis-2.2
%if %{with raster}
%attr(755,root,root) %{_bindir}/raster2pgsql
%attr(755,root,root) %{_libdir}/postgresql/rtpostgis-2.2.so
%{_datadir}/postgresql/extension/postgis*.control
%{_datadir}/postgresql/extension/postgis*.sql
%endif

%if %{with gui}
%files gui
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/shp2pgsql-gui
%endif

%files -n liblwgeom
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/liblwgeom-2.2.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/liblwgeom-2.2.so.5

%files -n liblwgeom-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/liblwgeom.so
%{_libdir}/liblwgeom.la
%{_includedir}/liblwgeom.h
%{_includedir}/liblwgeom_topo.h

%files -n liblwgeom-static
%defattr(644,root,root,755)
%{_libdir}/liblwgeom.a