366eac0
Name:           avogadro2-libs
366eac0
Version:        1.90.0
6c488fb
Release:        12%{?dist}
366eac0
Summary:        Avogadro2 libraries
366eac0
366eac0
# BSD is main license
366eac0
# MIT is the license of jsoncpp.a
366eac0
License:        BSD and MIT
366eac0
URL:            http://avogadro.openmolecules.net/
366eac0
Source0:        https://github.com/OpenChemistry/avogadrolibs/archive/%{version}.tar.gz#/avogadrolibs-%{version}.tar.gz
366eac0
573ecd8
# Fix compatibility with gcc7-gcc8
573ecd8
Patch0:         %{name}-fix_gcc8_compatibility.patch
366eac0
366eac0
# Fix reported path
366eac0
Patch1:         %{name}-fix_AvogadroLibsConfig.patch
366eac0
366eac0
# Set installation path of jsoncpp.a file
366eac0
Patch2:         %{name}-set_jsoncpp_path.patch
366eac0
366eac0
# Set installation path of Python files
366eac0
Patch3:         %{name}-set_pythonpath.patch
366eac0
81d9643
BuildRequires:  boost-devel
81d9643
BuildRequires:  python%{python3_pkgversion}-devel
81d9643
%if 0%{?fedora}
81d9643
BuildRequires:  boost-python3-devel
81d9643
%endif
366eac0
BuildRequires:  cmake, chrpath
366eac0
BuildRequires:  gcc-c++, doxygen
366eac0
BuildRequires:  pkgconfig(eigen3)
366eac0
BuildRequires:  pkgconfig(glew)
366eac0
BuildRequires:  pkgconfig(openbabel-2.0)
366eac0
BuildRequires:  mesa-libGLU-devel
366eac0
BuildRequires:  hdf5-devel
366eac0
BuildRequires:  spglib-devel, molequeue-devel
366eac0
BuildRequires:  qt5-qtbase-devel, qt5-qttools-devel
366eac0
366eac0
Provides: %{name}-static = %{version}-%{release}
366eac0
Provides: jsoncpp-static
81d9643
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
366eac0
366eac0
%description
366eac0
Avogadro libraries provide 3D rendering, visualization, analysis
366eac0
and data processing useful in computational chemistry, molecular modeling,
366eac0
bioinformatics, materials science, and related areas.
366eac0
366eac0
%package  devel
366eac0
Summary:  Development files of %{name}
366eac0
Requires: qt5-qtbase-devel
366eac0
Requires: %{name}%{?_isa} = %{version}-%{release}
366eac0
366eac0
%description devel
366eac0
This package contains libraries and header files for developing
366eac0
applications that use %{name}.
366eac0
366eac0
%package doc
366eac0
Summary: HTML documentation of %{name}
366eac0
BuildArch: noarch
366eac0
%description doc
366eac0
HTML documentation of %{name}.
366eac0
366eac0
%prep
366eac0
%setup -q -n avogadrolibs-%{version}
366eac0
%patch0 -p0
366eac0
%patch1 -p0
366eac0
%patch2 -p0
366eac0
%patch3 -p0
366eac0
366eac0
%build
366eac0
mkdir build && pushd build
366eac0
export LDFLAGS="%{__global_ldflags} -Wl,--as-needed"
366eac0
%cmake -DCMAKE_BUILD_TYPE:STRING=Release \
366eac0
 -DCMAKE_INSTALL_INCLUDEDIR:PATH=%{_includedir}/avogadro2 \
366eac0
 -Wno-dev \
366eac0
 -DENABLE_GLSL:BOOL=ON \
366eac0
 -DENABLE_PYTHON:BOOL=ON  \
81d9643
 -DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \
81d9643
 -DPYTHON_VERSION:STRING=%{python3_version} \
81d9643
%if 0%{?fedora}
81d9643
 -DUSE_BOOST_PYTHON:BOOL=ON \
81d9643
%else
81d9643
 -DUSE_BOOST_PYTHON:BOOL=OFF \
81d9643
%endif
366eac0
 -DENABLE_RPATH:BOOL=OFF \
366eac0
 -DENABLE_TESTING:BOOL=OFF \
366eac0
 -DUSE_MOLEQUEUE:BOOL=ON \
366eac0
 -DUSE_VTK:BOOL=OFF \
366eac0
 -DUSE_HDF5:BOOL=ON \
366eac0
 -DSPGLIB_LIBRARY:FILEPATH=%{_libdir}/libsymspg.so \
366eac0
 -DBUILD_GPL_PLUGINS:BOOL=ON \
366eac0
 -DBUILD_STATIC_PLUGINS:BOOL=ON \
366eac0
 -DBUILD_DOCUMENTATION:BOOL=ON ..
366eac0
366eac0
%make_build
366eac0
366eac0
pushd docs
366eac0
doxygen
366eac0
popd
366eac0
366eac0
%install
366eac0
%make_install -C build
366eac0
366eac0
sed -i -e '1i#!%{__python3}' %{buildroot}%{python3_sitearch}/avogadro2/scripts/inputGenerators/*.py
366eac0
sed -i -e '1i#!%{__python3}' %{buildroot}%{python3_sitearch}/avogadro2/scripts/formatScripts/*.py
366eac0
366eac0
chrpath -d %{buildroot}%{_libdir}/lib*.so
366eac0
rm -rf %{buildroot}%{_datadir}/doc
366eac0
366eac0
%check
366eac0
pushd build
366eac0
#ctest -VV
366eac0
366eac0
%post -p /sbin/ldconfig
366eac0
%postun -p /sbin/ldconfig
366eac0
366eac0
%files
366eac0
%doc README.md
366eac0
%license COPYING
366eac0
%{_libdir}/lib*.so
366eac0
%{_libdir}/avogadro2/
366eac0
%{python3_sitearch}/avogadro2/
366eac0
366eac0
%files devel
366eac0
%{_includedir}/avogadro2/
366eac0
%{_libdir}/cmake/avogadrolibs/
366eac0
366eac0
%files doc
366eac0
%doc README.md build/docs/html
366eac0
%license COPYING
366eac0
366eac0
%changelog
6c488fb
* Wed Jan 31 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-12
6c488fb
- Rebuild for moloqueue-0.9.0
6c488fb
2d01213
* Thu Dec 14 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-11
2d01213
- Rebuild for spglib-1.10.2
2d01213
9bab563
* Sun Aug 06 2017 Björn Esser <besser82@fedoraproject.org> - 1.90.0-10
9bab563
- Rebuilt for AutoReq cmake-filesystem
9bab563
05b8845
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-9
05b8845
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
05b8845
16f8a61
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-8
16f8a61
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
16f8a61
81d9643
* Thu Jun 22 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-7
81d9643
- Modified for epel builds
81d9643
0935769
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.90.0-6
0935769
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
0935769
366eac0
* Mon Mar 13 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-5
366eac0
- Add ld scriptlets
366eac0
366eac0
* Sun Mar 12 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-4
366eac0
- Set python3 installation directory
366eac0
366eac0
* Sun Mar 12 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-3
366eac0
- Move jsoncpp.a into the private lib directory
366eac0
366eac0
* Sat Mar 11 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-2
366eac0
- Use default paths
366eac0
366eac0
* Sat Mar 11 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-1
366eac0
- Initial package