Blob Blame History Raw
Name:      mapnik
Version:   2.0.0
Release:   1%{?dist}
Summary:   Free Toolkit for developing mapping applications
Group:     Applications/Engineering
License:   LGPLv2+
URL:       http://mapnik.org/
Source0:   http://download.berlios.de/mapnik/mapnik-%{version}.tar.bz2
Source1:   mapnik-data.license
Source2:   no_date_footer.html
Source3:   viewer.desktop
Patch0:	   mapnik-2.0.0-build-viewer.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

%if 0%{?fedora} >= 11
Requires:  dejavu-serif-fonts dejavu-sans-fonts dejavu-sans-mono-fonts dejavu-lgc-serif-fonts dejavu-lgc-sans-fonts dejavu-lgc-sans-mono-fonts
%else
Requires:  dejavu-fonts
%endif
Requires: proj-epsg


BuildRequires: postgresql-devel pkgconfig
BuildRequires: gdal-devel proj-devel agg-devel
BuildRequires: scons desktop-file-utils gcc-c++
BuildRequires: libtool-ltdl-devel qt-devel > 4.3
BuildRequires: libxml2-devel boost-devel libicu-devel
BuildRequires: libtiff-devel libjpeg-devel libpng-devel
BuildRequires: cairomm-devel pycairo-devel freetype-devel

%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%description
Mapnik is a Free Toolkit for developing mapping applications.
It's written in C++ and there are Python bindings to
facilitate fast-paced agile development. It can comfortably
be used for both desktop and web development, which was something
I wanted from the beginning.

Mapnik is about making beautiful maps. It uses the AGG library
and offers world class anti-aliasing rendering with subpixel
accuracy for geographic data. It is written from scratch in
modern C++ and doesn't suffer from design decisions made a decade
ago. When it comes to handling common software tasks such as memory
management, filesystem access, regular expressions, parsing and so
on, Mapnik doesn't re-invent the wheel, but utilises best of breed
industry standard libraries from boost.org 

%package devel
Summary: Mapnik is a Free toolkit for developing mapping applications
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: libpng-devel libjpeg-devel freetype-devel agg-devel

%description devel
Mapnik is a Free Toolkit for developing mapping applications.
It's written in C++ and there are Python bindings to
facilitate fast-paced agile development. It can comfortably
be used for both desktop and web development, which was something
I wanted from the beginning.

Mapnik is about making beautiful maps. It uses the AGG library
and offers world class anti-aliasing rendering with subpixel
accuracy for geographic data. It is written from scratch in
modern C++ and doesn't suffer from design decisions made a decade
ago. When it comes to handling common software tasks such as memory
management, filesystem access, regular expressions, parsing and so
on, Mapnik doesn't re-invent the wheel, but utilises best of breed
industry standard libraries from boost.org

%package python
Summary:  Python bindings for the Mapnik spatial visualization library
License:  GPLv2+
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: python-imaging python-lxml

%description python
Language bindings to enable the Mapnik library to be used from python

%package utils
License:  GPLv2+
Summary:  Utilities distributed with the Mapnik spatial visualization library
Group:    Development/Libraries
Requires: %{name} = %{version}-%{release}

%description utils
Miscellaneous utilities distributed with the Mapnik spatial visualization
library

%package demo
Summary:  Demo utility and some sample data distributed with mapnik
License:  GPLv2+ GeoGratis
Group:    Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: %{name}-python = %{version}-%{release}

%description demo
Demo application and sample vector datas distributed with the Mapnik
spatial visualization library

%prep
%setup -q -n %{name}-%{version}

%patch0 -p0

# clean SVN
find . -type d -name .svn -exec rm -rf '{}' +

# get rid of local agg, tinyxml and fonts
rm -rf agg tinyxml fonts

set +x
for f in `find . -type f` ; do
   if file $f | grep -q ISO-8859 ; then
      set -x
      iconv -f ISO-8859-1 -t UTF-8 $f > ${f}.tmp && \
         mv -f ${f}.tmp $f
      set +x
   fi
   if file $f | grep -q CRLF ; then
      set -x
      sed -i -e 's|\r||g' $f
      set +x
   fi
done
set -x

# fix spurious exec flag
chmod -x demo/viewer/images/*.png
chmod -x bindings/python/mapnik/ogcserver/modserver.py
chmod -x demo/data/test/regenerate.sh
find . -type d -perm /g+s -exec chmod -s '{}' \;

# fix wrong path in some demo files
sed -i -e 's|/lib/mapnik/input/|/%{name}/input/|g' demo/c++/rundemo.cpp

sed -i -e 's|/opt/%{name}/include|../../include|g' demo/viewer/viewer.pro
sed -i -e 's|/opt/boost/include/boost-1_34_1|%{_includedir}/boost|g' demo/viewer/viewer.pro
sed -i -e 's|-L/opt/mapnik/lib|-L../../src/|g' demo/viewer/viewer.pro
sed -i -e 's|/usr/local|/usr|g' demo/viewer/viewer.pro

%build

# linkage errors
#sed -i -e "s|libraries \= \[|libraries \= \[\'mapnik\',|g" plugins/input/gdal/SConscript
#sed -i -e "s|libraries \= \[|libraries \= \[\'mapnik\',|g" plugins/input/postgis/SConscript
#sed -i -e "s|libraries \= \[|libraries \= \[\'mapnik\',|g" plugins/input/shape/SConscript
#sed -i -e "s|libraries \= \[|libraries \= \[\'mapnik\'|g" plugins/input/raster/SConscript

# fix build flags
sed -i -e "s|common_cxx_flags = .-D\%s|common_cxx_flags = \'-D\%s $RPM_OPT_FLAGS |g" SConstruct

# WARNING smp may break build
# %{?_smp_mflags}
scons         PREFIX=%{_prefix} \
              THREADING=multi \
              XMLPARSER=libxml2 \
              GDAL_INCLUDES=%{_includedir}/gdal \
              INTERNAL_LIBAGG=False \
	      SYSTEM_FONTS=%{_datadir}/fonts \
	      BOOST_SYSTEM_REQUIRED=True

# build mapnik viewer app
pushd demo/viewer
qmake-qt4 viewer.pro
# WARNING smp may break build
# %{?_smp_mflags}
make
popd

%install

rm -rf %{buildroot}

scons install DESTDIR=%{buildroot} \
              PREFIX=%{_prefix} \
              THREADING=multi \
              XMLPARSER=libxml2 \
              GDAL_INCLUDES=%{_includedir}/gdal \
              INTERNAL_LIBAGG=False

# get rid of fonts use external instead
rm -rf %{buildroot}%{_libdir}/%{name}/fonts

# install more utils
mkdir -p %{buildroot}%{_bindir}
install -p -m 755 demo/viewer/viewer %{buildroot}%{_bindir}/
install -p -m 755 utils/stats/mapdef_stats.py %{buildroot}%{_bindir}/
install -p -m 644 %{SOURCE1} demo/data/

# install pkgconfig file
cat > %{name}.pc <<EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
includedir=%{_includedir}

Name: %{name}
Description: Free Toolkit for developing mapping applications
Version: %{version}
Requires: libagg
Libs: -lmapnik
Cflags: -I\${includedir}/%{name}
EOF

mkdir -p %{buildroot}%{_datadir}/pkgconfig/
install -p -m 644 %{name}.pc %{buildroot}%{_datadir}/pkgconfig/

# install desktop file
desktop-file-install --vendor="fedora" \
        --dir=%{buildroot}%{_datadir}/applications %{SOURCE3}

%check

# export test enviroment
export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python_sitearch}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH%{buildroot}%{_libdir}

pushd tests/python_tests/
./load_map_test.py || true
./save_map_test.py || true
./datasource_test.py || true
./font_test_test.py || true
./object_test.py || true
./projection_test.py || true
./render_test.py || true
popd

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING README
%dir %{_libdir}/%{name}2
%dir %{_libdir}/%{name}2/input
%{_bindir}/mapnik-config
%{_libdir}/%{name}2/input/*.input
%{_libdir}/lib%{name}2.so.*

%files devel
%defattr(-,root,root,-)
%doc docs/
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*
%{_libdir}/lib%{name}2.so
%{_datadir}/pkgconfig/%{name}.pc

%files python
%defattr(-,root,root,-)
%{python_sitearch}/%{name}2
%{_bindir}/mapdef_stats.py

%files utils
%defattr(-,root,root,-)
%{_bindir}/shapeindex
%{_bindir}/viewer
%{_bindir}/mapnik-speed-check
%{_bindir}/upgrade_map_xml.py
%{_datadir}/applications/fedora-viewer.desktop

%files demo
%defattr(-,root,root,-)
%doc demo/c++
%doc demo/data
%doc demo/python demo/test

%changelog
* Tue Nov 22 2011 Alex Lancaster <alexlan[AT]fedoraproject org> - 2.0.0-1
- Update to upstream 2.0.0
- Namespace is "mapnik2".
- Add some new binaries to main package and python subpackage
- Add Requires for proj-epsg (#689201) so that tile rendering
  for OSM works out of the box
- Drop old patches

* Tue Nov 22 2011 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.7.1-12
- Rebuild for new boost.

* Mon Oct 17 2011 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.7.1-11
- Rebuild for new icu soname bump

* Thu Jul 21 2011 Kevin Fenzi <kevin@scrye.com> - 0.7.1-10
- Rebuilt for boost 1.47.0 soname bump

* Sun Apr 17 2011 Kalev Lember <kalev@smartlink.ee> - 0.7.1-9
- Rebuilt for boost 1.46.1 soname bump

* Wed Feb  9 2011 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.7.1-8
- Backport and modify upstream changeset to build against newer boost (1.46)
- Also modify demo/viewer patch accordingly

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jul 28 2010 Bill Nottingham <notting@redhat.com> - 0.7.1-6
- Rebuilt for boost 1.44, again

* Tue Jul 27 2010 Bill Nottingham <notting@redhat.com> - 0.7.1-5
- Rebuilt for boost 1.44

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.7.1-4
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Sat Jul  3 2010 Christopher Brown <snecklifter@gmail.com> - 0.7.1-3
- Update to 0.7.1

* Fri Apr 02 2010 Caolán McNamara <caolanm@redhat.com> - 0.7.0-3
- rebuild for icu 4.4

* Sat Feb 20 2010 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.7.0-2
- Add patch to fix implicit linking fixes FTBFS #564720
  (http://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking)

* Sun Jan 24 2010 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.7.0-1
- Update to 0.7.0
- Rebase mapnik-build-viewer patch against 0.7.0
- aggdepends patch no longer seems necessary

* Sat Jan 16 2010 Stepan Kasal <skasal@redhat.com> - 0.6.1-5
- rebuild against new boost

* Sun Nov 29 2009 Christopher Brown <snecklifter@gmail.com> - 0.6.1-4
- Add gcc-c++ BuildRequires and bump to build again

* Sat Sep 12 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 0.6.1-3
- fix mapnik to properly link to libagg (caolanm)
- fix pkgconfig file (caolanm)

* Fri Aug  7 2009 Christopher Brown <snecker[AT]fedoraproject.org> - 0.6.1-1
- Update to 0.6.1
- Add mapnik-build-viewer.patch
- Drop use-system-fonts.patch as scons provides this
- Drop mapnik-0.5.2-gcc44.patch as the code is now good for gcc44

* Sat Jun 20 2009 Alex Lancaster <alexlan[AT]fedoraproject org> - 0.5.2-0.13.svn780
- Require individual dejavu font packages

* Tue Mar 24 2009 Alex Lancaster <alexlan[AT] fedoraproject org> - 0.5.2-0.12.svn780
- Add patch for compiling against GCC 4.4
- Fix file list for Python
- Fix font Requires: dejavu-fonts-compat and macro

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.2-0.11.svn780
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Jan 03 2009 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.10.svn780
- fix > fc11 fonts requirement
- new CVS

* Sun Dec 07 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.9.svn738
- fix fonts for F11

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5.2-0.8.svn738
- Rebuild for Python 2.6

* Thu Oct 09 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.7.svn738
- require desktop-utils in koji

* Wed Oct 08 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.6.svn738
- fix self dependency build for viewer

* Wed Oct 08 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.5.svn738
- enable viewer application for mapnik's xml templates
- exclude viewer from demo than

* Wed Sep 24 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.4.svn738
- use relative path in a demo file
- enable mapnik.pc

* Fri Sep 12 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.3.svn738
- enable libicu wrap

* Fri Sep 12 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.2.svn738
- fix koji build
- disable smp build with upstream scons

* Thu Sep 11 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.2-0.1.svn738
- new cvs snapshot, x86_64 should work for now
- new cairo dep added

* Mon Aug 25 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.1-4
- License of demo is GPLv2+ GeoGratis

* Fri Jul 25 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.1-3
- fix perms in -demo
- fix demo folder ownership

* Wed Jul 23 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.1-2
- new demo subpackage
- demo and python subpackages have GPLv2+ license
- fix dependency for python ogc server
- *.input plugins will stay in _libdir instead
- fix linkage over plugins

* Sun Jul 06 2008 Balint Cristian <rezso@rdsor.ro> - 0.5.1-1
- the license of mapnik is LGPLv2+
- release is now 0.5.1 from upstream stable
- fix explicit library dependency requirement
- fix library dependency for -devel requirement
- fix library dependency for -python requirement
- fix to use fedora specific compile flag
- fix to use external agg-devel library as shared
- make sure get rid of internal tinyxml and agg chunks
- use libxml2 by default instead of tinyxml
- use macros everywhere in specfile
- use external fedora dejavu fonts insted, get rid of local one
- place tool binaries in _bindir
- add check section and run testsuite, they should pass
- add one python tool
- build and add doxygen docs
- fix multilib issue
- fix UTF-8 and some spurious permission
- include local copied web license of some demo data
- rpmlint should print zarro bugs