06ae2fb
# Tests cannot be run at the moment since the Python build breaks the makefiles
06ae2fb
%bcond_with tests
06ae2fb
f31e51c
%if 0%{?fedora}
f31e51c
%bcond_without python3
f31e51c
%else
f31e51c
%bcond_with python3
75a8480
%endif
f31e51c
f31e51c
%if 0%{?fedora} >= 30
f31e51c
%bcond_with python2
f31e51c
%else
f31e51c
%bcond_without python2
f31e51c
%endif
f31e51c
951473a
%global soversion 9
75a8480
b51749e
Name:           libxc
b51749e
Summary:        Library of exchange and correlation functionals for density-functional theory
74c64c0
Version:        5.1.0
74c64c0
Release:        1%{?dist}
e525aa9
License:        MPLv2.0
eabb4ec
Source0:        http://www.tddft.org/programs/libxc/down.php?file=%{version}/libxc-%{version}.tar.gz
e525aa9
# Don't rebuild libxc for pylibxc
74c64c0
Patch0:         libxc-5.1.0-pylibxc.patch
b51749e
URL:            http://www.tddft.org/programs/octopus/wiki/index.php/Libxc
5039069
57072ef
BuildRequires: make
b51749e
BuildRequires:  gcc-gfortran
b51749e
BuildRequires:  libtool
f31e51c
f31e51c
%if %{with python2}
e525aa9
BuildRequires:  python2-devel
7931a43
BuildRequires:  python2-numpy
f31e51c
%endif
f31e51c
%if %{with python3}
e525aa9
BuildRequires:  python3-devel
7931a43
BuildRequires:  python3-numpy
8538dc3
BuildRequires:  python3-setuptools
f31e51c
%endif
f31e51c
f31e51c
%if ! %{with python2}
f31e51c
Obsoletes:      python2-%{name} < %{version}-%{release}
f31e51c
%endif
f31e51c
%if ! %{with python3}
f31e51c
Obsoletes:      python3-%{name} < %{version}-%{release}
f31e51c
%endif
5039069
f9d5c74
%description
5039069
libxc is a library of exchange and correlation functionals. Its purpose is to
5039069
be used in codes that implement density-functional theory. For the moment, the
5039069
library includes most of the local density approximations (LDAs), generalized
5039069
density approximation (GGAs), and meta-GGAs. The library provides values for
5039069
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
5039069
5039069
%package devel
b51749e
Summary:        Development library and headers for libxc
b51749e
Requires:       %{name}%{?_isa} = %{version}-%{release}
b51749e
Requires:       pkgconfig
5039069
5039069
%description devel
5039069
libxc is a library of exchange and correlation functionals. Its purpose is to
5039069
be used in codes that implement density-functional theory. For the moment, the
5039069
library includes most of the local density approximations (LDAs), generalized
5039069
density approximation (GGAs), and meta-GGAs. The library provides values for
5039069
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
5039069
5039069
This package contains the development headers and library that are necessary
5039069
in order to compile programs against libxc.
5039069
f31e51c
%if %{with python2}
e525aa9
%package -n python2-%{name}
e525aa9
Summary:        Python2 interface to libxc
e525aa9
Requires:       python2-numpy
e525aa9
Requires:       %{name} = %{version}-%{release}
e525aa9
BuildArch:      noarch
e525aa9
%{?python_provide:%python_provide python2-%{name}}
e525aa9
e525aa9
%description -n python2-%{name}
e525aa9
libxc is a library of exchange and correlation functionals. Its purpose is to
e525aa9
be used in codes that implement density-functional theory. For the moment, the
e525aa9
library includes most of the local density approximations (LDAs), generalized
e525aa9
density approximation (GGAs), and meta-GGAs. The library provides values for
e525aa9
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
e525aa9
e525aa9
This package contains the Python2 interface library to libxc.
f31e51c
%endif
e525aa9
f31e51c
%if %{with python3}
e525aa9
%package -n python3-%{name}
e525aa9
Summary:        Python3 interface to libxc
e525aa9
Requires:       python3-numpy
e525aa9
Requires:       %{name} = %{version}-%{release}
e525aa9
BuildArch:      noarch
678a320
%if 0%{?rhel}
678a320
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
678a320
%else
e525aa9
%{?python_provide:%python_provide python3-%{name}}
678a320
%endif
e525aa9
%description -n python3-%{name}
e525aa9
libxc is a library of exchange and correlation functionals. Its purpose is to
e525aa9
be used in codes that implement density-functional theory. For the moment, the
e525aa9
library includes most of the local density approximations (LDAs), generalized
e525aa9
density approximation (GGAs), and meta-GGAs. The library provides values for
e525aa9
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
e525aa9
e525aa9
This package contains the Python3 interface library to libxc.
f31e51c
%endif
e525aa9
5039069
%prep
5039069
%setup -q
e525aa9
%patch0 -p1 -b .pylibxc
e525aa9
# Plug in library soversion
e525aa9
sed -i "s|@SOVERSION@|%{soversion}|g" pylibxc/core.py
6ad8f42
5039069
%build
b7a2c35
# Don't insert C code during preprocessing
b7a2c35
export FCCPP="cpp -ffreestanding"
951473a
%configure --enable-shared --disable-static --enable-vxc --enable-fxc --enable-kxc --enable-lxc
e525aa9
# Remove rpath
e525aa9
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
e525aa9
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
951473a
make %{?_smp_mflags}
5039069
e525aa9
# Check we have the right soversion
e525aa9
if [[ ! -f src/.libs/libxc.so.%{soversion} ]]; then
e525aa9
    echo "soversion has changed!"
e525aa9
    exit
e525aa9
fi
e525aa9
e525aa9
# Build python interface
f31e51c
%if %{with python2}
e525aa9
%{py2_build}
f31e51c
%endif
f31e51c
%if %{with python3}
e525aa9
%{py3_build}
f31e51c
%endif
e525aa9
5039069
%install
f31e51c
%make_install
5039069
# Move modules in the right place
5039069
mkdir -p %{buildroot}%{_fmoddir}
5039069
mv %{buildroot}%{_includedir}/*.mod %{buildroot}%{_fmoddir}
5039069
# Get rid of .la files
5039069
find %{buildroot}%{_libdir} -name *.la -exec rm -rf {} \;
5039069
951473a
# Remove bibtex bibliography placed in an odd location
951473a
rm -f %{buildroot}%{_includedir}/libxc.bib
951473a
e525aa9
# Install python interface
f31e51c
%if %{with python2}
e525aa9
%{py2_install}
f31e51c
%endif
f31e51c
%if %{with python3}
e525aa9
%{py3_install}
f31e51c
%endif
e525aa9
678a320
%if 0%{?rhel} == 6 || 0%{?rhel} == 7
678a320
%post -p /sbin/ldconfig
678a320
%postun -p /sbin/ldconfig
678a320
%else
cee74a8
%ldconfig_scriptlets
678a320
%endif
5039069
06ae2fb
# Run tests
06ae2fb
%if %{with tests}
d12fa9a
%check
d12fa9a
make check
06ae2fb
%endif
d12fa9a
5039069
%files
74c64c0
%doc README.md NEWS AUTHORS ChangeLog.md libxc.bib
d12fa9a
%license COPYING
5066bbf
%{_bindir}/xc-info
b51749e
%{_bindir}/xc-threshold
e525aa9
%{_libdir}/libxc.so.%{soversion}*
e525aa9
%{_libdir}/libxcf90.so.%{soversion}*
74c64c0
%{_libdir}/libxcf03.so.%{soversion}*
5039069
5039069
%files devel
5039069
%{_libdir}/libxc.so
9676ba0
%{_libdir}/libxcf90.so
74c64c0
%{_libdir}/libxcf03.so
5039069
%{_includedir}/xc*.h
5039069
%{_fmoddir}/xc_f90_*.mod
74c64c0
%{_fmoddir}/xc_f03_*.mod
5039069
%{_libdir}/pkgconfig/libxc.pc
1de00aa
%{_libdir}/pkgconfig/libxcf03.pc
1de00aa
%{_libdir}/pkgconfig/libxcf90.pc
5039069
f31e51c
%if %{with python2}
e525aa9
%files -n python2-%{name}
e525aa9
%{python2_sitelib}/pylibxc/
e525aa9
%{python2_sitelib}/pylibxc-%{version}-py*.egg-info
f31e51c
%endif
e525aa9
f31e51c
%if %{with python3}
e525aa9
%files -n python3-%{name}
e525aa9
%{python3_sitelib}/pylibxc/
e525aa9
%{python3_sitelib}/pylibxc-%{version}-py*.egg-info
f31e51c
%endif
e525aa9
5039069
%changelog
74c64c0
* Tue Jan 19 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 5.1.0-1
74c64c0
- Update to version 5.1.0.
74c64c0
bc8c109
* Thu Oct 01 2020 Dominik Mierzejewski <rpm@greysector.net> - 5.0.0-6
bc8c109
- Link with libm directly (rhbz#1883501)
bc8c109
d12fa9a
* Tue Sep 08 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 5.0.0-5
d12fa9a
- Enable tests.
d12fa9a
87fcb30
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-4
87fcb30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
87fcb30
8538dc3
* Thu Jun 25 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 5.0.0-3
8538dc3
- BR: python3-setuptools
8538dc3
76564df
* Tue May 26 2020 Miro HronĨok <mhroncok@redhat.com> - 5.0.0-2
76564df
- Rebuilt for Python 3.9
76564df
d0e3723
* Wed Apr 15 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 5.0.0-1
951473a
- Update to 5.0.0, enabling support up to 4th derivatives.
951473a
- libxcf03 has been replaced by libxcf90; the old non-ISO f90 frontend has
951473a
  been deprecated.
951473a
c739a19
* Mon Apr 06 2020 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.4-1
c739a19
- Update to 4.3.4.
eabb4ec
2cce4a2
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.3-5
2cce4a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
2cce4a2
d37be53
* Thu Oct 03 2019 Miro HronĨok <mhroncok@redhat.com> - 4.3.3-4
d37be53
- Rebuilt for Python 3.8.0rc1 (#1748018)
d37be53
48f6211
* Mon Aug 19 2019 Miro HronĨok <mhroncok@redhat.com> - 4.3.3-3
48f6211
- Rebuilt for Python 3.8
48f6211
f502b00
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.3-2
f502b00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f502b00
6cf8d3a
* Mon Feb 11 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.3-1
6cf8d3a
- Update to 4.3.3.
6cf8d3a
b2c6459
* Fri Feb 08 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.2-1
b2c6459
- Update to 4.3.2.
b2c6459
8bd5896
* Wed Feb 06 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.1-1
8bd5896
- Update to 4.3.1.
8bd5896
678a320
* Wed Jan 30 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.0-1
678a320
- Update to 4.3.0.
678a320
7931a43
* Wed Nov 21 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.2.3-1
f31e51c
- Remove python2 subpackage from rawhide.
f31e51c
- Update to 4.2.3.
f31e51c
5e6e6b4
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.0-3
5e6e6b4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
5e6e6b4
b38d158
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 4.2.0-2
b38d158
- Rebuilt for Python 3.7
b38d158
03d53a7
* Tue Jun 05 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.2.0-1
03d53a7
- Update to 4.2.0.
03d53a7
e525aa9
* Wed May 09 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.1.1-1
e525aa9
- Update to 4.1.1, changing license to MPLv2 and adding Python interface.
e525aa9
cac1a43
* Fri May 04 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.5-1
cac1a43
- Update to 4.0.5.
cac1a43
e525aa9
* Wed Feb 07 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.4-1
cc258fa
- Update to 4.0.4.
cc258fa
0c36153
* Mon Nov 20 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.2-1
0c36153
- Update to 4.0.2.
0c36153
b51749e
* Mon Oct 09 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.1-1
b51749e
- Update to 4.0.1.
b51749e
b51749e
* Wed Sep 27 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.0-1
b51749e
- Update to 4.0.0, removing single precision libraries.
b51749e
355d551
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-5
355d551
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
355d551
3d12aa4
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-4
3d12aa4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3d12aa4
84e3635
* Sun Feb 05 2017 Kalev Lember <klember@redhat.com> - 3.0.0-3
84e3635
- Rebuilt for libgfortran soname bump
84e3635
dcfe1c7
* Thu Jun 30 2016 Rafael Fonseca <rdossant@redhat.com> - 3.0.0-2
dcfe1c7
- Fix compilation on ppc64.
dcfe1c7
9676ba0
* Thu Apr 21 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 3.0.0-1
9676ba0
- Update to 3.0.0.
9676ba0
9d2e164
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-6
9d2e164
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9d2e164
5648f61
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.2-5
5648f61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5648f61
ced3d6d
* Sat May 02 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-4
d49e416
- Drop gfortran requires on -devel.
d49e416
eae00c9
* Fri Apr 24 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-3
eae00c9
- Patch some hybrids.
eae00c9
6ad8f42
* Fri Apr 24 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-2
6ad8f42
- Patch broken makefiles.
6ad8f42
81ad2d3
* Thu Feb 19 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-1
81ad2d3
- Update to 2.1.2.
81ad2d3
a108e8e
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-4
a108e8e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
a108e8e
e1b97ab
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-3
e1b97ab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e1b97ab
62c98f5
* Mon Mar 24 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0-2
62c98f5
- Re-enable builds on ppc and ppc64 on EPEL.
62c98f5
5066bbf
* Fri Mar 21 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0-1
5066bbf
- Enable single precision routines as well.
5066bbf
- Update to 2.1.0.
5066bbf
e6220fa
* Tue Feb 18 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.3-1
e6220fa
- Update to 2.0.3.
e6220fa
c7aba58
* Mon Feb 17 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.2-3
c7aba58
- Fix bug with some mgga correlation functionals.
c7aba58
8d398a8
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-2
8d398a8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8d398a8
39bf924
* Wed Jul 10 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.2-1
39bf924
- Update to 2.0.2.
39bf924
b7a2c35
* Wed Mar 06 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.1-3
b7a2c35
- Fix FTBFS in rawhide.
b7a2c35
498ad00
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-2
498ad00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
498ad00
53460bd
* Mon Jan 21 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.1-1
53460bd
- Update to 2.0.1.
53460bd
646d725
* Fri Dec 7 2012 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.0-1
646d725
- Update to 2.0.0.
646d725
bf1a33e
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-2
bf1a33e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
bf1a33e
103d009
* Fri Jun 15 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.2.0-1
103d009
- Update to 1.2.0.
103d009
61e8cc3
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
61e8cc3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
61e8cc3
4c87941
* Fri May 13 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.1.0-1
4c87941
- Update to 1.1.0.
4c87941
3dbc86d
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
3dbc86d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
3dbc86d
5039069
* Sun Jan 23 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-4
5039069
- Clean buildroot at the beginning of %%install.
5039069
5039069
* Sun Jan 23 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-3
5039069
- Update tarball.
5039069
- Make requirement on gcc-gfortran in -devel architecture explicit.
5039069
5039069
* Sat Jan 22 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-2
5039069
- Minor review fixes.
5039069
5039069
* Tue Jan 18 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-1
5039069
- Initial specfile.