File lhapdf5.spec of Package lhapdf5
#
# spec file for package lhapdf5
#
# Copyright (c) 2021 SUSE LLC
#
# 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define rtname lhapdf
%define soname libLHAPDF0
%bcond_with octave
# python3 not supported
%bcond_with pyext
Name: lhapdf5
Version: 5.9.1
Release: 0
Summary: The old (pre 6.0) version of the Les Houches Accord PDF Interface
License: GPL-2.0-or-later
URL: https://lhapdf.hepforge.org/
Source: http://www.hepforge.org/archive/lhapdf/%{rtname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM lhapdf5-no-return-in-non-void.patch badshah400@gmail.com -- Fix a no-return-in-non-void-function warning
Patch0: lhapdf5-no-return-in-non-void.patch
BuildRequires: hdf5-devel
%if 0%{?suse_version} >= 1550
BuildRequires: gcc7-c++
BuildRequires: gcc7-fortran
%else
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
%endif
%if %{with octave}
BuildRequires: octave-devel < 6.0
%endif
%if %{with pyext}
BuildRequires: python-devel < 3.0
%endif
%description
This is the old pre-6.0.0 fortran-based version of LHAPDF. It is
here for compatibility purposes.
LHAPDF provides a unified and easy to use interface to modern PDF
sets. It is designed to work not only with individual PDF sets but
also with the more recent multiple "error" sets. It can be viewed as
the successor to PDFLIB, incorporating many of the older sets found
in the latter, including pion and photon PDFs. In LHAPDF the computer
code and input parameters/grids are separated thus allowing more easy
updating and no limit to the expansion possibilities
%package -n %{soname}
Summary: The old (pre 6.0) version of the Les Houches Accord PDF Interface
%description -n %{soname}
This is the old pre-6.0.0 fortran-based version of LHAPDF. It is
here for compatibility purposes.
LHAPDF provides a unified and easy to use interface to modern PDF
sets. It is designed to work not only with individual PDF sets but
also with the more recent multiple "error" sets. It can be viewed as
the successor to PDFLIB, incorporating many of the older sets found
in the latter, including pion and photon PDFs. In LHAPDF the computer
code and input parameters/grids are separated thus allowing more easy
updating and no limit to the expansion possibilities.
This package provides the shared library for LHAPDF.
%package devel
Summary: The old (pre 6.0) version of the Les Houches Accord PDF Interface
Requires: %{soname} = %{version}
Conflicts: LHAPDF-devel >= 6.0.0
Provides: %{rtname}-devel = %{version}
%description devel
This is the old pre-6.0.0 fortran-based version of LHAPDF. It is
here for compatibility purposes.
LHAPDF provides a unified and easy to use interface to modern PDF
sets. It is designed to work not only with individual PDF sets but
also with the more recent multiple "error" sets. It can be viewed as
the successor to PDFLIB, incorporating many of the older sets found
in the latter, including pion and photon PDFs. In LHAPDF the computer
code and input parameters/grids are separated thus allowing more easy
updating and no limit to the expansion possibilities.
This package provides the source files needed to programming with
the LHAPDF library.
%package -n python-%{name}
Summary: The old (pre 6.0) version of the Les Houches Accord PDF Interface
Requires: %{name}-devel = %{version}
Conflicts: python-LHAPDF >= 6.0.0
Provides: python-%{rtname} = %{version}
%description -n python-%{name}
This is the old pre-6.0.0 fortran-based version of LHAPDF. It is
here for compatibility purposes.
LHAPDF provides a unified and easy to use interface to modern PDF
sets. It is designed to work not only with individual PDF sets but
also with the more recent multiple "error" sets. It can be viewed as
the successor to PDFLIB, incorporating many of the older sets found
in the latter, including pion and photon PDFs. In LHAPDF the computer
code and input parameters/grids are separated thus allowing more easy
updating and no limit to the expansion possibilities.
This package provides the source files needed to programming with
the LHAPDF library in python.
%package octave
Summary: The old (pre 6.0) version of the Les Houches Accord PDF Interface
Requires: %{name}-devel = %{version}
Provides: %{rtname}-octave = %{version}
%description octave
This is the old pre-6.0.0 fortran-based version of LHAPDF. It is
here for compatibility purposes.
LHAPDF provides a unified and easy to use interface to modern PDF
sets. It is designed to work not only with individual PDF sets but
also with the more recent multiple "error" sets. It can be viewed as
the successor to PDFLIB, incorporating many of the older sets found
in the latter, including pion and photon PDFs. In LHAPDF the computer
code and input parameters/grids are separated thus allowing more easy
updating and no limit to the expansion possibilities.
This package provides the octave bindings for programming with
the LHAPDF library.
%prep
%setup -q -n %{rtname}-%{version}
%patch0 -p1
%build
%if 0%{?suse_version} >= 1550
export CC='gcc-7'
export CXX='g++-7'
export FC='gfortran-7'
%endif
%configure --disable-static \
%{?with_pyext:--enable-pyext} \
%{!?with_pyext:--disable-pyext} \
%{?with_octave:--enable-octave} \
%{!?with_octave:--disable-octave}
export FFLAGS+=' -std=legacy'
%make_build
%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
%post -n %{soname} -p /sbin/ldconfig
%postun -n %{soname} -p /sbin/ldconfig
%files -n %{soname}
%{_libdir}/*.so.*
%files devel
%license COPYING
%doc AUTHORS ChangeLog
%{_bindir}/*
%{_libdir}/*.so
%{_datadir}/%{rtname}/
%if %{with octave}
# Octave files go in the lhapdf5-octave package
%exclude %{_datadir}/%{rtname}/*.oct
%endif
%{_includedir}/LHAPDF/
%if %{with pyext}
%files -n python-%{name}
%{python_sitearch}/%{rtname}.py
%exclude %{python_sitearch}/%{rtname}.pyc
%{python_sitearch}/%{rtname}-%{version}-py%{py_ver}.egg-info
%{python_sitearch}/_%{rtname}.so
%endif
%if %{with octave}
%files octave
%{_datadir}/%{rtname}/*.oct
%endif
%changelog