Blob Blame History Raw
Name:      mapnik
Version:   0.5.2
Release:   0.3.svn738%{?dist}
Summary:   Free Toolkit for developing mapping applications
Group:     Applications/Engineering
License:   LGPLv2+
URL:       http://mapnik.org/
Source0:   http://download.berlios.de/mapnik/mapnik_src-%{version}.svn738.tar.gz
Source1:   mapnik-data.license
Source2:   no_date_footer.html
Patch0:    use-system-fonts.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:  dejavu-fonts

BuildRequires: scons doxygen
BuildRequires: libtool-ltdl-devel
BuildRequires: postgresql-devel pkgconfig
BuildRequires: gdal-devel proj-devel agg-devel
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
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}
%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 demo/data/test/regenerate.sh
find . -type d -perm /g+s -exec chmod -s '{}' \;

%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 brak build
# %{?_smp_mflags}
scons         PREFIX=%{_prefix} \
              THREADING=multi \
              XMLPARSER=libxml2 \
              GDAL_INCLUDES=%{_includedir}/gdal \
              INTERNAL_LIBAGG=False

# build doxygen docs
# use multilib aware footer
sed -i -e 's|HTML_FOOTER|HTML_FOOTER=no_date_footer.html\n\#|g' docs/doxygen/Doxyfile
install -p -m 644 %{SOURCE2} docs/doxygen/
pushd docs/doxygen
doxygen
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 utils/stats/mapdef_stats.py %{buildroot}%{_bindir}/
install -p -m 644 %{SOURCE1} demo/data/

%check

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

pushd tests/python/
./test_load_map.py || true
./test_save_map.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}
%dir %{_libdir}/%{name}/input
%{_libdir}/%{name}/input/*.input
%{_libdir}/lib%{name}.so.*

%files devel
%defattr(-,root,root,-)
%doc docs/doxygen/html
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*
%{_libdir}/lib%{name}.so

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

%files utils
%defattr(-,root,root,-)
%{_bindir}/shapeindex

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

%changelog
* 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