d6a271f
%undefine _ld_as_needed
d6a271f
60d68cd
Name:           libkml
60d68cd
Version:        1.3.0
9c594b4
Release:        31%{?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
1a006c0
# TODO: Port to minizip-2.x, meanwhile bundle version 1.3.0
4bdbf5f
# wget -O minizip-1.3.0.tar.gz http://sourceforge.net/projects/libkml-files/files/1.3.0/minizip.tar.gz/download
1a006c0
Source1:        minizip-1.3.0.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
4093b9f
# Add crypt.h which was removed from Fedora minizip package (see #1424609)
4093b9f
Patch6:         libkml_crypth.patch
1a006c0
# Use local file for bundled minizip
1a006c0
Patch7:         libkml-bundle-minizip.patch
49031be
# Fix possible OOB array access in strcmp due to undersized array
49031be
Patch8:         libkml_test_strcmp.patch
60d68cd
60d68cd
BuildRequires:  cmake
60d68cd
BuildRequires:  curl-devel
60d68cd
BuildRequires:  boost-devel
60d68cd
BuildRequires:  expat-devel
60d68cd
BuildRequires:  gtest-devel
a97feaf
BuildRequires:  gcc-c++
60d68cd
BuildRequires:  java-devel
60d68cd
BuildRequires:  junit
a97feaf
BuildRequires:  make
4b5da7b
BuildRequires:  python3-devel
60d68cd
BuildRequires:  swig
60d68cd
BuildRequires:  uriparser-devel
60d68cd
BuildRequires:  zlib-devel
60d68cd
1a006c0
Provides:       bundled(minizip) = 1.3.0
4093b9f
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
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
98bc9bd
mkdir -p %{__cmake_builddir}
98bc9bd
cp -a %{SOURCE1} %{__cmake_builddir}
60d68cd
60d68cd
60d68cd
%build
fc10e41
%global optflags %{optflags} -fPIC
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 \
abfc92a
  -DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_version}$(python3-config --abiflags).so \
abfc92a
  -DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python3_version}$(python3-config --abiflags)/ \
4b5da7b
  -DPYTHON_INSTALL_DIR=%{python3_sitearch} \
60d68cd
  -DBUILD_TESTING=ON \
98bc9bd
  -DBUILD_EXAMPLES=ON
1a006c0
# Parallel build broken
b54e51c
%global _smp_mflags -j1
98bc9bd
%cmake_build
60d68cd
60d68cd
60d68cd
%install
98bc9bd
%cmake_install
60d68cd
60d68cd
60d68cd
%check
e704d59
# Ignore test failures on ppc64le, base_zip_file test segfaults there
e704d59
%ifarch ppc64le
98bc9bd
%ctest || :
e704d59
%else
98bc9bd
%ctest
e704d59
%endif
60d68cd
60d68cd
60d68cd
%files
60d68cd
%license LICENSE
60d68cd
%doc AUTHORS README.md
60d68cd
%{_libdir}/libkml*.so.*
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
9c594b4
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.3.0-31
9c594b4
- Rebuilt for Python 3.10
9c594b4
fbc98b9
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-30
fbc98b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
fbc98b9
65a3353
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-28
65a3353
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
65a3353
2376a0e
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 1.3.0-27
2376a0e
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
2376a0e
ebaf6e2
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-26
ebaf6e2
- Rebuilt for Python 3.9
ebaf6e2
a7edb32
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-25
a7edb32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
a7edb32
49031be
* Wed Oct 30 2019 Sandro Mani <manisandro@gmail.com> - 1.3.0-24
49031be
- Fix possible OOB array access in strcmp due to undersized array
49031be
84805f8
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-23
84805f8
- Rebuilt for Python 3.8.0rc1 (#1748018)
84805f8
83c4af9
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-22
83c4af9
- Rebuilt for Python 3.8
83c4af9
4c31132
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-21
4c31132
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
4c31132
abfc92a
* Mon Jun 03 2019 Sandro Mani <manisandro@gmail.com> - 1.3.0-20
abfc92a
- Don't hard-code abi flags
abfc92a
4f08e16
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-19
4f08e16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
4f08e16
9be7513
* Wed Jan 23 2019 Björn Esser <besser82@fedoraproject.org> - 1.3.0-18
9be7513
- Append curdir to CMake invokation. (#1668512)
9be7513
e8c04f8
* Fri Oct 05 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-17
e8c04f8
- Statically link against bundled minizip
e8c04f8
1a006c0
* Thu Oct 04 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-16
1a006c0
- Drop python2 subpackage (#1634846)
1a006c0
- Bundle minizip (#1632186)
1a006c0
- Remove obsolete scriptlets
1a006c0
44b455c
* Tue Aug 28 2018 Patrik Novotný <panovotn@redhat.com> - 1.3.0-15
44b455c
- change requires to minizip-compat(-devel), rhbz#1609830, rhbz#1615381
44b455c
a69d9bd
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-14
a69d9bd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
a69d9bd
a34be7f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-13
a34be7f
- Rebuilt for Python 3.7
a34be7f
4093b9f
* Tue Jun 19 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-12
4093b9f
- Locally add crypt.h from minizip, which was removed in minizip-devel (see #1424609)
4093b9f
00c870f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-11
00c870f
- Rebuilt for Python 3.7
00c870f
a97feaf
* Sun Feb 18 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-10
a97feaf
- Add missing BR: gcc-c++, make
a97feaf
2c1d50c
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-9
2c1d50c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
2c1d50c
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