From 0c997ca7e39ad1b7bf57157b238afa311fd89768caebb9fd486f91ec9c33ff71 Mon Sep 17 00:00:00 2001 From: Atri Bhattacharya Date: Mon, 24 Jan 2022 18:58:26 +0000 Subject: [PATCH] Accepting request 947586 from home:badshah400:branches:science - Update to version 3.0.6. - Drop apfel-allow-disabling-pywrap.patch: With py3 supported, this is no longer required. - Enable python bindings: apfel now python3 compliant. - Enable multiple python flavours; Requires(post) and Requires(postun) for update-alternatives. OBS-URL: https://build.opensuse.org/request/show/947586 OBS-URL: https://build.opensuse.org/package/show/science/apfel?expand=0&rev=35 --- apfel-3.0.5.tar.gz | 3 -- apfel-3.0.6.tar.gz | 3 ++ apfel-allow-disabling-pywrap.patch | 42 --------------------- apfel.changes | 11 ++++++ apfel.spec | 59 +++++++++++++++++------------- 5 files changed, 47 insertions(+), 71 deletions(-) delete mode 100644 apfel-3.0.5.tar.gz create mode 100644 apfel-3.0.6.tar.gz delete mode 100644 apfel-allow-disabling-pywrap.patch diff --git a/apfel-3.0.5.tar.gz b/apfel-3.0.5.tar.gz deleted file mode 100644 index 95f7c56..0000000 --- a/apfel-3.0.5.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72fce224bf9a47b7a5da778d691fe7cb8715bd40662bdcf0f91197d4cf49d2f8 -size 8381558 diff --git a/apfel-3.0.6.tar.gz b/apfel-3.0.6.tar.gz new file mode 100644 index 0000000..0490ac7 --- /dev/null +++ b/apfel-3.0.6.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7063c9eee457e030b97926ac166cdaedd84625b31397e1dfd01ae47371fb9f61 +size 8388625 diff --git a/apfel-allow-disabling-pywrap.patch b/apfel-allow-disabling-pywrap.patch deleted file mode 100644 index a2fe30d..0000000 --- a/apfel-allow-disabling-pywrap.patch +++ /dev/null @@ -1,42 +0,0 @@ -Index: apfel-3.0.4/configure.ac -=================================================================== ---- apfel-3.0.4.orig/configure.ac -+++ apfel-3.0.4/configure.ac -@@ -87,7 +87,6 @@ AC_ARG_ENABLE(pywrap, [AC_HELP_STRING(-- - [don't build Python module (default=build)])], - [], [enable_pywrap=yes]) - --enable_pywrap=yes - AZ_PYTHON_DEFAULT - ## Basic Python checks - if test x$enable_pywrap == xyes; then -Index: apfel-3.0.4/Makefile.am -=================================================================== ---- apfel-3.0.4.orig/Makefile.am -+++ apfel-3.0.4/Makefile.am -@@ -1,6 +1,9 @@ - ACLOCAL_AMFLAGS = -I m4 - --SUBDIRS = include ccwrap src lib examples pywrap doc bin -+SUBDIRS = include ccwrap src lib examples doc bin -+if ENABLE_PYWRAP -+ SUBDIRS+=pywrap -+endif - dist_doc_DATA = README - dist_pkgdata_DATA = src/HELL/data/* - -Index: apfel-3.0.4/bin/Makefile.am -=================================================================== ---- apfel-3.0.4.orig/bin/Makefile.am -+++ apfel-3.0.4/bin/Makefile.am -@@ -1,2 +1,7 @@ --EXTRA_DIST = apfel-config.in apfel.in --bin_SCRIPTS = apfel-config apfel ../examples/.libs/ListFunctions ../examples/.libs/CheckAPFEL -\ No newline at end of file -+EXTRA_DIST = apfel-config.in -+bin_SCRIPTS = apfel-config ../examples/.libs/ListFunctions ../examples/.libs/CheckAPFEL -+ -+if ENABLE_PYWRAP -+EXTRA_DIST+=apfel.in -+bin_SCRIPTS+=apfel -+endif diff --git a/apfel.changes b/apfel.changes index d9655a8..20b6b2e 100644 --- a/apfel.changes +++ b/apfel.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Jan 20 00:19:05 UTC 2022 - Atri Bhattacharya + +- Update to version 3.0.6: + * Merging vbertone fork. +- Drop apfel-allow-disabling-pywrap.patch: With py3 supported, + this is no longer required. +- Enable python bindings: apfel now python3 compliant. +- Enable multiple python flavours; Requires(post) and + Requires(postun) for update-alternatives. + ------------------------------------------------------------------- Tue Jun 8 22:56:27 UTC 2021 - Atri Bhattacharya diff --git a/apfel.spec b/apfel.spec index 0dd9c78..8f3d568 100644 --- a/apfel.spec +++ b/apfel.spec @@ -1,7 +1,7 @@ # # spec file for package apfel # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,37 +16,25 @@ # -# PYTHON BINDINGS INCOMPATIBLE WITH PYTHON3 -%if 0%{?suse_version} >= 1550 -%bcond_with pywrap -%else -%bcond_without pywrap -%endif - -%define skip_python3 1 - %define soname libAPFEL0 Name: apfel -Version: 3.0.5 +Version: 3.0.6 Release: 0 Summary: A Probability Distribution Function Evolution Library License: GPL-3.0-or-later Group: Development/Libraries/C and C++ URL: http://apfel.hepforge.org/ Source: https://github.com/scarrazza/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM apfel-allow-disabling-pywrap.patch badshah400@gmail.com -- Allow building with python extension disabled, for example due to lack of python2 support in the system -Patch0: apfel-allow-disabling-pywrap.patch +BuildRequires: %{python_module LHAPDF} +BuildRequires: %{python_module devel} BuildRequires: LHAPDF-devel BuildRequires: gcc-c++ BuildRequires: gcc-fortran BuildRequires: libboost_headers-devel -BuildRequires: libtool BuildRequires: python-rpm-macros -%if %{with pywrap} -BuildRequires: %{python_module LHAPDF} -BuildRequires: %{python_module devel} -%endif Requires: python-LHAPDF +Requires(post): update-alternatives +Requires(postun):update-alternatives %python_subpackages @@ -91,14 +79,25 @@ library. %autosetup -p1 %build -autoreconf -fvi +%{python_expand # Necessary to run configure with all python flavors +export PYTHON=%{_bindir}/$python +mkdir ../{$python}_build +cp -pr ./ ../{$python}_build +pushd ../{$python}_build %configure \ - --disable-static \ - %{!?with_pywrap:--disable-pywrap} -make %{?_smp_mflags} + --disable-static +%make_build +popd +} %install +%{python_expand # all python flavors as configured above +export PYTHON=%{_bindir}/$python +pushd ../{$python}_build %make_install +%python_clone -a %{buildroot}%{_bindir}/apfel +popd +} # REMOVE libtool ARCHIVES find %{buildroot} -type f -name "*.la" -delete -print @@ -113,6 +112,12 @@ rm -fr %{buildroot}%{_datadir}/apfel/README %post -n %{soname} -p /sbin/ldconfig %postun -n %{soname} -p /sbin/ldconfig +%post +%python_install_alternative apfel + +%postun +%python_uninstall_alternative apfel + %files -n %{soname} %{_libdir}/*.so.* @@ -125,11 +130,13 @@ rm -fr %{buildroot}%{_datadir}/apfel/README %{_bindir}/ListFunctions %{_libdir}/*.so -%if %{with pywrap} %files %{python_files} -%{_bindir}/apfel -%{python_sitearch}/* -%endif +%python_alternative %{_bindir}/apfel +%{python_sitearch}/apfel.py +%{python_sitearch}/*.so +%pycache_only %{python_sitearch}/__pycache__/*.pyc +%python2_only %{python_sitearch}/*.pyc +%{python_sitearch}/APFEL-%{version}-py%{python_version}.egg-info %files -n %{name}-doc %doc doc/pdfs/manual.pdf