-tools: make buildable on epel7/python34

This commit is contained in:
Rex Dieter 2018-02-12 13:43:59 -06:00
parent b41628de97
commit 4430941fd3
2 changed files with 53 additions and 10 deletions

View File

@ -0,0 +1,26 @@
From 034ff1bfd7c97acd793132c8a50c099af656fb15 Mon Sep 17 00:00:00 2001
From: Matthias Andree <matthias.andree@gmx.de>
Date: Sat, 29 Oct 2016 13:38:27 +0200
Subject: [PATCH 0866/1096] Pull isnan() into std:: namespace, #include
<cmath>, not <math.h>.
---
tests/test_modifier.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_modifier.cpp b/tests/test_modifier.cpp
index 9c6def6..f087917 100644
--- a/tests/test_modifier.cpp
+++ b/tests/test_modifier.cpp
@@ -3,7 +3,7 @@
#ifdef _MSC_VER
#define _USE_MATH_DEFINES
#endif
-#include <math.h>
+#include <cmath>
#include "lensfun.h"
typedef struct {
--
1.8.3.1

View File

@ -1,12 +1,15 @@
%if !0%{?bootstrap} && (0%{?fedora} > 23 || 0%{?rhel} > 7)
%if !0%{?bootstrap} && (0%{?fedora} || 0%{?rhel} > 6)
%global tests 1
%global python3 1
%global python3 python3
%if 0%{?rhel} == 7
%global python3 python34
%endif
%endif
Name: lensfun
Version: 0.3.2
Summary: Library to rectify defects introduced by photographic lenses
Release: 12%{?dist}
Release: 13%{?dist}
License: LGPLv3 and CC-BY-SA
URL: http://lensfun.sourceforge.net/
@ -20,6 +23,9 @@ Patch59: 0059-Patch-47-respect-DESTDIR-when-installing-python-stuf.patch
Patch60: 0060-Various-CMake-patches-from-the-mailing-list.patch
Patch113: 0113-Added-std-namespace-to-isnan.patch
## upstream patches (master branch)
Patch866: 0866-Pull-isnan-into-std-namespace-include-cmath-not-math.patch
## upstreamable patches
# install manpages only when INSTALL_HELPER_SCRIPTS=ON
Patch200: lensfun-0.3.2-INSTALL_HELPER_SCRIPTS.patch
@ -29,13 +35,19 @@ BuildRequires: doxygen
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(zlib)
%if 0%{?python3}
BuildRequires: python3 python3-devel
%if 0%{?python3:1}
BuildRequires: %{python3} %{python3}-devel
%else
Obsoletes: lensfun-python3 < %{version}-%{release}
#Obsoletes: lensfun-python34 < %{version}-%{release}
Obsoletes: lensfun-tools < %{version}-%{release}
%endif
# for rst2man, if INSTALL_HELPER_SCRIPTS != OFF
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: python2-docutils
%else
BuildRequires: python-docutils
%endif
%description
The lensfun library provides an open source database of photographic lenses and
@ -56,15 +68,15 @@ using lensfun.
%package tools
Summary: Tools for managing %{name} data
License: LGPLv3
Requires: python3-lensfun = %{version}-%{release}
Requires: %{python3}-lensfun = %{version}-%{release}
%description tools
This package contains tools to fetch lens database updates and manage lens
adapters in lensfun.
%package -n python3-lensfun
%package -n %{python3}-lensfun
Summary: Python3 lensfun bindings
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python3-lensfun
%description -n %{python3}-lensfun
%{summary}.
@ -78,9 +90,11 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%patch60 -p1 -b .0060
%patch113 -p1 -b .0113
%patch866 -p1 -b .0866
%patch200 -p1 -b .INSTALL_HELPER_SCRIPTS
%if 0%{?python3}
%if 0%{?python3:1}
sed -i.shbang \
-e "s|^#!/usr/bin/env python3$|#!%{__python3}|g" \
apps/lensfun-add-adapter \
@ -144,7 +158,7 @@ popd
%{_libdir}/liblensfun.so
%{_libdir}/pkgconfig/lensfun.pc
%if 0%{?python3}
%if 0%{?python3:1}
%files tools
%{_bindir}/lensfun-add-adapter
%{_bindir}/lensfun-update-data
@ -158,6 +172,9 @@ popd
%changelog
* Mon Feb 12 2018 Rex Dieter <rdieter@fedoraproject.org> 0.3.2-13
- -tools: make buildable on epel7/python34
* Wed Feb 07 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.3.2-12
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)