f31e51
%if 0%{?fedora}
f31e51
%bcond_without python3
f31e51
%else
f31e51
%bcond_with python3
75a848
%endif
f31e51
f31e51
%if 0%{?fedora} >= 30
f31e51
%bcond_with python2
f31e51
%else
f31e51
%bcond_without python2
f31e51
%endif
f31e51
e525aa
%global soversion 5
75a848
b51749
Name:           libxc
b51749
Summary:        Library of exchange and correlation functionals for density-functional theory
6cf8d3
Version:        4.3.3
f502b0
Release:        2%{?dist}
e525aa
License:        MPLv2.0
b51749
Source0:        http://www.tddft.org/programs/octopus/down.php?file=libxc/%{version}/libxc-%{version}.tar.gz
e525aa
# Don't rebuild libxc for pylibxc
6cf8d3
Patch0:         libxc-4.3.3-pylibxc.patch
e525aa
b51749
URL:            http://www.tddft.org/programs/octopus/wiki/index.php/Libxc
503906
b51749
BuildRequires:  gcc-gfortran
b51749
BuildRequires:  libtool
f31e51
f31e51
%if %{with python2}
e525aa
BuildRequires:  python2-devel
7931a4
BuildRequires:  python2-numpy
f31e51
%endif
f31e51
%if %{with python3}
e525aa
BuildRequires:  python3-devel
7931a4
BuildRequires:  python3-numpy
f31e51
%endif
f31e51
f31e51
%if ! %{with python2}
f31e51
Obsoletes:      python2-%{name} < %{version}-%{release}
f31e51
%endif
f31e51
%if ! %{with python3}
f31e51
Obsoletes:      python3-%{name} < %{version}-%{release}
f31e51
%endif
503906
f9d5c7
%description
503906
libxc is a library of exchange and correlation functionals. Its purpose is to
503906
be used in codes that implement density-functional theory. For the moment, the
503906
library includes most of the local density approximations (LDAs), generalized
503906
density approximation (GGAs), and meta-GGAs. The library provides values for
503906
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
503906
503906
%package devel
b51749
Summary:        Development library and headers for libxc
b51749
Requires:       %{name}%{?_isa} = %{version}-%{release}
b51749
Requires:       pkgconfig
503906
503906
%description devel
503906
libxc is a library of exchange and correlation functionals. Its purpose is to
503906
be used in codes that implement density-functional theory. For the moment, the
503906
library includes most of the local density approximations (LDAs), generalized
503906
density approximation (GGAs), and meta-GGAs. The library provides values for
503906
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
503906
503906
This package contains the development headers and library that are necessary
503906
in order to compile programs against libxc.
503906
f31e51
%if %{with python2}
e525aa
%package -n python2-%{name}
e525aa
Summary:        Python2 interface to libxc
e525aa
Requires:       python2-numpy
e525aa
Requires:       %{name} = %{version}-%{release}
e525aa
BuildArch:      noarch
e525aa
%{?python_provide:%python_provide python2-%{name}}
e525aa
e525aa
%description -n python2-%{name}
e525aa
libxc is a library of exchange and correlation functionals. Its purpose is to
e525aa
be used in codes that implement density-functional theory. For the moment, the
e525aa
library includes most of the local density approximations (LDAs), generalized
e525aa
density approximation (GGAs), and meta-GGAs. The library provides values for
e525aa
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
e525aa
e525aa
This package contains the Python2 interface library to libxc.
f31e51
%endif
e525aa
f31e51
%if %{with python3}
e525aa
%package -n python3-%{name}
e525aa
Summary:        Python3 interface to libxc
e525aa
Requires:       python3-numpy
e525aa
Requires:       %{name} = %{version}-%{release}
e525aa
BuildArch:      noarch
678a32
%if 0%{?rhel}
678a32
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
678a32
%else
e525aa
%{?python_provide:%python_provide python3-%{name}}
678a32
%endif
e525aa
%description -n python3-%{name}
e525aa
libxc is a library of exchange and correlation functionals. Its purpose is to
e525aa
be used in codes that implement density-functional theory. For the moment, the
e525aa
library includes most of the local density approximations (LDAs), generalized
e525aa
density approximation (GGAs), and meta-GGAs. The library provides values for
e525aa
the energy density and its 1st, 2nd, and (for the LDAs) 3rd derivatives.
e525aa
e525aa
This package contains the Python3 interface library to libxc.
f31e51
%endif
e525aa
503906
%prep
503906
%setup -q
e525aa
%patch0 -p1 -b .pylibxc
e525aa
# Plug in library soversion
e525aa
sed -i "s|@SOVERSION@|%{soversion}|g" pylibxc/core.py
6ad8f4
503906
%build
b7a2c3
# Don't insert C code during preprocessing
b7a2c3
export FCCPP="cpp -ffreestanding"
503906
%configure --enable-shared --disable-static
e525aa
# Remove rpath
e525aa
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
e525aa
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
bf62ca
# SMP make doesn't work
bf62ca
#make %{?_smp_mflags}
bf62ca
make
503906
e525aa
# Check we have the right soversion
e525aa
if [[ ! -f src/.libs/libxc.so.%{soversion} ]]; then
e525aa
    echo "soversion has changed!"
e525aa
    exit
e525aa
fi
e525aa
e525aa
# Build python interface
f31e51
%if %{with python2}
e525aa
%{py2_build}
f31e51
%endif
f31e51
%if %{with python3}
e525aa
%{py3_build}
f31e51
%endif
e525aa
503906
%install
f31e51
%make_install
503906
# Move modules in the right place
503906
mkdir -p %{buildroot}%{_fmoddir}
503906
mv %{buildroot}%{_includedir}/*.mod %{buildroot}%{_fmoddir}
503906
# Get rid of .la files
503906
find %{buildroot}%{_libdir} -name *.la -exec rm -rf {} \;
503906
e525aa
# Install python interface
f31e51
%if %{with python2}
e525aa
%{py2_install}
f31e51
%endif
f31e51
%if %{with python3}
e525aa
%{py3_install}
f31e51
%endif
e525aa
678a32
%if 0%{?rhel} == 6 || 0%{?rhel} == 7
678a32
%post -p /sbin/ldconfig
678a32
%postun -p /sbin/ldconfig
678a32
%else
cee74a
%ldconfig_scriptlets
678a32
%endif
503906
503906
%files
503906
%doc README NEWS COPYING AUTHORS ChangeLog TODO
5066bb
%{_bindir}/xc-info
b51749
%{_bindir}/xc-threshold
e525aa
%{_libdir}/libxc.so.%{soversion}*
e525aa
%{_libdir}/libxcf03.so.%{soversion}*
e525aa
%{_libdir}/libxcf90.so.%{soversion}*
503906
503906
%files devel
503906
%{_libdir}/libxc.so
9676ba
%{_libdir}/libxcf03.so
9676ba
%{_libdir}/libxcf90.so
503906
%{_includedir}/xc*.h
503906
%{_fmoddir}/libxc_funcs_m.mod
9676ba
%{_fmoddir}/xc_f03_*.mod
503906
%{_fmoddir}/xc_f90_*.mod
503906
%{_libdir}/pkgconfig/libxc.pc
1de00a
%{_libdir}/pkgconfig/libxcf03.pc
1de00a
%{_libdir}/pkgconfig/libxcf90.pc
503906
f31e51
%if %{with python2}
e525aa
%files -n python2-%{name}
e525aa
%{python2_sitelib}/pylibxc/
e525aa
%{python2_sitelib}/pylibxc-%{version}-py*.egg-info
f31e51
%endif
e525aa
f31e51
%if %{with python3}
e525aa
%files -n python3-%{name}
e525aa
%{python3_sitelib}/pylibxc/
e525aa
%{python3_sitelib}/pylibxc-%{version}-py*.egg-info
f31e51
%endif
e525aa
503906
%changelog
f502b0
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.3-2
f502b0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f502b0
6cf8d3
* Mon Feb 11 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.3-1
6cf8d3
- Update to 4.3.3.
6cf8d3
b2c645
* Fri Feb 08 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.2-1
b2c645
- Update to 4.3.2.
b2c645
8bd589
* Wed Feb 06 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.1-1
8bd589
- Update to 4.3.1.
8bd589
678a32
* Wed Jan 30 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.3.0-1
678a32
- Update to 4.3.0.
678a32
7931a4
* Wed Nov 21 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.2.3-1
f31e51
- Remove python2 subpackage from rawhide.
f31e51
- Update to 4.2.3.
f31e51
5e6e6b
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.0-3
5e6e6b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
5e6e6b
b38d15
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.2.0-2
b38d15
- Rebuilt for Python 3.7
b38d15
03d53a
* Tue Jun 05 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.2.0-1
03d53a
- Update to 4.2.0.
03d53a
e525aa
* Wed May 09 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.1.1-1
e525aa
- Update to 4.1.1, changing license to MPLv2 and adding Python interface.
e525aa
cac1a4
* Fri May 04 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.5-1
cac1a4
- Update to 4.0.5.
cac1a4
e525aa
* Wed Feb 07 2018 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.4-1
cc258f
- Update to 4.0.4.
cc258f
0c3615
* Mon Nov 20 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.2-1
0c3615
- Update to 4.0.2.
0c3615
b51749
* Mon Oct 09 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.1-1
b51749
- Update to 4.0.1.
b51749
b51749
* Wed Sep 27 2017 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.0.0-1
b51749
- Update to 4.0.0, removing single precision libraries.
b51749
355d55
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-5
355d55
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
355d55
3d12aa
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-4
3d12aa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3d12aa
84e363
* Sun Feb 05 2017 Kalev Lember <klember@redhat.com> - 3.0.0-3
84e363
- Rebuilt for libgfortran soname bump
84e363
dcfe1c
* Thu Jun 30 2016 Rafael Fonseca <rdossant@redhat.com> - 3.0.0-2
dcfe1c
- Fix compilation on ppc64.
dcfe1c
9676ba
* Thu Apr 21 2016 Susi Lehtola <jussilehtola@fedoraproject.org> - 3.0.0-1
9676ba
- Update to 3.0.0.
9676ba
9d2e16
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.2-6
9d2e16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
9d2e16
5648f6
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.2-5
5648f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5648f6
ced3d6
* Sat May 02 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-4
d49e41
- Drop gfortran requires on -devel.
d49e41
eae00c
* Fri Apr 24 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-3
eae00c
- Patch some hybrids.
eae00c
6ad8f4
* Fri Apr 24 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-2
6ad8f4
- Patch broken makefiles.
6ad8f4
81ad2d
* Thu Feb 19 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.2-1
81ad2d
- Update to 2.1.2.
81ad2d
a108e8
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-4
a108e8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
a108e8
e1b97a
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0-3
e1b97a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e1b97a
62c98f
* Mon Mar 24 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0-2
62c98f
- Re-enable builds on ppc and ppc64 on EPEL.
62c98f
5066bb
* Fri Mar 21 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0-1
5066bb
- Enable single precision routines as well.
5066bb
- Update to 2.1.0.
5066bb
e6220f
* Tue Feb 18 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.3-1
e6220f
- Update to 2.0.3.
e6220f
c7aba5
* Mon Feb 17 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.2-3
c7aba5
- Fix bug with some mgga correlation functionals.
c7aba5
8d398a
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-2
8d398a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8d398a
39bf92
* Wed Jul 10 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.2-1
39bf92
- Update to 2.0.2.
39bf92
b7a2c3
* Wed Mar 06 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.1-3
b7a2c3
- Fix FTBFS in rawhide.
b7a2c3
498ad0
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.1-2
498ad0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
498ad0
53460b
* Mon Jan 21 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.1-1
53460b
- Update to 2.0.1.
53460b
646d72
* Fri Dec 7 2012 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.0.0-1
646d72
- Update to 2.0.0.
646d72
bf1a33
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.0-2
bf1a33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
bf1a33
103d00
* Fri Jun 15 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.2.0-1
103d00
- Update to 1.2.0.
103d00
61e8cc
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-2
61e8cc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
61e8cc
4c8794
* Fri May 13 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.1.0-1
4c8794
- Update to 1.1.0.
4c8794
3dbc86
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
3dbc86
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
3dbc86
503906
* Sun Jan 23 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-4
503906
- Clean buildroot at the beginning of %%install.
503906
503906
* Sun Jan 23 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-3
503906
- Update tarball.
503906
- Make requirement on gcc-gfortran in -devel architecture explicit.
503906
503906
* Sat Jan 22 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-2
503906
- Minor review fixes.
503906
503906
* Tue Jan 18 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 1.0-1
503906
- Initial specfile.