The package rpms/libkml.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/libkml.git/commit/?id=f8cf2028144....
Change:
-%ifarch ppc64le
Thanks.
Full change:
============
commit e5af971b098caad9cac4c6eb6093cee9862b6348
Author: Sandro Mani <manisandro(a)gmail.com>
Date: Thu Feb 24 20:12:40 2022 +0100
Make mingw subpackages noarch
diff --git a/libkml.spec b/libkml.spec
index 7ce72be..edae763 100644
--- a/libkml.spec
+++ b/libkml.spec
@@ -5,7 +5,7 @@
Name: libkml
Version: 1.3.0
-Release: 36%{?dist}
+Release: 37%{?dist}
Summary: Reference implementation of OGC KML 2.2
License: BSD
@@ -112,6 +112,7 @@ developing applications that use %{name}.
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
Requires: mingw32-boost
+BuildArch: noarch
%description -n mingw32-%{name}
MinGW Windows %{name} library.
@@ -120,6 +121,7 @@ MinGW Windows %{name} library.
%package -n mingw32-python3-%{name}
Summary: MinGW Windows Python 3 %{name} library
Requires: mingw32-%{name} = %{version}-%{release}
+BuildArch: noarch
%description -n mingw32-python3-%{name}
MinGW Windows Python 3 %{name} library.
@@ -128,6 +130,7 @@ MinGW Windows Python 3 %{name} library.
%package -n mingw64-%{name}
Summary: MinGW Windows %{name} library
Requires: mingw64-boost
+BuildArch: noarch
%description -n mingw64-%{name}
MinGW Windows %{name} library.
@@ -136,6 +139,7 @@ MinGW Windows %{name} library.
%package -n mingw64-python3-%{name}
Summary: MinGW Windows Python 3 %{name} library
Requires: mingw64-%{name} = %{version}-%{release}
+BuildArch: noarch
%description -n mingw64-python3-%{name}
MinGW Windows Python 3 %{name} library.
@@ -259,6 +263,9 @@ export MINGW64_CMAKE_ARGS="\
%changelog
+* Thu Feb 24 2022 Sandro Mani <manisandro(a)gmail.com> - 1.3.0-37
+- Make mingw subpackages noarch
+
* Mon Feb 21 2022 Sandro Mani <manisandro(a)gmail.com> - 1.3.0-36
- Add mingw subpackages
commit f8cf20281445634895ef244c7d610db00f990013
Author: Sandro Mani <manisandro(a)gmail.com>
Date: Thu Feb 24 11:31:42 2022 +0100
Add mingw subpackages
diff --git a/libkml.spec b/libkml.spec
index afcc240..7ce72be 100644
--- a/libkml.spec
+++ b/libkml.spec
@@ -1,9 +1,11 @@
-%undefine _ld_as_needed
+# Parallel build broken
+%global _smp_mflags -j1
+
%bcond_with java
Name: libkml
Version: 1.3.0
-Release: 35%{?dist}
+Release: 36%{?dist}
Summary: Reference implementation of OGC KML 2.2
License: BSD
@@ -28,6 +30,8 @@ Patch6: libkml_crypth.patch
Patch7: libkml-bundle-minizip.patch
# Fix possible OOB array access in strcmp due to undersized array
Patch8: libkml_test_strcmp.patch
+# MinGW build fixes
+Patch9: libkml_mingw.patch
BuildRequires: cmake
BuildRequires: curl-devel
@@ -45,10 +49,28 @@ BuildRequires: java-devel
BuildRequires: junit
%endif
+BuildRequires: mingw32-filesystem >= 95
+BuildRequires: mingw32-gcc-c++
+BuildRequires: mingw32-boost
+BuildRequires: mingw32-curl
+BuildRequires: mingw32-expat
+BuildRequires: mingw32-python3
+BuildRequires: mingw32-uriparser
+BuildRequires: mingw32-zlib
+
+BuildRequires: mingw64-filesystem >= 95
+BuildRequires: mingw64-gcc-c++
+BuildRequires: mingw64-boost
+BuildRequires: mingw64-curl
+BuildRequires: mingw64-expat
+BuildRequires: mingw64-python3
+BuildRequires: mingw64-uriparser
+BuildRequires: mingw64-zlib
+
Provides: bundled(minizip) = 1.3.0
%global __requires_exclude_from ^%{_docdir}/.*$
-%global __provides_exclude_from ^%{python2_sitearch}/.*\\.so$
+%global __provides_exclude_from ^%{python3_sitearch}/.*\\.so$
%description
@@ -87,14 +109,60 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
+%package -n mingw32-%{name}
+Summary: MinGW Windows %{name} library
+Requires: mingw32-boost
+
+%description -n mingw32-%{name}
+MinGW Windows %{name} library.
+
+
+%package -n mingw32-python3-%{name}
+Summary: MinGW Windows Python 3 %{name} library
+Requires: mingw32-%{name} = %{version}-%{release}
+
+%description -n mingw32-python3-%{name}
+MinGW Windows Python 3 %{name} library.
+
+
+%package -n mingw64-%{name}
+Summary: MinGW Windows %{name} library
+Requires: mingw64-boost
+
+%description -n mingw64-%{name}
+MinGW Windows %{name} library.
+
+
+%package -n mingw64-python3-%{name}
+Summary: MinGW Windows Python 3 %{name} library
+Requires: mingw64-%{name} = %{version}-%{release}
+
+%description -n mingw64-python3-%{name}
+MinGW Windows Python 3 %{name} library.
+
+
+%{?mingw_debug_package}
+
+
%prep
-%autosetup -p1
-mkdir -p %{__cmake_builddir}
-cp -a %{SOURCE1} %{__cmake_builddir}
+%autosetup -p1 -a1
%build
-%global optflags %{optflags} -fPIC
+# Build bundled minizip
+pushd minizip
+(
+%cmake -DBUILD_SHARED_LIBS=OFF
+%cmake_build
+)
+
+(
+%mingw_cmake -DBUILD_SHARED_LIBS=OFF
+%mingw_make_build
+)
+popd
+
+# Native build
%cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON \
%if %{with java}
-DWITH_JAVA=ON -DJNI_INSTALL_DIR=%{_libdir}/%{name} \
@@ -104,24 +172,44 @@ cp -a %{SOURCE1} %{__cmake_builddir}
-DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_version}$(python3-config --abiflags).so
\
-DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python3_version}$(python3-config
--abiflags)/ \
-DPYTHON_INSTALL_DIR=%{python3_sitearch} \
+ -DMINIZIP_INCLUDE_DIR=$PWD
-DMINIZIP_LIBRARY=$PWD/minizip/%{_vpath_builddir}/libminizip.a \
-DBUILD_TESTING=ON \
-DBUILD_EXAMPLES=ON
-# Parallel build broken
-%global _smp_mflags -j1
%cmake_build
+export MINGW32_CMAKE_ARGS="\
+ -DCMAKE_INSTALL_DIR=%{mingw32_libdir}/cmake/%{name} \
+ -DINCLUDE_INSTALL_DIR=%{mingw32_includedir}/kml \
+ -DPYTHON_LIBRARY=%{mingw32_libdir}/libpython%{mingw32_python3_version}.dll.a \
+ -DPYTHON_INCLUDE_DIR=%{mingw32_includedir}/python%{mingw32_python3_version}/ \
+ -DPYTHON_INSTALL_DIR=%{mingw32_python3_sitearch} \
+ -DMINIZIP_INCLUDE_DIR=$PWD
-DMINIZIP_LIBRARY=$PWD/minizip/build_win32/libminizip.a"
+
+export MINGW64_CMAKE_ARGS="\
+ -DCMAKE_INSTALL_DIR=%{mingw64_libdir}/cmake/%{name} \
+ -DINCLUDE_INSTALL_DIR=%{mingw64_includedir}/kml \
+ -DPYTHON_LIBRARY=%{mingw64_libdir}/libpython%{mingw64_python3_version}.dll.a \
+ -DPYTHON_INCLUDE_DIR=%{mingw64_includedir}/python%{mingw64_python3_version}/ \
+ -DPYTHON_INSTALL_DIR=%{mingw64_python3_sitearch} \
+ -DMINIZIP_INCLUDE_DIR=$PWD
-DMINIZIP_LIBRARY=$PWD/minizip/build_win64/libminizip.a"
+
+# MinGW build
+%mingw_cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON \
+ -DBUILD_TESTING=OFF \
+ -DBUILD_EXAMPLES=OFF
+%mingw_make_build
+
%install
%cmake_install
+%mingw_make_install
+
+
+%mingw_debug_install_post
%check
-# Ignore test failures on ppc64le, base_zip_file test segfaults there
-%ifarch ppc64le
-%ctest || :
-%else
%ctest
-%endif
%files
@@ -147,7 +235,33 @@ cp -a %{SOURCE1} %{__cmake_builddir}
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/cmake/%{name}/
+%files -n mingw32-%{name}
+%license LICENSE
+%{mingw32_bindir}/%{name}*.dll
+%{mingw32_includedir}/kml/
+%{mingw32_libdir}/%{name}*.dll.a
+%{mingw32_libdir}/pkgconfig/%{name}.pc
+%{mingw32_libdir}/cmake/%{name}/
+
+%files -n mingw32-python3-%{name}
+%{mingw32_python3_sitearch}/*.py*
+
+%files -n mingw64-%{name}
+%license LICENSE
+%{mingw64_bindir}/%{name}*.dll
+%{mingw64_includedir}/kml/
+%{mingw64_libdir}/%{name}*.dll.a
+%{mingw64_libdir}/pkgconfig/%{name}.pc
+%{mingw64_libdir}/cmake/%{name}/
+
+%files -n mingw64-python3-%{name}
+%{mingw64_python3_sitearch}/*.py*
+
+
%changelog
+* Mon Feb 21 2022 Sandro Mani <manisandro(a)gmail.com> - 1.3.0-36
+- Add mingw subpackages
+
* Sat Feb 05 2022 Jiri Vanek <jvanek(a)redhat.com> - 1.3.0-35
- Rebuilt for java-17-openjdk as system jdk
diff --git a/libkml_mingw.patch b/libkml_mingw.patch
new file mode 100644
index 0000000..1fdabf0
--- /dev/null
+++ b/libkml_mingw.patch
@@ -0,0 +1,47 @@
+diff -rupN libkml-1.3.0/src/kml/base/file_win32.cc
libkml-1.3.0-new/src/kml/base/file_win32.cc
+--- libkml-1.3.0/src/kml/base/file_win32.cc 2015-12-21 18:23:05.000000000 +0100
++++ libkml-1.3.0-new/src/kml/base/file_win32.cc 2017-10-30 11:45:08.434800533 +0100
+@@ -34,7 +34,6 @@
+ #include "kml/base/file.h"
+ #include <windows.h>
+ #include <tchar.h>
+-#include <xstring>
+ #include <algorithm>
+
+ namespace kmlbase {
+@@ -42,7 +41,7 @@ namespace kmlbase {
+ // Internal to the win32 file class. We need a conversion from string to
+ // LPCWSTR.
+ static std::wstring Str2Wstr(const string& str) {
+- std::wstring wstr(str.length(), L'');
++ std::wstring wstr(str.length(), '\0');
+ std::copy(str.begin(), str.end(), wstr.begin());
+ return wstr;
+ }
+@@ -62,7 +61,7 @@ bool File::Exists(const string& full_pat
+ return false;
+ }
+ std::wstring wstr = Str2Wstr(full_path);
+- DWORD attrs = ::GetFileAttributes(wstr.c_str());
++ DWORD attrs = ::GetFileAttributesW(wstr.c_str());
+ return (attrs != INVALID_FILE_ATTRIBUTES) &&
+ ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0);
+ }
+@@ -72,7 +71,7 @@ bool File::Delete(const string& filepath
+ return false;
+ }
+ std::wstring wstr = Str2Wstr(filepath);
+- return ::DeleteFile(wstr.c_str()) ? true : false;
++ return ::DeleteFileW(wstr.c_str()) ? true : false;
+ }
+
+ static const unsigned int BUFSIZE = 1024;
+@@ -97,7 +96,7 @@ bool File::CreateNewTempFile(string* pat
+ if (uRetVal == 0) {
+ return false;
+ }
+- string str = Wstr2Str(szTempName);
++ string str = szTempName;
+ path->assign(str.c_str(), strlen(str.c_str()));
+ return true;
+ }