2014-04-17 07:18:22 +02:00
#
# spec file for package apfel
#
2023-11-29 11:32:36 +01:00
# Copyright (c) 2023 SUSE LLC
2014-04-17 07:18:22 +02:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2019-01-14 11:41:55 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2014-04-17 07:18:22 +02:00
#
2023-11-29 11:32:36 +01:00
%define soname libAPFEL0_0_0
# Need -ffat-lto-objects for the static lib
%define _lto_cflags -flto=auto -ffat-lto-objects
2014-04-17 07:18:22 +02:00
Name : apfel
2023-11-29 11:32:36 +01:00
Version : 3.1.0
2014-04-17 07:18:22 +02:00
Release : 0
2016-02-15 14:29:51 +01:00
Summary : A Probability Distribution Function Evolution Library
2018-07-17 15:22:10 +02:00
License : GPL-3.0-or-later
2014-04-17 07:18:22 +02:00
Group : Development/Libraries/C and C++
2019-01-13 17:17:36 +01:00
URL : http://apfel.hepforge.org/
2021-06-12 15:05:02 +02:00
Source : https://github.com/scarrazza/%{name} /archive/%{version} .tar.gz#/%{name}-%{version}.tar.gz
2023-11-29 11:32:36 +01:00
# PATCH-FIX-UPSTREAM apfel-fix-project-version.patch badshah400@gmail.com -- Use the correct version in defining project in CMakeLists.txt
Patch0 : apfel-fix-project-version.patch
# PATCH-FIX-UPSTREAM apfel-dont-set-default-reltype.patch badshah400@gmail.com -- Don't assume 'RELEASE' as the release type, this should be set by user
Patch1 : apfel-dont-set-default-reltype.patch
2022-01-24 19:58:26 +01:00
BuildRequires : %{python_module LHAPDF}
BuildRequires : %{python_module devel}
2023-11-29 11:32:36 +01:00
BuildRequires : %{python_module pip}
BuildRequires : %{python_module wheel}
2015-03-23 17:44:38 +01:00
BuildRequires : LHAPDF-devel
2023-11-29 11:32:36 +01:00
BuildRequires : cmake >= 3.15
2014-04-17 07:18:22 +02:00
BuildRequires : gcc-c++
BuildRequires : gcc-fortran
2017-04-11 15:36:50 +02:00
BuildRequires : libboost_headers-devel
2020-05-06 00:48:16 +02:00
BuildRequires : python-rpm-macros
2023-11-29 11:32:36 +01:00
BuildRequires : swig
2020-05-06 00:48:16 +02:00
Requires : python-LHAPDF
2022-01-24 19:58:26 +01:00
Requires(post) : update-alternatives
Requires(postun) : update-alternatives
2020-05-06 00:48:16 +02:00
%python_subpackages
2014-04-17 07:18:22 +02:00
%description
2019-01-13 17:17:36 +01:00
APFEL is a library to perform the combined QCD+QED DGLAP
2016-02-15 14:29:51 +01:00
evolution of parton distributions.
2014-04-17 07:18:22 +02:00
%package -n %{soname}
2016-02-15 14:29:51 +01:00
Summary : A Probability Distribution Function Evolution Library
Group : System/Libraries
2023-11-29 12:21:42 +01:00
# Problem with older naming scheme
Conflicts : libAPFEL0 <= 3.0.6
2014-04-17 07:18:22 +02:00
%description -n %{soname}
2019-01-13 17:17:36 +01:00
APFEL is a library to perform the combined QCD+QED DGLAP
2016-02-15 14:29:51 +01:00
evolution of parton distributions.
2014-04-17 07:18:22 +02:00
This package provides the shared libraries for %{name} .
2020-05-06 00:48:16 +02:00
%package -n %{name}-devel
2016-02-15 14:29:51 +01:00
Summary : Development files for Apfel, a PDF Evolution Library
2014-04-17 07:18:22 +02:00
Requires : %{soname} = %{version}
2015-03-23 17:44:38 +01:00
Requires : LHAPDF-devel
2019-01-13 17:17:36 +01:00
Recommends: %{name} -doc = %{version}
2014-04-17 07:18:22 +02:00
2020-05-06 00:48:16 +02:00
%description -n %{name}-devel
2019-01-13 17:17:36 +01:00
APFEL is a library to perform the combined QCD+QED DGLAP
2016-02-15 14:29:51 +01:00
evolution of parton distributions.
2014-04-17 07:18:22 +02:00
This package provides the source files required to develop
applications with %{name} .
2023-11-29 11:32:36 +01:00
%package -n %{name}-devel-static
# We need to build and install the static lib as there is no way to
# disable it during configuration stage and it pollutes the cmake files
Summary : Static development files for Apfel, a PDF Evolution library
%description -n %{name}-devel-static
APFEL is a library to perform the combined QCD+QED DGLAP
evolution of parton distributions.
This package provides the static library required to develop
applications with %{name} .
2020-05-06 00:48:16 +02:00
%package -n %{name}-doc
2019-01-14 11:41:55 +01:00
Summary : Documentation for APFEL, a PDF evolution library
2019-01-13 17:17:36 +01:00
2020-05-06 00:48:16 +02:00
%description -n %{name}-doc
2019-01-14 11:41:55 +01:00
This package provides documentation for APFEL in PDF (Portable
Document Format), a PDF (Probability Distribution Function) evolution
2019-01-13 17:17:36 +01:00
library.
2014-04-17 07:18:22 +02:00
%prep
2020-05-06 00:48:16 +02:00
%autosetup -p1
2014-04-17 07:18:22 +02:00
%build
2023-11-29 11:32:36 +01:00
%{python_expand # Necessary to run configure with all $python flavors
2022-01-24 19:58:26 +01:00
export PYTHON=%{_bindir} /$python
2023-11-29 11:32:36 +01:00
mkdir ../$python
cp -pr ./ ../$python
pushd ../$python
%cmake \
-DCMAKE_RELEASE_TYPE=" R e l w i t h D e b I n f o " \
-DPython_EXECUTABLE:PATH=${PYTHON} \
-DAPFEL_DOWNLOAD_PDFS:BOOL=OFF
%cmake_build
2022-01-24 19:58:26 +01:00
popd
}
2014-04-17 07:18:22 +02:00
%install
2023-11-29 11:32:36 +01:00
%{python_expand # all $python flavors as configured above
2022-01-24 19:58:26 +01:00
export PYTHON=%{_bindir} /$python
2023-11-29 11:32:36 +01:00
pushd ../$python
%cmake_install
2022-01-24 19:58:26 +01:00
%python_clone -a %{buildroot} %{_bindir} /apfel
popd
}
2014-04-17 07:18:22 +02:00
# REMOVE libtool ARCHIVES
2019-01-13 17:17:36 +01:00
find %{buildroot} -type f -name " * . l a " -delete -print
# FIX env BASED SCRIPT INTERPRETER
2023-11-29 11:32:36 +01:00
sed -Ei " 1 { s | # \ ! \ s * %{_bindir} / e n v b a s h | # \ ! / b i n / b a s h | } " %{buildroot} %{_bindir} /apfel-config
2014-04-17 07:18:22 +02:00
2020-05-06 00:48:16 +02:00
# REMOVE INSTALLED README, INSTALL IT USING %%doc INSTEAD
rm -fr %{buildroot} %{_datadir} /doc/apfel/README
2016-08-09 07:58:01 +02:00
rm -fr %{buildroot} %{_datadir} /apfel/README
2014-04-17 07:18:22 +02:00
2016-02-15 14:29:51 +01:00
%post -n %{soname} -p /sbin/ldconfig
%postun -n %{soname} -p /sbin/ldconfig
2014-04-17 07:18:22 +02:00
2022-01-24 19:58:26 +01:00
%post
%python_install_alternative apfel
%postun
%python_uninstall_alternative apfel
2014-04-17 07:18:22 +02:00
%files -n %{soname}
%{_libdir} /*.so.*
2020-05-06 00:48:16 +02:00
%files -n %{name}-devel
2019-01-13 17:17:36 +01:00
%license COPYING
%doc AUTHORS ChangeLog NEWS README
2014-04-17 07:18:22 +02:00
%{_bindir} /%{name} -config
2023-11-29 11:32:36 +01:00
%{_includedir} /APFEL/
2014-04-17 07:18:22 +02:00
%{_libdir} /*.so
2023-11-29 11:32:36 +01:00
%files -n %{name}-devel-static
%license COPYING
%{_libdir} /*.a
%{_datadir} /APFEL/
2020-05-06 00:48:16 +02:00
%files %{python_files}
2022-01-24 19:58:26 +01:00
%python_alternative %{_bindir} /apfel
2023-11-29 11:32:36 +01:00
%{python_sitearch} /apfel/
%{python_sitearch} /apfel-%{version} -py%{python_version} .egg-info
2014-04-17 07:18:22 +02:00
2020-05-06 00:48:16 +02:00
%files -n %{name}-doc
2019-01-13 17:17:36 +01:00
%doc doc/pdfs/manual.pdf
2014-04-17 07:18:22 +02:00
%changelog