60d68cd
Name:           libkml
60d68cd
Version:        1.3.0
4b5da7b
Release:        8%{?dist}
60d68cd
Summary:        Reference implementation of OGC KML 2.2
60d68cd
60d68cd
License:        BSD
60d68cd
URL:            https://github.com/libkml/libkml
60d68cd
Source0:        https://github.com/libkml/libkml/archive/%{version}/libkml-%{version}.tar.gz
60d68cd
60d68cd
## See https://github.com/libkml/libkml/pull/239
60d68cd
Patch0:         0001-Fix-build-failure-due-to-failure-to-convert-pointer-.patch
60d68cd
Patch1:         0002-Fix-mistaken-use-of-std-cerr-instead-of-std-endl.patch
60d68cd
Patch2:         0003-Fix-python-tests.patch
60d68cd
Patch3:         0004-Correctly-build-and-run-java-test.patch
60d68cd
# Fix a fragile test failing on i686
60d68cd
Patch4:         fragile_test.patch
4b5da7b
# Don't bytecompile python sources as part of build process, leave it to rpmbuild
4b5da7b
Patch5:         libkml_dont-bytecompile.patch
60d68cd
60d68cd
BuildRequires:  cmake
60d68cd
BuildRequires:  curl-devel
60d68cd
BuildRequires:  boost-devel
60d68cd
BuildRequires:  expat-devel
60d68cd
BuildRequires:  gtest-devel
60d68cd
BuildRequires:  java-devel
60d68cd
BuildRequires:  junit
60d68cd
BuildRequires:  minizip-devel
4d89824
%if 0%{?fedora}
60d68cd
BuildRequires:  python2-devel
4b5da7b
BuildRequires:  python3-devel
4d89824
%else
4d89824
BuildRequires:  python-devel
4d89824
%endif
60d68cd
BuildRequires:  swig
60d68cd
BuildRequires:  uriparser-devel
60d68cd
BuildRequires:  zlib-devel
60d68cd
60d68cd
%global __requires_exclude_from ^%{_docdir}/.*$
60d68cd
%global __provides_exclude_from ^%{python2_sitearch}/.*\\.so$
60d68cd
60d68cd
60d68cd
%description
60d68cd
Reference implementation of OGC KML 2.2.
60d68cd
It also includes implementations of Google's gx: extensions used by Google
60d68cd
Earth, as well as several utility libraries for working with other formats.
60d68cd
60d68cd
60d68cd
%package -n python2-%{name}
4b5da7b
Summary:        Python 2 bindings for %{name}
60d68cd
Requires:       %{name}%{?_isa} = %{version}-%{release}
60d68cd
%{?python_provide:%python_provide python2-%{name}}
60d68cd
60d68cd
%description -n python2-%{name}
4b5da7b
The python2-%{name} package contains Python 2 bindings for %{name}.
4b5da7b
4b5da7b
4b5da7b
%package -n python3-%{name}
4b5da7b
Summary:        Python 3 bindings for %{name}
4b5da7b
Requires:       %{name}%{?_isa} = %{version}-%{release}
4b5da7b
%{?python_provide:%python_provide python3-%{name}}
4b5da7b
4b5da7b
%description -n python3-%{name}
4b5da7b
The python3-%{name} package contains Python 3 bindings for %{name}.
60d68cd
60d68cd
60d68cd
%package java
60d68cd
Summary:        Java bindings for %{name}
60d68cd
Requires:       %{name}%{?_isa} = %{version}-%{release}
60d68cd
60d68cd
%description java
60d68cd
The %{name}-java package contains Java bindings for %{name}.
60d68cd
60d68cd
60d68cd
%package        devel
60d68cd
Summary:        Development files for %{name}
60d68cd
Requires:       %{name}%{?_isa} = %{version}-%{release}
60d68cd
Requires:       boost-devel
60d68cd
Requires:       expat-devel
60d68cd
60d68cd
%description    devel
60d68cd
The %{name}-devel package contains libraries and header files for
60d68cd
developing applications that use %{name}.
60d68cd
60d68cd
60d68cd
%prep
4b5da7b
%autosetup -p1
60d68cd
60d68cd
60d68cd
%build
4b5da7b
mkdir build_py2
4b5da7b
pushd build_py2
4b5da7b
%ifarch armv7hl
4b5da7b
%define awtlib -DJAVA_AWT_LIBRARY=`find /usr/lib/jvm/ -name libjawt.so | grep jre/lib/arm \`
4b5da7b
%endif
60d68cd
%cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON -DWITH_JAVA=ON \
60d68cd
  -DJNI_INSTALL_DIR=%{_libdir}/%{name} \
60d68cd
  -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
60d68cd
  -DINCLUDE_INSTALL_DIR=%{_includedir}/kml \
4b5da7b
  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python2_version}.so \
4b5da7b
  -DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python2_version}/ \
4b5da7b
  -DPYTHON_INSTALL_DIR=%{python2_sitearch} \
4b5da7b
  %{?awtlib} \
4b5da7b
  -DBUILD_TESTING=ON \
4b5da7b
  -DBUILD_EXAMPLES=ON \
4b5da7b
  ..
4b5da7b
%make_build
4b5da7b
popd
4b5da7b
4b5da7b
mkdir build_py3
4b5da7b
pushd build_py3
4b5da7b
%cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON -DWITH_JAVA=OFF \
4b5da7b
  -DJNI_INSTALL_DIR=%{_libdir}/%{name} \
4b5da7b
  -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
4b5da7b
  -DINCLUDE_INSTALL_DIR=%{_includedir}/kml \
4b5da7b
  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_version}m.so \
4b5da7b
  -DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python3_version}m/ \
4b5da7b
  -DPYTHON_INSTALL_DIR=%{python3_sitearch} \
60d68cd
  -DBUILD_TESTING=ON \
4b5da7b
  -DBUILD_EXAMPLES=OFF \
4b5da7b
  ..
4b5da7b
%make_build
4b5da7b
popd
60d68cd
60d68cd
60d68cd
%install
4b5da7b
%make_install -C build_py2
4b5da7b
%make_install -C build_py3
60d68cd
60d68cd
60d68cd
%check
4b5da7b
pushd build_py2
60d68cd
ctest -V
4b5da7b
popd
4b5da7b
pushd build_py3
4b5da7b
ctest -V
4b5da7b
popd
60d68cd
60d68cd
60d68cd
%post -p /sbin/ldconfig
60d68cd
60d68cd
%postun -p /sbin/ldconfig
60d68cd
60d68cd
60d68cd
%files
60d68cd
%license LICENSE
60d68cd
%doc AUTHORS README.md
60d68cd
%{_libdir}/libkml*.so.*
60d68cd
60d68cd
%files -n python2-%{name}
60d68cd
%{python2_sitearch}/*.so
60d68cd
%{python2_sitearch}/*.py*
60d68cd
4b5da7b
%files -n python3-%{name}
4b5da7b
%{python3_sitearch}/*.so
4b5da7b
%{python3_sitearch}/*.py
4b5da7b
%{python3_sitearch}/__pycache__/*.pyc
4b5da7b
60d68cd
%files java
60d68cd
%{_javadir}/LibKML.jar
60d68cd
%{_libdir}/%{name}/
60d68cd
60d68cd
%files devel
60d68cd
%doc examples
60d68cd
%{_includedir}/kml/
60d68cd
%{_libdir}/libkml*.so
60d68cd
%{_libdir}/pkgconfig/%{name}.pc
60d68cd
%{_libdir}/cmake/%{name}/
60d68cd
60d68cd
%changelog
4b5da7b
* Mon Aug 07 2017 Sandro Mani <manisandro@gmail.com> - 1.3.0-8
4b5da7b
- Workaround armv7hl FTBFS
4b5da7b
- Add python3 bindings
4b5da7b
1803631
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-7
1803631
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
1803631
7413480
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-6
7413480
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7413480
06532eb
* Tue Jul 18 2017 Jonathan Wakely <jwakely@redhat.com> - 1.3.0-5
06532eb
- Rebuilt for Boost 1.64
06532eb
2d59a35
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-4
2d59a35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2d59a35
c6c08e2
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
c6c08e2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c6c08e2
60d68cd
* Fri Apr 08 2016 Sandro Mani <manisandro@gmail.com> - 1.3.0-2
60d68cd
- Don't call it Google's reference implementation in Summary/Description
60d68cd
- Update Source URL
60d68cd
- Add python_provide macro
60d68cd
- Enable tests
60d68cd
60d68cd
* Thu Mar 31 2016 Sandro Mani <manisandro@gmail.com> - 1.3.0-1
60d68cd
- Update to 1.3.0
60d68cd
60d68cd
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-8
60d68cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
60d68cd
60d68cd
* Mon Aug 02 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 0.6.1-7
60d68cd
- Fix gcc warning that lead to failure due to -Werror flag
60d68cd
60d68cd
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.1-6
60d68cd
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
60d68cd
60d68cd
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-5
60d68cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
60d68cd
60d68cd
* Sun Apr 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-4
60d68cd
- Included *pyc and pyo files in %%files and added BuildRequires libgcj-devel.
60d68cd
60d68cd
* Sun Apr 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-3
60d68cd
- libkml-0.6.1.configure_ac.patch patch for swig > 1.3.35
60d68cd
60d68cd
* Sat Mar 07 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-2
60d68cd
- updated to 0.6.1
60d68cd
- libkml-third_party_removal.diff Removes third part dependency
60d68cd
- (provided by Peter Lemenkov)
60d68cd
60d68cd
* Fri Jan 16 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-1
60d68cd
- Updated to 0.6.1
60d68cd
60d68cd
* Mon Oct 06 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-2
60d68cd
- Added >= 1.3.35 for swing
60d68cd
60d68cd
* Sat Aug 09 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-1
60d68cd
- Initial package