Compare commits
No commits in common. "master" and "f17" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
libkml-0.6.1.tar.gz
|
libkml-0.6.1.tar.gz
|
||||||
/libkml-1.3.0.tar.gz
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,71 +0,0 @@
|
|||||||
From 77cf351a61f3683b74e07857ca77b5580d1cedf0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sandro Mani <manisandro@gmail.com>
|
|
||||||
Date: Fri, 8 Apr 2016 23:21:26 +0200
|
|
||||||
Subject: [PATCH 2/4] Fix mistaken use of std::cerr instead of std::endl
|
|
||||||
|
|
||||||
---
|
|
||||||
examples/engine/inlinestyles.cc | 8 ++++----
|
|
||||||
examples/engine/splitstyles.cc | 8 ++++----
|
|
||||||
2 files changed, 8 insertions(+), 8 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/examples/engine/inlinestyles.cc b/examples/engine/inlinestyles.cc
|
|
||||||
index 1cb4755..8ad1f57 100644
|
|
||||||
--- a/examples/engine/inlinestyles.cc
|
|
||||||
+++ b/examples/engine/inlinestyles.cc
|
|
||||||
@@ -35,20 +35,20 @@
|
|
||||||
bool InlineStyles(const char* input_filename, const char* output_filename) {
|
|
||||||
std::string kml_input;
|
|
||||||
if (!kmlbase::File::ReadFileToString(input_filename, &kml_input)) {
|
|
||||||
- std::cerr << "read failed: " << input_filename << std::cerr;
|
|
||||||
+ std::cerr << "read failed: " << input_filename << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
std::string errors;
|
|
||||||
kmldom::ElementPtr root = kmlengine::InlineStyles(kml_input, &errors);
|
|
||||||
if (!root) {
|
|
||||||
- std::cerr << "parse failed: " << input_filename << std::cerr;
|
|
||||||
- std::cerr << "parse failed: " << errors << std::cerr;
|
|
||||||
+ std::cerr << "parse failed: " << input_filename << std::endl;
|
|
||||||
+ std::cerr << "parse failed: " << errors << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string kml_output = kmldom::SerializePretty(root);
|
|
||||||
if (!kmlbase::File::WriteStringToFile(kml_output, output_filename)) {
|
|
||||||
- std::cerr << "write failed: " << output_filename << std::cerr;
|
|
||||||
+ std::cerr << "write failed: " << output_filename << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
diff --git a/examples/engine/splitstyles.cc b/examples/engine/splitstyles.cc
|
|
||||||
index a3b190a..56203c9 100644
|
|
||||||
--- a/examples/engine/splitstyles.cc
|
|
||||||
+++ b/examples/engine/splitstyles.cc
|
|
||||||
@@ -35,20 +35,20 @@
|
|
||||||
bool SplitStyles(const char* input_filename, const char* output_filename) {
|
|
||||||
std::string kml_input;
|
|
||||||
if (!kmlbase::File::ReadFileToString(input_filename, &kml_input)) {
|
|
||||||
- std::cerr << "read failed: " << input_filename << std::cerr;
|
|
||||||
+ std::cerr << "read failed: " << input_filename << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
std::string errors;
|
|
||||||
kmldom::ElementPtr root = kmlengine::SplitStyles(kml_input, &errors);
|
|
||||||
if (!root) {
|
|
||||||
- std::cerr << "parse failed: " << input_filename << std::cerr;
|
|
||||||
- std::cerr << "parse failed: " << errors << std::cerr;
|
|
||||||
+ std::cerr << "parse failed: " << input_filename << std::endl;
|
|
||||||
+ std::cerr << "parse failed: " << errors << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string kml_output = kmldom::SerializePretty(root);
|
|
||||||
if (!kmlbase::File::WriteStringToFile(kml_output, output_filename)) {
|
|
||||||
- std::cerr << "write failed: " << output_filename << std::cerr;
|
|
||||||
+ std::cerr << "write failed: " << output_filename << std::endl;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
--
|
|
||||||
2.8.1
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
|||||||
From b728c0815edc06c826fb5be8cd25cbb7f3b816b3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sandro Mani <manisandro@gmail.com>
|
|
||||||
Date: Fri, 8 Apr 2016 23:22:12 +0200
|
|
||||||
Subject: [PATCH 3/4] Fix python tests
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/swig/CMakeLists.txt | 6 ++++++
|
|
||||||
tests/swig/kmldom_test.py | 2 +-
|
|
||||||
tests/swig/kmlengine_test.py | 3 ++-
|
|
||||||
3 files changed, 9 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tests/swig/CMakeLists.txt b/tests/swig/CMakeLists.txt
|
|
||||||
index 52e398e..5ba1cd1 100644
|
|
||||||
--- a/tests/swig/CMakeLists.txt
|
|
||||||
+++ b/tests/swig/CMakeLists.txt
|
|
||||||
@@ -1,12 +1,18 @@
|
|
||||||
if(WITH_PYTHON)
|
|
||||||
add_test(NAME test_python_kmlbase
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/kmlbase_test.py)
|
|
||||||
+set_tests_properties(test_python_kmlbase
|
|
||||||
+ PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/src/swig:${CMAKE_BINARY_DIR}/lib")
|
|
||||||
|
|
||||||
add_test(NAME test_python_kmldom
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/kmldom_test.py)
|
|
||||||
+set_tests_properties(test_python_kmldom
|
|
||||||
+ PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/src/swig:${CMAKE_BINARY_DIR}/lib")
|
|
||||||
|
|
||||||
add_test(NAME test_python_kmlengine
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/kmlengine_test.py)
|
|
||||||
+set_tests_properties(test_python_kmlengine
|
|
||||||
+ PROPERTIES ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/src/swig:${CMAKE_BINARY_DIR}/lib")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_JAVA)
|
|
||||||
diff --git a/tests/swig/kmldom_test.py b/tests/swig/kmldom_test.py
|
|
||||||
index e18c5a7..4762d6e 100644
|
|
||||||
--- a/tests/swig/kmldom_test.py
|
|
||||||
+++ b/tests/swig/kmldom_test.py
|
|
||||||
@@ -753,7 +753,7 @@ def TestColorStyle(colorstyle):
|
|
||||||
color = kmlbase.Color32(0xf0f0c80f)
|
|
||||||
colorstyle.set_color(color)
|
|
||||||
assert colorstyle.has_color()
|
|
||||||
- assert color == colorstyle.get_color()
|
|
||||||
+ assert color.to_string_argb() == colorstyle.get_color().to_string_argb()
|
|
||||||
# Clear <color> and verify has_
|
|
||||||
colorstyle.clear_color()
|
|
||||||
assert not colorstyle.has_color()
|
|
||||||
diff --git a/tests/swig/kmlengine_test.py b/tests/swig/kmlengine_test.py
|
|
||||||
index 8850221..7eb3c09 100644
|
|
||||||
--- a/tests/swig/kmlengine_test.py
|
|
||||||
+++ b/tests/swig/kmlengine_test.py
|
|
||||||
@@ -32,6 +32,7 @@ This file contains unit tests for the KML Engine Python SWIG bindings.
|
|
||||||
import unittest
|
|
||||||
import kmldom
|
|
||||||
import kmlengine
|
|
||||||
+import os
|
|
||||||
|
|
||||||
# These VerySimple tests really only verify that the function/class exists.
|
|
||||||
|
|
||||||
@@ -239,7 +240,7 @@ class BasicKmlFileSerializeToStringTestCase(unittest.TestCase):
|
|
||||||
|
|
||||||
class BasicKmzFileTestCase(unittest.TestCase):
|
|
||||||
def runTest(self):
|
|
||||||
- kmz_filepath = '../../testdata/kmz/model-macky.kmz'
|
|
||||||
+ kmz_filepath = os.path.join(os.path.dirname(__file__), '../../testdata/kmz/model-macky.kmz')
|
|
||||||
kmzfile = kmlengine.KmzFile.OpenFromFile(kmz_filepath)
|
|
||||||
assert kmzfile
|
|
||||||
(ok, kml) = kmzfile.ReadKml()
|
|
||||||
--
|
|
||||||
2.8.1
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
|||||||
From 2382618c2de489b860228b74283a581b4333030d Mon Sep 17 00:00:00 2001
|
|
||||||
From: Sandro Mani <manisandro@gmail.com>
|
|
||||||
Date: Fri, 8 Apr 2016 23:23:20 +0200
|
|
||||||
Subject: [PATCH 4/4] Correctly build and run java test
|
|
||||||
|
|
||||||
---
|
|
||||||
cmake/JUnit.cmake | 38 ++++++++++++++++++++++++++++++++++++++
|
|
||||||
tests/swig/CMakeLists.txt | 23 +++++++++++++++++------
|
|
||||||
2 files changed, 55 insertions(+), 6 deletions(-)
|
|
||||||
create mode 100644 cmake/JUnit.cmake
|
|
||||||
|
|
||||||
diff --git a/cmake/JUnit.cmake b/cmake/JUnit.cmake
|
|
||||||
new file mode 100644
|
|
||||||
index 0000000..3c114fd
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/cmake/JUnit.cmake
|
|
||||||
@@ -0,0 +1,38 @@
|
|
||||||
+include(FindJava)
|
|
||||||
+
|
|
||||||
+# add_junit_test(<target name>
|
|
||||||
+# CLASSPATH [path1 ...]
|
|
||||||
+# TESTS [class1 ...]
|
|
||||||
+# )
|
|
||||||
+function(add_junit_test TARGET_NAME)
|
|
||||||
+
|
|
||||||
+ if (WIN32 AND NOT CYGWIN)
|
|
||||||
+ set(SEPARATOR ";")
|
|
||||||
+ else (WIN32 AND NOT CYGWIN)
|
|
||||||
+ set(SEPARATOR ":")
|
|
||||||
+ endif(WIN32 AND NOT CYGWIN)
|
|
||||||
+
|
|
||||||
+ foreach (ARG ${ARGN})
|
|
||||||
+ if (ARG MATCHES "CLASSPATH" OR ARG MATCHES "TESTS" OR ARG MATCHES "JVMARGS")
|
|
||||||
+ set(TYPE ${ARG})
|
|
||||||
+
|
|
||||||
+ else ()
|
|
||||||
+
|
|
||||||
+ if (TYPE MATCHES "CLASSPATH")
|
|
||||||
+ set(CLASSPATH "${CLASSPATH}${SEPARATOR}${ARG}")
|
|
||||||
+
|
|
||||||
+ elseif (TYPE MATCHES "TESTS")
|
|
||||||
+ set(TESTS ${TESTS} ${ARG})
|
|
||||||
+
|
|
||||||
+ elseif (TYPE MATCHES "JVMARGS")
|
|
||||||
+ set(JVMARGS ${JVMARGS} ${ARG})
|
|
||||||
+
|
|
||||||
+ endif()
|
|
||||||
+
|
|
||||||
+ endif()
|
|
||||||
+
|
|
||||||
+ endforeach(ARG)
|
|
||||||
+
|
|
||||||
+ add_test(NAME ${TARGET_NAME} COMMAND ${Java_JAVA_EXECUTABLE} ${JVMARGS} -classpath ${CLASSPATH} org.junit.runner.JUnitCore ${TESTS})
|
|
||||||
+
|
|
||||||
+endfunction(add_junit_test)
|
|
||||||
diff --git a/tests/swig/CMakeLists.txt b/tests/swig/CMakeLists.txt
|
|
||||||
index 5ba1cd1..c859d4d 100644
|
|
||||||
--- a/tests/swig/CMakeLists.txt
|
|
||||||
+++ b/tests/swig/CMakeLists.txt
|
|
||||||
@@ -16,10 +16,21 @@ set_tests_properties(test_python_kmlengine
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_JAVA)
|
|
||||||
-add_test( NAME test_java_kmlbase
|
|
||||||
- COMMAND
|
|
||||||
- ${Java_JAVA_EXECUTABLE}
|
|
||||||
- -cp "${CMAKE_JAVA_INCLUDE_PATH}${PATH_SEPARATOR}${CMAKE_BINARY_DIR}/src/swig/LibKML.jar;${CMAKE_CURRENT_BINARY_DIR}"
|
|
||||||
- KmlBaseTest )
|
|
||||||
+include(UseJava)
|
|
||||||
+include(JUnit)
|
|
||||||
+find_file(JUNIT_JAR NAMES junit.jar PATHS ${JAVA_LIB_INSTALL_DIR} /usr/share/java)
|
|
||||||
+find_file(HAMCREST_JAR NAMES hamcrest/core.jar PATHS ${JAVA_LIB_INSTALL_DIR} /usr/share/java)
|
|
||||||
|
|
||||||
-endif()
|
|
||||||
\ No newline at end of file
|
|
||||||
+add_jar(KmlBaseTest KmlBaseTest.java INCLUDE_JARS /usr/share/java/junit.jar ${CMAKE_BINARY_DIR}/src/swig/LibKML.jar)
|
|
||||||
+add_dependencies(KmlBaseTest LibKML_jar)
|
|
||||||
+
|
|
||||||
+if(WIN32 AND NOT CYGWIN)
|
|
||||||
+ set(PATH_SEPARATOR ";")
|
|
||||||
+else(WIN32 AND NOT CYGWIN)
|
|
||||||
+ set(PATH_SEPARATOR ":")
|
|
||||||
+endif(WIN32 AND NOT CYGWIN)
|
|
||||||
+
|
|
||||||
+add_junit_test(test_java_kmlbase CLASSPATH "${JUNIT_JAR}${PATH_SEPARATOR}${HAMCREST_JAR}${PATH_SEPARATOR}${CMAKE_BINARY_DIR}/src/swig/LibKML.jar${PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}/KmlBaseTest.jar" TESTS KmlBaseTest)
|
|
||||||
+set_tests_properties(test_java_kmlbase
|
|
||||||
+ PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
|
|
||||||
+endif()
|
|
||||||
--
|
|
||||||
2.8.1
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/tests/kml/engine/feature_view_test.cc b/tests/kml/engine/feature_view_test.cc
|
|
||||||
index ce572bb..0b53851 100644
|
|
||||||
--- a/tests/kml/engine/feature_view_test.cc
|
|
||||||
+++ b/tests/kml/engine/feature_view_test.cc
|
|
||||||
@@ -144,7 +144,7 @@ TEST(FeatureViewTest, TestComputeBboxLookAt) {
|
|
||||||
// These fields are expected to be set to these values.
|
|
||||||
ASSERT_DOUBLE_EQ(-86.032775, lookat->get_longitude());
|
|
||||||
ASSERT_DOUBLE_EQ(35.78925, lookat->get_latitude());
|
|
||||||
- ASSERT_DOUBLE_EQ(712928.68603440293, lookat->get_range());
|
|
||||||
+ ASSERT_NEAR(712928.68603440, lookat->get_range(), 0.0000001);
|
|
||||||
// These fields are not set by ComputeBboxLookAt.
|
|
||||||
ASSERT_FALSE(lookat->has_altitude());
|
|
||||||
ASSERT_FALSE(lookat->has_heading());
|
|
13
libkml-0.6.1.configure_ac.patch
Normal file
13
libkml-0.6.1.configure_ac.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- libkml-0.6.1.org/configure.ac 2009-04-13 09:24:15.041537747 +0530
|
||||||
|
+++ libkml-0.6.1/configure.ac 2009-04-13 09:25:24.670599502 +0530
|
||||||
|
@@ -72,8 +72,8 @@
|
||||||
|
AC_CHECK_PROG(SWIG, swig, swig)
|
||||||
|
if test "x$SWIG" != x; then
|
||||||
|
SWIG_VERSION=`swig -version 2>&1|grep Version|cut -d" " -f3`
|
||||||
|
- if test $SWIG_VERSION != 1.3.35; then
|
||||||
|
- AC_MSG_WARN([You have SWIG $SWIG_VERSION installed, but libkml requires SWIG 1.3.35. The bindings will not be built.])
|
||||||
|
+ if test $SWIG_VERSION >= 1.3.35; then
|
||||||
|
+ AC_MSG_WARN([You have SWIG have $SWIG_VERSION installed, but libkml requires greater then SWIG 1.3.35. The bindings will not be built.])
|
||||||
|
SWIG=
|
||||||
|
fi
|
||||||
|
fi
|
12
libkml-fix-gcc-warning.patch
Normal file
12
libkml-fix-gcc-warning.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -rupN libkml-0.6.1.old/src/kml/dom/geometry.cc libkml-0.6.1/src/kml/dom/geometry.cc
|
||||||
|
--- libkml-0.6.1.old/src/kml/dom/geometry.cc 2009-01-09 14:31:00.000000000 -0500
|
||||||
|
+++ libkml-0.6.1/src/kml/dom/geometry.cc 2010-08-02 02:30:23.000000000 -0400
|
||||||
|
@@ -117,7 +117,7 @@ bool Coordinates::ParseVec3(const char*
|
||||||
|
}
|
||||||
|
if (nextp) {
|
||||||
|
while (isspace(*endp)) { // Eat the remaining whitespace before return.
|
||||||
|
- *endp++;
|
||||||
|
+ (void)*endp++;
|
||||||
|
}
|
||||||
|
*nextp = endp;
|
||||||
|
}
|
1016
libkml-third_party_removal.diff
Normal file
1016
libkml-third_party_removal.diff
Normal file
File diff suppressed because it is too large
Load Diff
255
libkml.spec
255
libkml.spec
@ -1,207 +1,124 @@
|
|||||||
|
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||||
|
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||||
|
|
||||||
Name: libkml
|
Name: libkml
|
||||||
Version: 1.3.0
|
Version: 0.6.1
|
||||||
Release: 10%{?dist}
|
Release: 10%{?dist}
|
||||||
Summary: Reference implementation of OGC KML 2.2
|
Summary: A KML library written in C++ with bindings to other languagues
|
||||||
|
|
||||||
|
Group: Development/Libraries
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: https://github.com/libkml/libkml
|
URL: http://code.google.com/p/%{name}/
|
||||||
Source0: https://github.com/libkml/libkml/archive/%{version}/libkml-%{version}.tar.gz
|
Source0: http://%{name}.googlecode.com/files/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: libkml-third_party_removal.diff
|
||||||
|
Patch1: libkml-0.6.1.configure_ac.patch
|
||||||
|
Patch2: libkml-fix-gcc-warning.patch
|
||||||
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
## See https://github.com/libkml/libkml/pull/239
|
# requires swig >= 1.3.35
|
||||||
Patch0: 0001-Fix-build-failure-due-to-failure-to-convert-pointer-.patch
|
BuildRequires: cppunit, swig >= 1.3.35
|
||||||
Patch1: 0002-Fix-mistaken-use-of-std-cerr-instead-of-std-endl.patch
|
BuildRequires: java-devel, libcurl-devel
|
||||||
Patch2: 0003-Fix-python-tests.patch
|
BuildRequires: expat-devel, python-devel, chrpath
|
||||||
Patch3: 0004-Correctly-build-and-run-java-test.patch
|
BuildRequires: minizip-devel, uriparser-devel, zlib-devel
|
||||||
# Fix a fragile test failing on i686
|
|
||||||
Patch4: fragile_test.patch
|
|
||||||
# Don't bytecompile python sources as part of build process, leave it to rpmbuild
|
|
||||||
Patch5: libkml_dont-bytecompile.patch
|
|
||||||
|
|
||||||
BuildRequires: cmake
|
|
||||||
BuildRequires: curl-devel
|
|
||||||
BuildRequires: boost-devel
|
BuildRequires: boost-devel
|
||||||
BuildRequires: expat-devel
|
BuildRequires: autoconf, libtool
|
||||||
BuildRequires: gtest-devel
|
BuildRequires: libgcj-devel
|
||||||
BuildRequires: gcc-c++
|
Requires: python, java
|
||||||
BuildRequires: java-devel
|
|
||||||
BuildRequires: junit
|
|
||||||
BuildRequires: make
|
|
||||||
BuildRequires: minizip-devel
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
|
||||||
BuildRequires: python2-devel
|
|
||||||
BuildRequires: python3-devel
|
|
||||||
%else
|
|
||||||
BuildRequires: python-devel
|
|
||||||
%endif
|
|
||||||
BuildRequires: swig
|
|
||||||
BuildRequires: uriparser-devel
|
|
||||||
BuildRequires: zlib-devel
|
|
||||||
|
|
||||||
%global __requires_exclude_from ^%{_docdir}/.*$
|
|
||||||
%global __provides_exclude_from ^%{python2_sitearch}/.*\\.so$
|
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Reference implementation of OGC KML 2.2.
|
Libkml is an implementation of the OGC KML 2.2 standard. is written in
|
||||||
It also includes implementations of Google's gx: extensions used by Google
|
C++ and bindings are available via SWIG to other languages. It can be
|
||||||
Earth, as well as several utility libraries for working with other formats.
|
used in applications that want to parse, generate and operate on KML.
|
||||||
|
|
||||||
|
|
||||||
%package -n python2-%{name}
|
|
||||||
Summary: Python 2 bindings for %{name}
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
||||||
%{?python_provide:%python_provide python2-%{name}}
|
|
||||||
|
|
||||||
%description -n python2-%{name}
|
|
||||||
The python2-%{name} package contains Python 2 bindings for %{name}.
|
|
||||||
|
|
||||||
|
|
||||||
%package -n python3-%{name}
|
|
||||||
Summary: Python 3 bindings for %{name}
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
||||||
%{?python_provide:%python_provide python3-%{name}}
|
|
||||||
|
|
||||||
%description -n python3-%{name}
|
|
||||||
The python3-%{name} package contains Python 3 bindings for %{name}.
|
|
||||||
|
|
||||||
|
|
||||||
%package java
|
|
||||||
Summary: Java bindings for %{name}
|
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
||||||
|
|
||||||
%description java
|
|
||||||
The %{name}-java package contains Java bindings for %{name}.
|
|
||||||
|
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for %{name}
|
Summary: Development files for %{name}
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Group: Development/Libraries
|
||||||
Requires: boost-devel
|
Requires: %{name} = %{version}-%{release}
|
||||||
Requires: expat-devel
|
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
The %{name}-devel package contains libraries and header files for
|
The %{name}-devel package contains libraries and header files for
|
||||||
developing applications that use %{name}.
|
developing applications that use %{name}.
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%setup -q
|
||||||
|
rm -rf third_party
|
||||||
|
%patch0 -p0 -b .third_party
|
||||||
|
%patch1 -p1 -b .configure_ac
|
||||||
|
%patch2 -p1 -b .fixwarning
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir build_py2
|
autoreconf -fi
|
||||||
pushd build_py2
|
%configure --disable-static \
|
||||||
%ifarch armv7hl
|
--with-java-include-dir=%{_jvmdir}/java
|
||||||
%define awtlib -DJAVA_AWT_LIBRARY=`find /usr/lib/jvm/ -name libjawt.so | grep jre/lib/arm \`
|
make %{?_smp_mflags}
|
||||||
%endif
|
|
||||||
%cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON -DWITH_JAVA=ON \
|
|
||||||
-DJNI_INSTALL_DIR=%{_libdir}/%{name} \
|
|
||||||
-DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
|
|
||||||
-DINCLUDE_INSTALL_DIR=%{_includedir}/kml \
|
|
||||||
-DPYTHON_LIBRARY=%{_libdir}/libpython%{python2_version}.so \
|
|
||||||
-DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python2_version}/ \
|
|
||||||
-DPYTHON_INSTALL_DIR=%{python2_sitearch} \
|
|
||||||
%{?awtlib} \
|
|
||||||
-DBUILD_TESTING=ON \
|
|
||||||
-DBUILD_EXAMPLES=ON \
|
|
||||||
..
|
|
||||||
%make_build
|
|
||||||
popd
|
|
||||||
|
|
||||||
mkdir build_py3
|
|
||||||
pushd build_py3
|
|
||||||
%cmake -DWITH_SWIG=ON -DWITH_PYTHON=ON -DWITH_JAVA=OFF \
|
|
||||||
-DJNI_INSTALL_DIR=%{_libdir}/%{name} \
|
|
||||||
-DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
|
|
||||||
-DINCLUDE_INSTALL_DIR=%{_includedir}/kml \
|
|
||||||
-DPYTHON_LIBRARY=%{_libdir}/libpython%{python3_version}m.so \
|
|
||||||
-DPYTHON_INCLUDE_DIR=%{_includedir}/python%{python3_version}m/ \
|
|
||||||
-DPYTHON_INSTALL_DIR=%{python3_sitearch} \
|
|
||||||
-DBUILD_TESTING=ON \
|
|
||||||
-DBUILD_EXAMPLES=OFF \
|
|
||||||
..
|
|
||||||
%make_build
|
|
||||||
popd
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install -C build_py2
|
rm -rf $RPM_BUILD_ROOT
|
||||||
%make_install -C build_py3
|
|
||||||
|
|
||||||
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
||||||
|
|
||||||
%check
|
# remove compiled examples
|
||||||
pushd build_py2
|
cd examples; make clean;cd ..
|
||||||
ctest -V
|
|
||||||
popd
|
|
||||||
pushd build_py3
|
|
||||||
ctest -V
|
|
||||||
popd
|
|
||||||
|
|
||||||
|
# remove x permssion from examples folder files
|
||||||
|
find examples -type f -print | xargs chmod a-x
|
||||||
|
|
||||||
|
# move libs to kml (for keeping third party libs away)
|
||||||
|
mkdir -p $RPM_BUILD_ROOT%{_libdir}/libkml/
|
||||||
|
mv $RPM_BUILD_ROOT%{_libdir}/*.so* $RPM_BUILD_ROOT%{_libdir}/libkml/
|
||||||
|
|
||||||
|
#removing rpaths with chrpath
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmldom_swig_java.so.0.0.0
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmlengine_swig_python.so.0.0.0
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmlengine.so.0.0.0
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmldom_swig_python.so.0.0.0
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libkml/libkmlengine_swig_java.so.0.0.0
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/_kmlengine.so
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/_kmldom.so
|
||||||
|
chrpath --delete $RPM_BUILD_ROOT%{python_sitearch}/_kmlbase.so
|
||||||
|
|
||||||
|
# remove .libs and .deps directories
|
||||||
|
find . -name '.libs' -type d -print | xargs rm -rf
|
||||||
|
find . -name '.deps' -type d -print | xargs rm -rf
|
||||||
|
|
||||||
|
# fix unstripping-binary-or-object warning
|
||||||
|
chmod a+x $RPM_BUILD_ROOT%{python_sitearch}/_kmlengine.so
|
||||||
|
chmod a+x $RPM_BUILD_ROOT%{python_sitearch}/_kmldom.so
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post -p /sbin/ldconfig
|
%post -p /sbin/ldconfig
|
||||||
|
|
||||||
%postun -p /sbin/ldconfig
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%defattr(-,root,root,-)
|
||||||
%doc AUTHORS README.md
|
%doc COPYING
|
||||||
%{_libdir}/libkml*.so.*
|
%doc AUTHORS
|
||||||
|
%doc README
|
||||||
%files -n python2-%{name}
|
%doc ChangeLog
|
||||||
%{python2_sitearch}/*.so
|
%dir %{_libdir}/libkml
|
||||||
%{python2_sitearch}/*.py*
|
%{_libdir}/libkml/*.so.*
|
||||||
|
%{python_sitearch}/*.so
|
||||||
%files -n python3-%{name}
|
%{python_sitearch}/*.py
|
||||||
%{python3_sitearch}/*.so
|
%{python_sitearch}/*.pyc
|
||||||
%{python3_sitearch}/*.py
|
%{python_sitearch}/*.pyo
|
||||||
%{python3_sitearch}/__pycache__/*.pyc
|
|
||||||
|
|
||||||
%files java
|
|
||||||
%{_javadir}/LibKML.jar
|
|
||||||
%{_libdir}/%{name}/
|
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
|
%defattr(-,root,root,-)
|
||||||
%doc examples
|
%doc examples
|
||||||
%{_includedir}/kml/
|
%{_includedir}/*
|
||||||
%{_libdir}/libkml*.so
|
%dir %{_libdir}/libkml
|
||||||
%{_libdir}/pkgconfig/%{name}.pc
|
%{_libdir}/libkml/*.so
|
||||||
%{_libdir}/cmake/%{name}/
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Feb 18 2018 Sandro Mani <manisandro@gmail.com> - 1.3.0-10
|
* Tue Feb 28 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-10
|
||||||
- Add missing BR: gcc-c++, make
|
- Rebuilt for c++ ABI breakage
|
||||||
|
|
||||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-9
|
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-9
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||||
|
|
||||||
* Mon Aug 07 2017 Sandro Mani <manisandro@gmail.com> - 1.3.0-8
|
|
||||||
- Workaround armv7hl FTBFS
|
|
||||||
- Add python3 bindings
|
|
||||||
|
|
||||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-7
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
|
||||||
|
|
||||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-6
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jul 18 2017 Jonathan Wakely <jwakely@redhat.com> - 1.3.0-5
|
|
||||||
- Rebuilt for Boost 1.64
|
|
||||||
|
|
||||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-4
|
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
|
||||||
|
|
||||||
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
|
|
||||||
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
|
||||||
|
|
||||||
* Fri Apr 08 2016 Sandro Mani <manisandro@gmail.com> - 1.3.0-2
|
|
||||||
- Don't call it Google's reference implementation in Summary/Description
|
|
||||||
- Update Source URL
|
|
||||||
- Add python_provide macro
|
|
||||||
- Enable tests
|
|
||||||
|
|
||||||
* Thu Mar 31 2016 Sandro Mani <manisandro@gmail.com> - 1.3.0-1
|
|
||||||
- Update to 1.3.0
|
|
||||||
|
|
||||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-8
|
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-8
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||||
@ -229,7 +146,7 @@ popd
|
|||||||
* Fri Jan 16 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-1
|
* Fri Jan 16 2009 Rakesh Pandit <rakesh@fedoraproject.org> 0.6.1-1
|
||||||
- Updated to 0.6.1
|
- Updated to 0.6.1
|
||||||
|
|
||||||
* Mon Oct 06 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-2
|
* Mon Oct 05 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-2
|
||||||
- Added >= 1.3.35 for swing
|
- Added >= 1.3.35 for swing
|
||||||
|
|
||||||
* Sat Aug 09 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-1
|
* Sat Aug 09 2008 Rakesh Pandit <rakesh@fedoraproject.org> 0.4.0-1
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
diff -rupN libkml-1.3.0/src/swig/CMakeLists.txt libkml-1.3.0-new/src/swig/CMakeLists.txt
|
|
||||||
--- libkml-1.3.0/src/swig/CMakeLists.txt 2015-12-21 18:23:05.000000000 +0100
|
|
||||||
+++ libkml-1.3.0-new/src/swig/CMakeLists.txt 2017-08-07 21:26:23.717928168 +0200
|
|
||||||
@@ -23,12 +23,6 @@ if(WITH_PYTHON)
|
|
||||||
set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}PYTHON_wrap.cxx COMPILE_FLAGS "-Wno-long-long" )
|
|
||||||
swig_add_module(${MODULE_NAME} python ${INTERFACE_FILE})
|
|
||||||
swig_link_libraries(${MODULE_NAME} kmlbase kmlengine kmldom ${PYTHON_LIBRARIES})
|
|
||||||
- add_custom_command(
|
|
||||||
- TARGET _${MODULE_NAME}
|
|
||||||
- POST_BUILD
|
|
||||||
- COMMAND ${CMAKE_COMMAND} -E echo "Byte-compiling ${MODULE_NAME}.py"
|
|
||||||
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/pycompile.py ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}.py
|
|
||||||
- DEPENDS kmlbase kmlengine kmldom)
|
|
||||||
|
|
||||||
install(TARGETS
|
|
||||||
_${MODULE_NAME}
|
|
||||||
@@ -36,7 +30,6 @@ if(WITH_PYTHON)
|
|
||||||
|
|
||||||
install(FILES
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}.py
|
|
||||||
- ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}.pyc
|
|
||||||
DESTINATION ${PYTHON_INSTALL_DIR})
|
|
||||||
|
|
||||||
endforeach()
|
|
Loading…
Reference in New Issue
Block a user