Compare commits

...

2 Commits

Author SHA1 Message Date
Denis Arnaud 0b0edb4326 Rebuild for SOCI 4.0.0 2020-05-08 00:04:06 +02:00
Denis Arnaud 8bbb669a0d Upstream update to 0.07.4 2019-11-24 15:40:44 +01:00
2 changed files with 154 additions and 14 deletions

128
opentrep-python3to2.patch Normal file
View File

@ -0,0 +1,128 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index acf5dcf..91f1fc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,7 @@ packaging_set_other_options (TBZ2 "TBZ2;TGZ")
## Dependencies ##
########################################
#
-get_external_libs (git "python 3.4" "boost 1.48" "icu 4.2" protobuf readline
+get_external_libs (git "python 2.7" "boost 1.48" "icu 4.2" protobuf readline
"xapian 1.0" "soci 3.0" "sqlite 3.0" "mysql 5.1" doxygen)
diff --git a/config/project_config_embeddable.cmake b/config/project_config_embeddable.cmake
index 5d44da0..475f3a3 100644
--- a/config/project_config_embeddable.cmake
+++ b/config/project_config_embeddable.cmake
@@ -485,36 +485,36 @@ macro (get_python)
unset (_required_version)
if (${ARGC} GREATER 0)
set (_required_version ${ARGV0})
- message (STATUS "Requires Python with version ${_required_version}; however just Python3 is considered here")
+ message (STATUS "Requires Python with version ${_required_version}; however just Python2 is considered here")
else (${ARGC} GREATER 0)
- message (STATUS "Requires Python3; any version will do")
+ message (STATUS "Requires Python2; any version will do")
endif (${ARGC} GREATER 0)
# The first check searches for the libraries and include paths.
# However, on some older versions (e.g., on RedHat/CentOS 5.x),
# only the static library is searched.
- find_package (Python3 COMPONENTS Interpreter Development REQUIRED)
+ find_package (Python2 COMPONENTS Interpreter Development REQUIRED)
# The second check is to get the dynamic library for sure.
#find_package (PythonLibsWrapper ${_required_version} REQUIRED)
- if (Python3_FOUND)
- message (STATUS "Found Python3 ${Python3_VERSION} (${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH})")
+ if (Python2_FOUND)
+ message (STATUS "Found Python2 ${Python2_VERSION} (${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}.${Python2_VERSION_PATCH})")
# Set the Python installation directory
set (INSTALL_PY_LIB_DIR
- ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+ ${INSTALL_LIB_DIR}/python${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
CACHE PATH "Installation directory for Python libraries")
# Update the list of include directories for the project
- include_directories (${Python3_INCLUDE_DIRS})
+ include_directories (${Python2_INCLUDE_DIRS})
# Update the list of dependencies for the project
- list (APPEND PROJ_DEP_LIBS_FOR_LIB ${Python3_LIBRARIES})
+ list (APPEND PROJ_DEP_LIBS_FOR_LIB ${Python2_LIBRARIES})
- else (Python3_FOUND)
+ else (Python2_FOUND)
message (FATAL_ERROR "Python libraries are missing. Please install them (e.g., 'python-devel' for the Fedora/RedHat package)")
- endif (Python3_FOUND)
+ endif (Python2_FOUND)
endmacro (get_python)
@@ -612,14 +612,14 @@ macro (get_boost)
# On some platform/Boost version combinations, the Python version
# may be just the major version (2 or 3 as of 2019) or the major
# and minor versions (e.g., 27, 28, 34, 36, 37, 38 as of 2019)
- set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
- set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
+ set (python_cpt_name1 "python${Python2_VERSION_MAJOR}")
+ set (python_cpt_name2 "python${Python2_VERSION_MAJOR}${Python2_VERSION_MINOR}")
set (Boost_USE_STATIC_LIBS OFF)
set (Boost_USE_MULTITHREADED ON)
set (Boost_USE_STATIC_RUNTIME OFF)
set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
date_time random iostreams serialization filesystem system
- locale ${python_cpt_name1} ${python_cpt_name2} regex)
+ locale python ${python_cpt_name1} ${python_cpt_name2} regex)
set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}
@@ -642,9 +642,8 @@ macro (get_boost)
# Boost.Python library
message (STATUS " + Boost_PYTHON_VERSION: ${Boost_PYTHON_VERSION}")
message (STATUS " + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
- message (STATUS " + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
- message (STATUS " + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
- message (STATUS " + Boost_PYTHON38_LIBRARY: ${Boost_PYTHON38_LIBRARY}")
+ message (STATUS " + Boost_PYTHON2_LIBRARY: ${Boost_PYTHON2_LIBRARY}")
+ message (STATUS " + Boost_PYTHON27_LIBRARY: ${Boost_PYTHON27_LIBRARY}")
# Update the list of include directories for the project
include_directories (${Boost_INCLUDE_DIRS})
@@ -1495,7 +1494,7 @@ macro (set_install_directories)
set (exec_prefix ${prefix})
set (bindir ${exec_prefix}/bin)
set (libdir ${exec_prefix}/${LIBDIR})
- set (pylibdir ${libdir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
+ set (pylibdir ${libdir}/python${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}/site-packages/py${PACKAGE})
set (libexecdir ${exec_prefix}/libexec)
set (sbindir ${exec_prefix}/sbin)
set (sysconfdir ${prefix}/etc)
@@ -2581,16 +2580,16 @@ endmacro (display_lcov)
# Python
macro (display_python)
- if (Python3_FOUND)
+ if (Python2_FOUND)
message (STATUS)
message (STATUS "* Python:")
- message (STATUS " - Python3_VERSION ............... : ${Python3_VERSION}")
- message (STATUS " - Python3_VERSION_{MJR,MNR,PTCH} : ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}.${Python3_VERSION_PATCH}")
- message (STATUS " - Python3_INCLUDE_DIRS .......... : ${Python3_INCLUDE_DIRS}")
- message (STATUS " - Python3_LIBRARIES ............. : ${Python3_LIBRARIES}")
- message (STATUS " - Python3_LIBRARY_DIRS .......... : ${Python3_LIBRARY_DIRS}")
- message (STATUS " - Python3_RUNTIME_LIBRARY_DIRS .. : ${Python3_RUNTIME_LIBRARY_DIRS}")
- endif (Python3_FOUND)
+ message (STATUS " - Python2_VERSION ............... : ${Python2_VERSION}")
+ message (STATUS " - Python2_VERSION_{MJR,MNR,PTCH} : ${Python2_VERSION_MAJOR}.${Python2_VERSION_MINOR}.${Python2_VERSION_PATCH}")
+ message (STATUS " - Python2_INCLUDE_DIRS .......... : ${Python2_INCLUDE_DIRS}")
+ message (STATUS " - Python2_LIBRARIES ............. : ${Python2_LIBRARIES}")
+ message (STATUS " - Python2_LIBRARY_DIRS .......... : ${Python2_LIBRARY_DIRS}")
+ message (STATUS " - Python2_RUNTIME_LIBRARY_DIRS .. : ${Python2_RUNTIME_LIBRARY_DIRS}")
+ endif (Python2_FOUND)
endmacro (display_python)
# ICU

View File

@ -2,8 +2,8 @@
%global mydocs __tmp_docdir
# Build -pythonN subpackage
%bcond_with python2
%bcond_without python3
%bcond_without python2
%bcond_with python3
# See also http://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering#Private_Libraries
%if %{with python2} || %{with python3}
@ -15,7 +15,7 @@
#
Name: opentrep
Version: 0.07.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: C++ library providing a clean API for parsing travel-focused requests
@ -24,19 +24,24 @@ Summary: C++ library providing a clean API for parsing travel-focused req
License: LGPLv2+ and BSD
URL: http://github.com/trep/%{name}
Source0: %{url}/archive/%{name}-%{version}.tar.gz
Patch0: opentrep-python3to2.patch
BuildRequires: gcc-c++
BuildRequires: cmake, cmake3
BuildRequires: boost-devel
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: cmake
%else
BuildRequires: cmake3
%endif
BuildRequires: boost169-devel
%if %{with python2}
BuildRequires: python-setuptools
BuildRequires: python-devel
BuildRequires: boost-python-devel
BuildRequires: boost169-python2-devel
%endif
%if %{with python3}
BuildRequires: python34-setuptools
BuildRequires: python34-devel
BuildRequires: boost-python34-devel
BuildRequires: python3-setuptools
BuildRequires: python3-devel
BuildRequires: boost169-python3-devel
%endif
BuildRequires: readline-devel
BuildRequires: soci-mysql-devel
@ -114,7 +119,7 @@ This package contains Python libraries for %{name}
%package -n python2-%{name}-devel
Summary: Shared object symbolic links for OpenTREP Python 2
Requires: %{name}-python2%{?_isa} = %{version}-%{release}
Requires: python2-%{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description -n python2-%{name}-devel
@ -135,7 +140,7 @@ This package contains Python libraries for %{name}
%package -n python3-%{name}-devel
Summary: Shared object symbolic links for OpenTREP Python 3
Requires: %{name}-python3%{?_isa} = %{version}-%{release}
Requires: python3%{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description -n python3-%{name}-devel
@ -163,16 +168,20 @@ and it is therefore not reliable.
%prep
%setup -q -n %{name}-%{name}-%{version}
%patch0 -p1
%build
mkdir tmpbuild
pushd tmpbuild
%if 0%{?fedora} || 0%{?rhel} > 7
%cmake ..
%cmake \
%else
%cmake3 ..
%cmake3 \
%endif
-DBOOST_LIBRARYDIR=%{_libdir}/boost169 \
-DBOOST_INCLUDEDIR=%{_includedir}/boost169 \
-DBoost_ADDITIONAL_VERSIONS="1.69 1.69.0" \
..
%make_build
popd
@ -283,6 +292,9 @@ rm -f %{_bindir}/py%{name}
%endif
%changelog
* Thu May 07 2020 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-2
- Rebuild for SOCI 4.0.0
* Sun Nov 24 2019 Denis Arnaud <denis.arnaud_fedora@m4x.org> - 0.07.4-1
- Upstream update to 0.07.4