f007721
%global commit da6ebb9f0e39c73ca861001e390d13e6ed3e6cb5
f007721
%global shortcommit %(c=%{commit}; echo ${c:0:7})
f007721
%global commitdate 20180612
f007721
366eac0
Name:           avogadro2-libs
96758ed
Version:        1.91.0
9aabf9d
Release:        0.3.%{commitdate}git%{shortcommit}%{?dist}
366eac0
Summary:        Avogadro2 libraries
366eac0
366eac0
# BSD is main license
366eac0
# MIT is the license of jsoncpp.a
f007721
License: BSD and MIT
f007721
URL:     http://avogadro.openmolecules.net/
f007721
Source0: https://github.com/OpenChemistry/avogadrolibs/archive/%{commit}.zip#/avogadrolibs-%{commit}.zip
366eac0
366eac0
# Fix reported path
f007721
Patch1: %{name}-fix_AvogadroLibsConfig.patch
366eac0
366eac0
# Set installation path of jsoncpp.a file
f007721
Patch2: %{name}-set_jsoncpp_path.patch
366eac0
366eac0
# Set installation path of Python files
f007721
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
f007721
BuildRequires:  libarchive-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}
8bb496e
Requires: qt5-qtbase-devel%{?_isa}
8bb496e
Requires: glew-devel%{?_isa}
8bb496e
Requires: libGL-devel%{?_isa}
8bb496e
Requires: mesa-libGLU-devel%{?_isa}
8bb496e
Requires: spglib-devel%{?_isa}
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
f007721
%autosetup -n avogadrolibs-%{commit} -p0
366eac0
366eac0
%build
366eac0
mkdir build && pushd build
366eac0
export LDFLAGS="%{__global_ldflags} -Wl,--as-needed"
366eac0
%cmake -DCMAKE_BUILD_TYPE:STRING=Release \
0c7c2f9
 -DINSTALL_INCLUDE_DIR:PATH=include/avogadro2 -DINSTALL_LIBRARY_DIR:PATH=%{_lib} \
8bb496e
 -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 \
f007721
 -DBUILD_DOCUMENTATION:BOOL=ON \
f007721
 -DUSE_LIBMSYM:BOOL=OFF ..
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
0c9b9df
0c9b9df
# Move scale.py* files into %%{python3_sitearch}/avogadro2
0c9b9df
cp -a %{buildroot}%{_libdir}/avogadro2/scripts/workflows %{buildroot}%{python3_sitearch}/avogadro2/scripts/
0c9b9df
sed -i -e '1i#!%{__python3}' %{buildroot}%{python3_sitearch}/avogadro2/scripts/workflows/scale.py
0c9b9df
0c9b9df
rm -rf %{buildroot}%{_libdir}/avogadro2/scripts/workflows
0c9b9df
ln -sf %{python3_sitearch}/avogadro2/scripts/workflows %{buildroot}%{_libdir}/avogadro2/scripts/workflows
366eac0
366eac0
chrpath -d %{buildroot}%{_libdir}/lib*.so
366eac0
rm -rf %{buildroot}%{_datadir}/doc
366eac0
366eac0
%check
366eac0
pushd build
366eac0
#ctest -VV
366eac0
287a852
%ldconfig_scriptlets
366eac0
366eac0
%files
366eac0
%doc README.md
f007721
%license LICENSE
ddbe349
%{_libdir}/lib*.so.*
366eac0
%{_libdir}/avogadro2/
366eac0
%{python3_sitearch}/avogadro2/
366eac0
366eac0
%files devel
366eac0
%{_includedir}/avogadro2/
ddbe349
%{_libdir}/lib*.so
366eac0
%{_libdir}/cmake/avogadrolibs/
366eac0
366eac0
%files doc
366eac0
%doc README.md build/docs/html
f007721
%license LICENSE
366eac0
366eac0
%changelog
9aabf9d
* Thu Aug 23 2018 Nicolas Chauvet <kwizart@gmail.com> - 1.91.0-0.3.20180612gitda6ebb9
9aabf9d
- Rebuilt for glew-2.1.0
9aabf9d
41e0f40
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.91.0-0.2.20180612gitda6ebb9
41e0f40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
41e0f40
96758ed
* Fri Jun 22 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.91.0-0.1.20180612gitda6ebb9
96758ed
- Update to commit #da6ebb9 (1.91.0 pre-release)
f007721
965ee1f
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.90.0-16
965ee1f
- Rebuilt for Python 3.7
965ee1f
8bb496e
* Tue Feb 13 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-15
8bb496e
- Add explicit dependencies to -devel sub-package (bz#1544510)
8bb496e
0c7c2f9
* Tue Feb 13 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-14
0c7c2f9
- Fix AvogadroLibsConfig.cmake relative paths (bz#1544510)
0c7c2f9
ef5b121
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-13
ef5b121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ef5b121
6c488fb
* Wed Jan 31 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-12
6c488fb
- Rebuild for moloqueue-0.9.0
287a852
- Use %%ldconfig_scriptlets
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