d6a271
%undefine _ld_as_needed
d6a271
60d68c
Name:           libkml
60d68c
Version:        1.3.0
a7edb3
Release:        25%{?dist}
60d68c
Summary:        Reference implementation of OGC KML 2.2
60d68c
60d68c
License:        BSD
60d68c
URL:            https://github.com/libkml/libkml
60d68c
Source0:        https://github.com/libkml/libkml/archive/%{version}/libkml-%{version}.tar.gz
1a006c
# TODO: Port to minizip-2.x, meanwhile bundle version 1.3.0
e2cd71
# wget http://sourceforge.net/projects/libkml-files/files/1.3.0/minizip.tar.gz/download
1a006c
Source1:        minizip-1.3.0.tar.gz
60d68c
60d68c
## See https://github.com/libkml/libkml/pull/239
60d68c
Patch0:         0001-Fix-build-failure-due-to-failure-to-convert-pointer-.patch
60d68c
Patch1:         0002-Fix-mistaken-use-of-std-cerr-instead-of-std-endl.patch
60d68c
Patch2:         0003-Fix-python-tests.patch
60d68c
Patch3:         0004-Correctly-build-and-run-java-test.patch
60d68c
# Fix a fragile test failing on i686
60d68c
Patch4:         fragile_test.patch
4b5da7
# Don't bytecompile python sources as part of build process, leave it to rpmbuild
4b5da7
Patch5:         libkml_dont-bytecompile.patch
4093b9
# Add crypt.h which was removed from Fedora minizip package (see #1424609)
4093b9
Patch6:         libkml_crypth.patch
1a006c
# Use local file for bundled minizip
1a006c
Patch7:         libkml-bundle-minizip.patch
49031b
# Fix possible OOB array access in strcmp due to undersized array
49031b
Patch8:         libkml_test_strcmp.patch
60d68c
60d68c
BuildRequires:  cmake
60d68c
BuildRequires:  curl-devel
60d68c
BuildRequires:  boost-devel
60d68c
BuildRequires:  expat-devel
60d68c
BuildRequires:  gtest-devel
a97fea
BuildRequires:  gcc-c++
60d68c
BuildRequires:  java-devel
60d68c
BuildRequires:  junit
a97fea
BuildRequires:  make
4b5da7
BuildRequires:  python3-devel
60d68c
BuildRequires:  swig
60d68c
BuildRequires:  uriparser-devel
60d68c
BuildRequires:  zlib-devel
60d68c
1a006c
Provides:       bundled(minizip) = 1.3.0
4093b9
60d68c
%global __requires_exclude_from ^%{_docdir}/.*$
60d68c
%global __provides_exclude_from ^%{python2_sitearch}/.*\\.so$
60d68c
60d68c
60d68c
%description
60d68c
Reference implementation of OGC KML 2.2.
60d68c
It also includes implementations of Google's gx: extensions used by Google
60d68c
Earth, as well as several utility libraries for working with other formats.
60d68c
60d68c
4b5da7
%package -n python3-%{name}
4b5da7
Summary:        Python 3 bindings for %{name}
4b5da7
Requires:       %{name}%{?_isa} = %{version}-%{release}
4b5da7
%{?python_provide:%python_provide python3-%{name}}
4b5da7
4b5da7
%description -n python3-%{name}
4b5da7
The python3-%{name} package contains Python 3 bindings for %{name}.
60d68c
60d68c
60d68c
%package java
60d68c
Summary:        Java bindings for %{name}
60d68c
Requires:       %{name}%{?_isa} = %{version}-%{release}
60d68c
60d68c
%description java
60d68c
The %{name}-java package contains Java bindings for %{name}.
60d68c
60d68c
60d68c
%package        devel
60d68c
Summary:        Development files for %{name}
60d68c
Requires:       %{name}%{?_isa} = %{version}-%{release}
60d68c
Requires:       boost-devel
60d68c
Requires:       expat-devel
60d68c
60d68c
%description    devel
60d68c
The %{name}-devel package contains libraries and header files for
60d68c
developing applications that use %{name}.
60d68c
60d68c
60d68c
%prep
4b5da7
%autosetup -p1
1a006c
cp -a %{SOURCE1} .
60d68c
60d68c
60d68c
%build
fc10e4
%global optflags %{optflags} -fPIC
60d68c
%cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON -DWITH_JAVA=ON \
60d68c
  -DJNI_INSTALL_DIR=%{_libdir}/%{name} \
60d68c
  -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
60d68c
  -DINCLUDE_INSTALL_DIR=%{_includedir}/kml \
abfc92
  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_version}$(python3-config --abiflags).so \
abfc92
  -DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python3_version}$(python3-config --abiflags)/ \
4b5da7
  -DPYTHON_INSTALL_DIR=%{python3_sitearch} \
60d68c
  -DBUILD_TESTING=ON \
9be751
  -DBUILD_EXAMPLES=ON \
9be751
  .
1a006c
# Parallel build broken
1a006c
make
60d68c
60d68c
60d68c
%install
1a006c
%make_install
60d68c
60d68c
60d68c
%check
e704d5
# Ignore test failures on ppc64le, base_zip_file test segfaults there
e704d5
%ifarch ppc64le
e704d5
ctest -V || :
e704d5
%else
d89c83
ctest -V
e704d5
%endif
60d68c
60d68c
60d68c
%files
60d68c
%license LICENSE
60d68c
%doc AUTHORS README.md
60d68c
%{_libdir}/libkml*.so.*
60d68c
4b5da7
%files -n python3-%{name}
4b5da7
%{python3_sitearch}/*.so
4b5da7
%{python3_sitearch}/*.py
4b5da7
%{python3_sitearch}/__pycache__/*.pyc
4b5da7
60d68c
%files java
60d68c
%{_javadir}/LibKML.jar
60d68c
%{_libdir}/%{name}/
60d68c
60d68c
%files devel
60d68c
%doc examples
60d68c
%{_includedir}/kml/
60d68c
%{_libdir}/libkml*.so
60d68c
%{_libdir}/pkgconfig/%{name}.pc
60d68c
%{_libdir}/cmake/%{name}/
60d68c
60d68c
%changelog
a7edb3
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-25
a7edb3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a7edb3
49031b
* Wed Oct 30 2019 Sandro Mani <manisandro@gmail.com> - 1.3.0-24
49031b
- Fix possible OOB array access in strcmp due to undersized array
49031b
84805f
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-23
84805f
- Rebuilt for Python 3.8.0rc1 (#1748018)
84805f
83c4af
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-22
83c4af
- Rebuilt for Python 3.8
83c4af
4c3113
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-21
4c3113
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
4c3113
abfc92
* Mon Jun 03 2019 Sandro Mani <manisandro@gmail.com> - 1.3.0-20
abfc92
- Don't hard-code abi flags
abfc92
4f08e1
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-19
4f08e1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4f08e1
9be751
* Wed Jan 23 2019 Björn Esser <besser82@fedoraproject.org> - 1.3.0-18
9be751
- Append curdir to CMake invokation. (#1668512)
9be751
e8c04f
* Fri Oct 05 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-17
e8c04f
- Statically link against bundled minizip
e8c04f
1a006c
* Thu Oct 04 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-16
1a006c
- Drop python2 subpackage (#1634846)
1a006c
- Bundle minizip (#1632186)
1a006c
- Remove obsolete scriptlets
1a006c
44b455
* Tue Aug 28 2018 Patrik Novotný <panovotn@redhat.com> - 1.3.0-15
44b455
- change requires to minizip-compat(-devel), rhbz#1609830, rhbz#1615381
44b455
a69d9b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-14
a69d9b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a69d9b
a34be7
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-13
a34be7
- Rebuilt for Python 3.7
a34be7
4093b9
* Tue Jun 19 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-12
4093b9
- Locally add crypt.h from minizip, which was removed in minizip-devel (see #1424609)
4093b9
00c870
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-11
00c870
- Rebuilt for Python 3.7
00c870
a97fea
* Sun Feb 18 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-10
a97fea
- Add missing BR: gcc-c++, make
a97fea
2c1d50
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-9
2c1d50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2c1d50
4b5da7
* Mon Aug 07 2017 Sandro Mani <manisandro@gmail.com> - 1.3.0-8
4b5da7
- Workaround armv7hl FTBFS
4b5da7
- Add python3 bindings
4b5da7
180363
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-7
180363
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
180363
741348
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-6
741348
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
741348
06532e
* Tue Jul 18 2017 Jonathan Wakely <jwakely@redhat.com> - 1.3.0-5
06532e
- Rebuilt for Boost 1.64
06532e
2d59a3
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-4
2d59a3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
2d59a3
c6c08e
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
c6c08e
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
c6c08e
60d68c
* Fri Apr 08 2016 Sandro Mani <manisandro@gmail.com> - 1.3.0-2
60d68c
- Don't call it Google's reference implementation in Summary/Description
60d68c
- Update Source URL
60d68c
- Add python_provide macro
60d68c
- Enable tests
60d68c
60d68c
* Thu Mar 31 2016 Sandro Mani <manisandro@gmail.com> - 1.3.0-1
60d68c
- Update to 1.3.0
60d68c
60d68c
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-8
60d68c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
60d68c
60d68c
* Mon Aug 02 2010 Orcan Ogetbil <oget[dot]fedora[at]gmail[dot]com> - 0.6.1-7
60d68c
- Fix gcc warning that lead to failure due to -Werror flag
60d68c
60d68c
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.6.1-6
60d68c
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
60d68c
60d68c
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-5
60d68c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
60d68c
60d68c
* Sun Apr 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-4
60d68c
- Included *pyc and pyo files in %%files and added BuildRequires libgcj-devel.
60d68c
60d68c
* Sun Apr 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-3
60d68c
- libkml-0.6.1.configure_ac.patch patch for swig > 1.3.35
60d68c
60d68c
* Sat Mar 07 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-2
60d68c
- updated to 0.6.1
60d68c
- libkml-third_party_removal.diff Removes third part dependency
60d68c
- (provided by Peter Lemenkov)
60d68c
60d68c
* Fri Jan 16 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-1
60d68c
- Updated to 0.6.1
60d68c
60d68c
* Mon Oct 06 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-2
60d68c
- Added >= 1.3.35 for swing
60d68c
60d68c
* Sat Aug 09 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-1
60d68c
- Initial package