eb569a8
## This release does not compile because of current unsupported GCC version (4.8.5) on rhel7
eb569a8
## during compilation of bundled 'jsoncpp'.
eb569a8
## Error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
f007721
12e61e0
# Use devtoolset 8
12e61e0
%if 0%{?rhel} && 0%{?rhel} == 7
12e61e0
%global dts devtoolset-8-
12e61e0
%endif
12e61e0
fae7684
# Qt6 builds for testing
fae7684
%bcond_with qt6
fae7684
366eac0
Name:           avogadro2-libs
b752697
Version:        1.95.1
f28d746
Release:        5%{?dist}
366eac0
Summary:        Avogadro2 libraries
366eac0
366eac0
# BSD is main license
12e61e0
# BSD is the license of avogenerators scripts
f007721
License: BSD and MIT
f007721
URL:     http://avogadro.openmolecules.net/
eb569a8
Source0: https://github.com/OpenChemistry/avogadrolibs/archive/%{version}/avogadrolibs-%{version}.tar.gz
eb569a8
eb569a8
# External source code for avogadrolibs >= 1.91.0
eb569a8
# See https://github.com/OpenChemistry/avogadrolibs/issues/362
b752697
%global commit 023c5555022906334cb5045d9acfc62bd99505b9
12e61e0
Source1: https://github.com/OpenChemistry/avogenerators/archive/%{commit}/avogenerators-%{commit}.tar.gz
366eac0
b915768
# External sources for data files
b915768
Source2: https://github.com/OpenChemistry/molecules/archive/refs/heads/master.zip#/avogadro2-libs-molecules-master.zip
b915768
Source3: https://github.com/OpenChemistry/crystals/archive/1.0.1/crystals-1.0.1.tar.gz#/avogadro2-libs-crystals-1.0.1.tar.gz
b915768
366eac0
# Set installation path of Python files
c243b87
Patch0: %{name}-set_pythonpath.patch
b752697
Patch1: %{name}-1.94.0-do_not_download_external_files.patch
366eac0
81d9643
BuildRequires:  boost-devel
81d9643
BuildRequires:  python%{python3_pkgversion}-devel
81d9643
%if 0%{?fedora}
81d9643
BuildRequires:  boost-python3-devel
81d9643
%endif
eb569a8
%if 0%{?rhel}
12e61e0
BuildRequires:  epel-rpm-macros
eb569a8
%endif
12e61e0
BuildRequires:  cmake3
eb569a8
BuildRequires:  chrpath
c243b87
BuildRequires:  %{?dts}gcc
c243b87
BuildRequires:  %{?dts}gcc-c++
c243b87
BuildRequires:  make
366eac0
BuildRequires:  pkgconfig(eigen3)
366eac0
BuildRequires:  pkgconfig(glew)
fae7684
BuildRequires:  pkgconfig(openbabel-3)
366eac0
BuildRequires:  mesa-libGLU-devel
366eac0
BuildRequires:  hdf5-devel
12e61e0
BuildRequires:  mmtf-cpp-devel, jsoncpp-devel
b915768
BuildRequires:  spglib-devel
fae7684
%if %{with qt6}
fae7684
BuildRequires:  qt6-qtbase-devel
fae7684
BuildRequires:  qt6-qttools-devel
fae7684
BuildRequires:  qt6-qtsvg-devel
fae7684
%else
fae7684
BuildRequires:  qt5-qtbase-devel
fae7684
BuildRequires:  qt5-qttools-devel
fae7684
BuildRequires:  qt5-qtsvg-devel
fae7684
%endif
f28d746
%if 0%{?fedora}
37f2134
BuildRequires:  libarchive-devel >= 3.4.0
f28d746
%endif
37f2134
Provides: %{name}-static = 0:%{version}-%{release}
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}
fae7684
%if %{with qt6}
fae7684
Requires: qt6-qtbase-devel%{?_isa}
fae7684
%else
8bb496e
Requires: qt5-qtbase-devel%{?_isa}
fae7684
%endif
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
eb569a8
Provides: libgwavi-static
eb569a8
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
eb569a8
BuildRequires: doxygen, graphviz
7ddd2e0
BuildRequires: make
366eac0
%description doc
366eac0
HTML documentation of %{name}.
366eac0
366eac0
%prep
eb569a8
%autosetup -a 1 -N -n avogadrolibs-%{version}
b752697
b915768
unzip -qq %{SOURCE2} && mv molecules-master molecules
b915768
tar -xf %{SOURCE3} && mv crystals-1.0.1 crystals
b915768
# Rename LICENSE file
b915768
mv molecules/LICENSE molecules/LICENSE-molecules
b752697
b915768
%patch0 -p0 -b .backup
b915768
%patch1 -p0 -b .backup
eb569a8
eb569a8
# Make avogadro generators source code available for CMake
eb569a8
mv avogenerators-%{commit} avogadrogenerators
eb569a8
mv avogadrogenerators/README.md avogadrogenerators/README-avogenerators.md
eb569a8
sed -e 's|../avogadrogenerators|avogadrogenerators|g' -i avogadro/qtplugins/quantuminput/CMakeLists.txt
eb569a8
#
eb569a8
eb569a8
mv thirdparty/libgwavi/README.md thirdparty/libgwavi/README-libgwavi.md
366eac0
366eac0
%build
12e61e0
%if 0%{?el7}
12e61e0
%{?dts:source /opt/rh/devtoolset-8/enable}
12e61e0
%endif
20b0b31
mkdir -p build
3770bc6
export CXXFLAGS="%{optflags} -DH5_USE_110_API"
b752697
# RHBZ #1996330
b752697
%ifarch %{power64}
b752697
export CXXFLAGS="%{optflags} -DEIGEN_ALTIVEC_DISABLE_MMA"
b752697
%endif
20b0b31
%cmake3 -B build -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 \
f28d746
 -DUSE_LIBARCHIVE:BOOL=ON \
81d9643
%else
81d9643
 -DUSE_BOOST_PYTHON:BOOL=OFF \
f28d746
 -DUSE_LIBARCHIVE:BOOL=OFF \
81d9643
%endif
366eac0
 -DENABLE_RPATH:BOOL=OFF \
366eac0
 -DENABLE_TESTING:BOOL=OFF \
12e61e0
 -DUSE_MMTF:BOOL=ON \
12e61e0
 -DUSE_QT:BOOL=ON \
366eac0
 -DUSE_MOLEQUEUE:BOOL=ON \
366eac0
 -DUSE_VTK:BOOL=OFF \
366eac0
 -DUSE_HDF5:BOOL=ON \
12e61e0
 -DUSE_SPGLIB:BOOL=ON \
b915768
 -DSPGLIB_LIBRARY:FILEPATH=%{_libdir}/libsymspg.so -DSPGLIB_INCLUDE_DIR:PATH=%{_includedir}/spglib \
366eac0
 -DBUILD_GPL_PLUGINS:BOOL=ON \
366eac0
 -DBUILD_STATIC_PLUGINS:BOOL=ON \
f007721
 -DBUILD_DOCUMENTATION:BOOL=ON \
f28d746
 -DUSE_LIBMSYM:BOOL=OFF
f28d746
20b0b31
%make_build -C build
366eac0
20b0b31
pushd build/docs
366eac0
doxygen
366eac0
popd
366eac0
366eac0
%install
20b0b31
%make_install -C build
366eac0
0c9b9df
# Move scale.py* files into %%{python3_sitearch}/avogadro2
12e61e0
cp -a %{buildroot}%{_libdir}/avogadro2/scripts %{buildroot}%{python3_sitearch}/avogadro2/
12e61e0
pathfix.py -pn -i "%{__python3}" %{buildroot}%{python3_sitearch}/avogadro2/scripts/*/*.py
12e61e0
ln -sf %{python3_sitearch}/avogadro2/scripts %{buildroot}%{_libdir}/avogadro2/scripts
366eac0
366eac0
chrpath -d %{buildroot}%{_libdir}/lib*.so
366eac0
rm -rf %{buildroot}%{_datadir}/doc
366eac0
366eac0
%files
eb569a8
%doc README.md thirdparty/libgwavi/README-libgwavi.md avogadrogenerators/README-avogenerators.md
b752697
%license LICENSE molecules/LICENSE-molecules
b915768
%{_libdir}/libAvogadro*.so.1
b915768
%{_libdir}/libAvogadro*.so.%{version}
eb569a8
%dir %{_libdir}/avogadro2
b915768
%{_libdir}/avogadro2/scripts/
b915768
%{_libdir}/avogadro2/libgwavi.a
b915768
%{_libdir}/avogadro2/staticplugins/
366eac0
%{python3_sitearch}/avogadro2/
b915768
%{_datadir}/avogadro2/
366eac0
366eac0
%files devel
366eac0
%{_includedir}/avogadro2/
b915768
%{_libdir}/libAvogadro*.so
366eac0
%{_libdir}/cmake/avogadrolibs/
366eac0
366eac0
%files doc
20b0b31
%doc README.md build/docs/html
f007721
%license LICENSE
366eac0
366eac0
%changelog
f28d746
* Sun Dec 12 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.95.1-5
f28d746
- Disable libarchive on EPEL
f28d746
4ea42f0
* Sun Nov 21 2021 Orion Poplawski <orion@nwra.com> - 1.95.1-4
4ea42f0
- Rebuild for hdf5 1.12.1
4ea42f0
f28d746
* Sun Nov 21 2021 Orion Poplawski <orion@nwra.com> - 1.95.1-3
f28d746
- Skipped build release
f28d746
fae7684
* Sat Nov 06 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.95.1-2
fae7684
- Prepare Qt6 builds for testing
fae7684
- Rebuilt against openbabel3
fae7684
b752697
* Tue Aug 31 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.95.1-1
b752697
- Release 1.95.1
b752697
- Upgrade avogenerators
b752697
3770bc6
* Tue Aug 10 2021 Orion Poplawski <orion@nwra.com> - 1.94.0-4
3770bc6
- Rebuild for hdf5 1.10.7
3770bc6
afd0e66
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.94.0-3
afd0e66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
afd0e66
098d351
* Tue Jun 08 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.94.0-2
b752697
- Release 1.94.0
098d351
b915768
* Fri Jun 04 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.94.0-1
b915768
- Release 1.94.0
b915768
- Update avogenerators code
b915768
d213a97
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.93.1-2
d213a97
- Rebuilt for Python 3.10
d213a97
c243b87
* Mon May 03 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.93.1-1
c243b87
- Release 1.93.1
c243b87
- Remove obsolete patches
c243b87
ab459b1
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.93.0-8
ab459b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
ab459b1
f6433dd
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.93.0-7
f6433dd
- Second attempt - Rebuilt for
f6433dd
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
f6433dd
ee86d31
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.93.0-6
ee86d31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
ee86d31
75b6fec
* Fri Jun 26 2020 Orion Poplawski <orion@nwra.com> - 1.93.0-5
75b6fec
- Rebuild for hdf5 1.10.6
75b6fec
d7d3599
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.93.0-4
d7d3599
- Rebuilt for Python 3.9
d7d3599
1a31a9c
* Sat Feb 29 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-3
1a31a9c
- Reorganize scripts directory
1a31a9c
37f2134
* Fri Feb 28 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-2
37f2134
- Set USE_SYSTEM_LIBARCHIVE CMake option
37f2134
- Set libarchive's minimal version for building
37f2134
- Explicit Obsoletes tag
37f2134
e508328
* Thu Feb 06 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-1
e508328
- Release 1.93.0
e508328
55966f8
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.92.1-2
55966f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
55966f8
12e61e0
* Tue Jan 21 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.92.1-1
12e61e0
- Release 1.92.1
12e61e0
- Rebuild for spglib-1.14.1
12e61e0
- Use devtools-8 on EPEL7
12e61e0
- Use CMake3
12e61e0
1bb1315
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.91.0-6
1bb1315
- Rebuilt for Python 3.8.0rc1 (#1748018)
1bb1315
5e67494
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.91.0-5
5e67494
- Rebuilt for Python 3.8
5e67494
a9ba785
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.91.0-4
a9ba785
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
a9ba785
216fa32
* Sat Mar 16 2019 Orion Poplawski <orion@nwra.com> - 1.91.0-3
216fa32
- Rebuild for hdf5 1.10.5
216fa32
079de24
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.91.0-2
079de24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
079de24
eb569a8
* Thu Aug 23 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.91.0-1
eb569a8
- Release 1.91.0
eb569a8
- Include 'avogenerators' source code
eb569a8
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