Blob Blame History Raw
%global srcname mapnik

%global commit 1635afe2359a0984868a47857645459c0fce44e3
%global shortcommit %(c=%{commit}; echo ${c:0:7})

%global testcommit 6ce59adfc4f11b16a5dc0e2020c36dc614850989
%global visualcommit 941db3d00920dc7aceaa6797096a7228bc7bac14

Name:           python-%{srcname}
Version:        0.1
Release:        23.20170614git%{shortcommit}%{?dist}
Summary:        Python bindings for Mapnik

License:        LGPLv2+
URL:            https://github.com/mapnik/python-mapnik
Source0:        https://github.com/mapnik/python-mapnik/archive/%{commit}/%{name}-%{commit}.tar.gz
Source1:        https://github.com/mapnik/test-data/archive/%{testcommit}/test-data-%{testcommit}.tar.gz
Source2:        https://github.com/mapnik/test-data-visual/archive/%{visualcommit}/test-data-visual-%{visualcommit}.tar.gz
# Stop setup.py trying to fiddle with compiler flags
Patch0:         python-mapnik-flags.patch
# Allow more variation in comparisons
Patch1:         python-mapnik-precision.patch
# Remove test that relies on WKT data missing from Fedora's gdal
Patch2:         python-mapnik-gdal.patch
# Disable some tests that are failing on certain arches
Patch3:         python-mapnik-pgraster.patch
# https://github.com/mapnik/python-mapnik/issues/152
# https://github.com/mapnik/python-mapnik/pull/153
Patch4:         python-mapnik-tiled.patch

# Exclude big endian architectures as mapnik does not support them
# https://github.com/mapnik/mapnik/issues/2313
# https://bugzilla.redhat.com/show_bug.cgi?id=1395208
ExcludeArch:    ppc ppc64 s390 s390x

BuildRequires:  python2-devel python3-devel
BuildRequires:  python2-nose python3-nose
BuildRequires:  python2-PyPDF2 python3-PyPDF2

BuildRequires:  git-core
BuildRequires:  mapnik-devel mapnik-static mapnik-utils
BuildRequires:  boost-devel boost-python3-devel
BuildRequires:  pycairo-devel pycairo python3-cairo-devel python3-cairo
BuildRequires:  postgresql-server postgis

%description
%{summary}.


%package -n python2-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{srcname}}

Provides:       mapnik-python = 1:%{version}-%{release}
Obsoletes:      mapnik-python < 0:2.2.1-0.12

%description -n python2-%{srcname}
%{summary}.


%package -n python3-%{srcname}
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
%{summary}.


%prep
%autosetup -N -n %{name}-%{commit}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%ifarch armv7hl aarch64 ppc64le
%patch3 -p1
%endif
%patch4 -p1
tar --directory=test/data --strip-components=1 --gunzip --extract --file=%{SOURCE1} 
tar --directory=test/data-visual --strip-components=1 --gunzip --extract --file=%{SOURCE2} 


%build
export PYCAIRO=true
%py2_build
%py3_build


%install
%py2_install
%py3_install


%check
%ifnarch %{ix86}
# start a postgres instance for the tests to use
pg_ctl initdb -D pg_data -o "-A ident -E utf8"
pg_ctl start -w -D pg_data -l pg_log -o "-h '' -k $PWD"
createdb -h $PWD template_postgis
psql -h $PWD -c "CREATE EXTENSION postgis" template_postgis
# run the tests
PGHOST="$PWD" LANG="en_US.utf8" %{__python2} setup.py test
rm test/python_tests/pdf_printing_test.py
PGHOST="$PWD" LANG="en_US.utf8" %{__python3} setup.py test
# stop the postgres instance
pg_ctl stop -D pg_data
%endif


%files -n python2-%{srcname}
%{!?_licensedir:%global license %doc}
%doc README.md AUTHORS.md CHANGELOG.md CONTRIBUTING.md
%license COPYING
%{python2_sitearch}/*


%files -n python3-%{srcname}
%{!?_licensedir:%global license %doc}
%doc README.md AUTHORS.md CHANGELOG.md CONTRIBUTING.md
%license COPYING
%{python3_sitearch}/*


%changelog
* Thu Aug 10 2017 Tom Hughes <tom@compton.nu> - 0.1-23.20170614git1635afe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-22.20170614git1635afe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-21.20170614git1635afe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Jul 21 2017 Kalev Lember <klember@redhat.com> - 0.1-20.20170614git1635afe
- Rebuilt for Boost 1.64

* Fri Jun 16 2017 Tom Hughes <tom@compton.nu> - 0.1-19.20170614git1635afe
- Rebuild against mapnik 3.0.15

* Wed Jun 14 2017 Tom Hughes <tom@compton.nu> - 0.1-18.20170614git1635afe
- Update to new snapshot
- Rebuild against mapnik 3.0.14

* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-17.20170214git8139e5c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild

* Thu May  4 2017 Tom Hughes <tom@compton.nu> - 0.1-16.20170214git8139e5c
- Rebuild for ARM ABI fix

* Tue Feb 14 2017 Tom Hughes <tom@compton.nu> - 0.1-15.20170214git8139e5c
- Update to new snapshot
- Rebuild against current mapnik

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-14.20160909git541fd96
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Feb 01 2017 Sandro Mani <manisandro@gmail.com> - 0.1-13.20160909git541fd96
- Rebuild (libwebp)

* Wed Jan 25 2017 Tom Hughes <tom@compton.nu> - 0.1-12.20160909git541fd96
- Rebuild for proj 4.9.3

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.1-11.20160909git541fd96
- Rebuild for Python 3.6

* Wed Nov 16 2016 Tom Hughes <tom@compton.nu> - 0.1-10.20160909git541fd96
- Exclude big endian architectures as mapnik does not support them

* Fri Sep  9 2016 Tom Hughes <tom@compton.nu> - 0.1-9.20160909git541fd96
- Update to new snapshot
- Rebuild against current mapnik

* Tue Jul 26 2016 Tom Hughes <tom@compton.nu> - 0.1-8.20160202git1cb6851
- Update to new snapshot
- Rebuild against current mapnik

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-7.20151209gitdb7c1fd
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1-6.20151209gitdb7c1fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Jan 24 2016 Tom Hughes <tom@compton.nu> - 0.1-5.20151209gitdb7c1fd
- Update to new snapshot
- Patch some boost 1.60.0 issues

* Fri Jan 22 2016 Tom Hughes <tom@compton.nu> - 0.1-5.20151209gitf81d5f8
- Rebuild for boost 1.60.0

* Wed Dec  9 2015 Tom Hughes <tom@compton.nu> - 0.1-4.20151209gitf81d5f8
- Update to new snapshot with license fix
- Bump epoch on mapnik-python provide
- Patch out setting of rpath
- Update to latest test data

* Sun Dec  6 2015 Tom Hughes <tom@compton.nu> - 0.1-3.20151127gitfae6388
- Update to new upstream snapshot

* Wed Dec  2 2015 Tom Hughes <tom@compton.nu> - 0.1-2.20151125gitff364e1
- Provide a postgres instance for the tests
- Enable cairo support

* Mon Nov 30 2015 Tom Hughes <tom@compton.nu> - 0.1-1.20151125gitff364e1
- Rebuild against mapnik 3.0.9

* Wed Nov 25 2015 Tom Hughes <tom@compton.nu> - 0-0.1.20151125gitff364e1
- Initial build