366eac0
Name:           avogadro2-libs
366eac0
Version:        1.90.0
366eac0
Release:        5%{?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
366eac0
# Fix compatibility with gcc7
366eac0
Patch0:         %{name}-fix_gcc7_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
366eac0
BuildRequires:  boost-devel, boost-python3-devel
366eac0
BuildRequires:  cmake, chrpath
366eac0
BuildRequires:  gcc-c++, doxygen
366eac0
BuildRequires:  python3-devel
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
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  \
366eac0
 -DENABLE_RPATH:BOOL=OFF \
366eac0
 -DENABLE_TESTING:BOOL=OFF \
366eac0
 -DUSE_BOOST_PYTHON:BOOL=ON \
366eac0
 -DUSE_MOLEQUEUE:BOOL=ON \
366eac0
 -DUSE_VTK:BOOL=OFF \
366eac0
 -DUSE_HDF5:BOOL=ON \
366eac0
 -DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \
366eac0
 -DPYTHON_VERSION:STRING=%{python3_version} \
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
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