1 |
%define major 2 |
2 |
%define libname %mklibname %{name}2_ %{major} |
3 |
%define develname %mklibname -d %{name} |
4 |
|
5 |
Name: mapnik |
6 |
Version: 2.2.0 |
7 |
Release: %mkrel 6 |
8 |
Summary: Free Toolkit for developing mapping applications |
9 |
Group: Geography |
10 |
License: LGPLv2+ |
11 |
URL: http://mapnik.org/ |
12 |
Source0: http://mapnik.s3.amazonaws.com/dist/v%{version}/%{name}-v%{version}.tar.bz2 |
13 |
Source1: mapnik-data.license |
14 |
Source2: no_date_footer.html |
15 |
Source3: viewer.desktop |
16 |
Patch0: mapnik-2.2.0-link.patch |
17 |
|
18 |
BuildRequires: postgresql-devel |
19 |
BuildRequires: pkgconfig |
20 |
BuildRequires: gdal-devel |
21 |
BuildRequires: proj-devel |
22 |
BuildRequires: agg-devel |
23 |
BuildRequires: scons |
24 |
BuildRequires: doxygen |
25 |
BuildRequires: desktop-file-utils |
26 |
BuildRequires: libltdl-devel |
27 |
BuildRequires: qt4-devel > 4.3 |
28 |
BuildRequires: libxml2-devel |
29 |
BuildRequires: boost-devel |
30 |
BuildRequires: libicu-devel |
31 |
BuildRequires: libtiff-devel |
32 |
BuildRequires: libjpeg-devel |
33 |
BuildRequires: libpng-devel |
34 |
BuildRequires: cairomm-devel |
35 |
BuildRequires: python-cairo-devel |
36 |
BuildRequires: freetype2-devel |
37 |
BuildRequires: python-devel |
38 |
Requires: fonts-ttf-dejavu |
39 |
Requires: %{libname} = %{version}-%{release} |
40 |
|
41 |
%description |
42 |
Mapnik is a Free Toolkit for developing mapping applications. |
43 |
It's written in C++ and there are Python bindings to |
44 |
facilitate fast-paced agile development. It can comfortably |
45 |
be used for both desktop and web development, which was something |
46 |
I wanted from the beginning. |
47 |
|
48 |
Mapnik is about making beautiful maps. It uses the AGG library |
49 |
and offers world class anti-aliasing rendering with subpixel |
50 |
accuracy for geographic data. It is written from scratch in |
51 |
modern C++ and doesn't suffer from design decisions made a decade |
52 |
ago. When it comes to handling common software tasks such as memory |
53 |
management, filesystem access, regular expressions, parsing and so |
54 |
on, Mapnik doesn't re-invent the wheel, but utilises best of breed |
55 |
industry standard libraries from boost.org |
56 |
|
57 |
%package -n %{libname} |
58 |
Summary: Mapnik is a Free toolkit for developing mapping applications |
59 |
Group: System/Libraries |
60 |
|
61 |
%description -n %{libname} |
62 |
Mapnik is a Free Toolkit for developing mapping applications. |
63 |
It's written in C++ and there are Python bindings to |
64 |
facilitate fast-paced agile development. It can comfortably |
65 |
be used for both desktop and web development, which was something |
66 |
I wanted from the beginning. |
67 |
|
68 |
Mapnik is about making beautiful maps. It uses the AGG library |
69 |
and offers world class anti-aliasing rendering with subpixel |
70 |
accuracy for geographic data. It is written from scratch in |
71 |
modern C++ and doesn't suffer from design decisions made a decade |
72 |
ago. When it comes to handling common software tasks such as memory |
73 |
management, filesystem access, regular expressions, parsing and so |
74 |
on, Mapnik doesn't re-invent the wheel, but utilises best of breed |
75 |
industry standard libraries from boost.org |
76 |
|
77 |
|
78 |
%package -n %{develname} |
79 |
Summary: Mapnik is a Free toolkit for developing mapping applications |
80 |
Group: Development/C++ |
81 |
Requires: %{libname} = %{version}-%{release} |
82 |
Provides: %{name}-devel = %{version}-%{release} |
83 |
Obsoletes: %{name}-devel |
84 |
|
85 |
%description -n %{develname} |
86 |
Mapnik is a Free Toolkit for developing mapping applications. |
87 |
It's written in C++ and there are Python bindings to |
88 |
facilitate fast-paced agile development. It can comfortably |
89 |
be used for both desktop and web development, which was something |
90 |
I wanted from the beginning. |
91 |
|
92 |
Mapnik is about making beautiful maps. It uses the AGG library |
93 |
and offers world class anti-aliasing rendering with subpixel |
94 |
accuracy for geographic data. It is written from scratch in |
95 |
modern C++ and doesn't suffer from design decisions made a decade |
96 |
ago. When it comes to handling common software tasks such as memory |
97 |
management, filesystem access, regular expressions, parsing and so |
98 |
on, Mapnik doesn't re-invent the wheel, but utilises best of breed |
99 |
industry standard libraries from boost.org |
100 |
|
101 |
%package python |
102 |
Summary: Python bindings for the Mapnik spatial visualization library |
103 |
License: GPLv2+ |
104 |
Group: Development/Python |
105 |
Requires: %{name} = %{version}-%{release} |
106 |
Requires: python-imaging python-lxml |
107 |
|
108 |
%description python |
109 |
Language bindings to enable the Mapnik library to be used from python |
110 |
|
111 |
%package utils |
112 |
License: GPLv2+ |
113 |
Summary: Utilities distributed with the Mapnik spatial visualization library |
114 |
Group: Geography |
115 |
Requires: %{name} = %{version}-%{release} |
116 |
|
117 |
%description utils |
118 |
Miscellaneous utilities distributed with the Mapnik spatial visualization |
119 |
library |
120 |
|
121 |
%prep |
122 |
%setup -q -n %{name}-v%{version} |
123 |
%patch0 -p1 -b .link |
124 |
|
125 |
rm -fr demo |
126 |
|
127 |
%build |
128 |
|
129 |
# linkage errors |
130 |
|
131 |
# fix build flags |
132 |
#sed -i -e "s|common_cxx_flags = .-D\%s|common_cxx_flags = \'-D\%s %optflags |g" SConstruct |
133 |
|
134 |
# WARNING smp may break build |
135 |
# %{?_smp_mflags} |
136 |
scons PREFIX=%{_prefix} \ |
137 |
LIBDIR_SCHEMA=%{_lib} \ |
138 |
THREADING=multi \ |
139 |
XMLPARSER=libxml2 \ |
140 |
GDAL_INCLUDES=%{_includedir}/gdal \ |
141 |
CUSTOM_CFLAGS="%optflags" \ |
142 |
CUSTOM_CXXFLAGS="%optflags" \ |
143 |
CUSTOM_LDFLAGS="%ldflags" \ |
144 |
INTERNAL_LIBAGG=False \ |
145 |
SYSTEM_FONTS=True \ |
146 |
DEMO=False |
147 |
|
148 |
%install |
149 |
|
150 |
scons install DESTDIR=%{buildroot} \ |
151 |
PREFIX=%{_prefix} \ |
152 |
LIBDIR_SCHEMA=%{_lib} \ |
153 |
THREADING=multi \ |
154 |
XMLPARSER=libxml2 \ |
155 |
GDAL_INCLUDES=%{_includedir}/gdal \ |
156 |
CUSTOM_CFLAGS="%optflags" \ |
157 |
CUSTOM_CXXFLAGS="%optflags" \ |
158 |
CUSTOM_LDFLAGS="%ldflags" \ |
159 |
INTERNAL_LIBAGG=False \ |
160 |
SYSTEM_FONTS=True \ |
161 |
DEMO=False |
162 |
|
163 |
# get rid of fonts use external instead |
164 |
rm -rf %{buildroot}%{_libdir}/%{name}/fonts |
165 |
|
166 |
# install more utils |
167 |
mkdir -p %{buildroot}%{_bindir} |
168 |
#install -p -m 755 demo/viewer/viewer %{buildroot}%{_bindir}/ |
169 |
install -p -m 755 utils/stats/mapdef_stats.py %{buildroot}%{_bindir}/ |
170 |
#install -p -m 644 %{SOURCE1} demo/data/ |
171 |
|
172 |
# install pkgconfig file |
173 |
cat > %{name}.pc <<EOF |
174 |
prefix=%{_prefix} |
175 |
exec_prefix=%{_prefix} |
176 |
includedir=%{_includedir} |
177 |
|
178 |
Name: %{name} |
179 |
Description: Free Toolkit for developing mapping applications |
180 |
Version: %{version} |
181 |
Libs: -lmapnik |
182 |
Cflags: -I${includedir}/%{name} -I${includedir}/agg |
183 |
EOF |
184 |
|
185 |
mkdir -p %{buildroot}%{_datadir}/pkgconfig/ |
186 |
install -p -m 644 %{name}.pc %{buildroot}%{_datadir}/pkgconfig/ |
187 |
|
188 |
# install desktop file |
189 |
#desktop-file-install --vendor="mandriva" \ |
190 |
# --dir=%{buildroot}%{_datadir}/applications %{SOURCE3} |
191 |
|
192 |
%check |
193 |
|
194 |
# export test enviroment |
195 |
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python_sitearch} |
196 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH%{buildroot}%{_libdir} |
197 |
|
198 |
pushd tests/ |
199 |
./run_tests.py || true |
200 |
popd |
201 |
|
202 |
%files |
203 |
%doc AUTHORS.md COPYING CHANGELOG.md |
204 |
%{_libdir}/%{name} |
205 |
|
206 |
%files -n %{libname} |
207 |
%{_libdir}/lib%{name}.so.%{major}* |
208 |
|
209 |
%files -n %{develname} |
210 |
%{_bindir}/mapnik-config |
211 |
%{_includedir}/%{name} |
212 |
%{_libdir}/lib%{name}.so |
213 |
%{_datadir}/pkgconfig/%{name}.pc |
214 |
|
215 |
%files python |
216 |
%{python_sitearch}/%{name}2 |
217 |
%{python_sitearch}/%{name} |
218 |
%{_bindir}/mapdef_stats.py |
219 |
|
220 |
%files utils |
221 |
%{_bindir}/shapeindex |
222 |
%{_bindir}/mapnik-speed-check |
223 |
%{_bindir}/upgrade_map_xml.py |