84e05c4
# Use devtoolset 8
84e05c4
%if 0%{?rhel} && 0%{?rhel} == 7
84e05c4
%global dts devtoolset-8-
84e05c4
%endif
84e05c4
71e8307
Name:           avogadro2
eb0714b
Version:        1.95.1
eb0714b
Release:        1%{?dist}
71e8307
Summary:        Advanced molecular editor
71e8307
License:        BSD
71e8307
URL:            http://avogadro.openmolecules.net/
3024a5b
Source0:        https://github.com/OpenChemistry/avogadroapp/archive/%{version}/avogadroapp-%{version}.tar.gz
968cf5f
Source1:        %{name}.appdata.xml
091fbb8
Source2:        https://github.com/OpenChemistry/avogadro-i18n/archive/refs/heads/master.zip#/avogadro-i18n-master.zip
091fbb8
091fbb8
Patch0:         %{name}-avoid_i18n_download.patch
968cf5f
3024a5b
%if 0%{?rhel}
84e05c4
BuildRequires:  epel-rpm-macros
3024a5b
%endif
84e05c4
BuildRequires:  cmake3
eb0714b
BuildRequires:  chrpath
eb0714b
BuildRequires:  desktop-file-utils
8fb8110
BuildRequires:  avogadro2-libs-devel >= 0:%{version}
eb0714b
BuildRequires:  molequeue-devel
eb0714b
BuildRequires:  spglib-devel
eb0714b
BuildRequires:  %{?dts}gcc
eb0714b
BuildRequires:  %{?dts}gcc-c++
eb0714b
BuildRequires:  doxygen
eb0714b
BuildRequires:  eigen3-devel
eb0714b
BuildRequires:  hdf5-devel
eb0714b
BuildRequires:  glew-devel
eb0714b
BuildRequires:  qt5-qtbase-devel
eb0714b
BuildRequires:  qt5-qttools-devel
db40a4a
BuildRequires:  make
a611d26
%if 0%{?fedora}
71f2047
BuildRequires:  libappstream-glib
a611d26
%endif
71e8307
a611d26
Requires: python%{python3_pkgversion}
9575cca
Requires: openbabel%{?_isa}
8fb8110
Requires: avogadro2-libs%{?_isa} >= 0:%{version}
71e8307
71e8307
%description
71e8307
Avogadro is an advanced molecular editor designed for cross-platform use in
71e8307
computational chemistry, molecular modeling, bioinformatics, materials science,
71e8307
and related areas. It offers flexible rendering and a powerful plugin
71e8307
architecture. The code in this repository is a rewrite of Avogadro with source
71e8307
code split across a libraries repository and an application repository. Core
71e8307
features and goals of the Avogadro project:
71e8307
71e8307
* Open source distributed under the liberal 3-clause BSD license
71e8307
* Cross platform with nightly builds on Linux, Mac OS X and Windows
71e8307
* Intuitive interface designed to be useful to whole community
71e8307
* Fast and efficient embracing the latest technologies
71e8307
* Extensible, making extensive use of a plugin architecture
71e8307
* Flexible supporting a range of chemical data formats and packages
71e8307
71e8307
%prep
091fbb8
%setup -n avogadroapp-%{version} -a 2 -q
091fbb8
%autopatch -p1
71e8307
71e8307
%build
84e05c4
%if 0%{?el7}
84e05c4
%{?dts:source /opt/rh/devtoolset-8/enable}
84e05c4
%endif
71e8307
export LDFLAGS="%{__global_ldflags} -Wl,--as-needed"
71e8307
export CFLAGS="%{optflags} -I%{_includedir}/%{name}"
71e8307
export CXXFLAGS="%{optflags} -I%{_includedir}/%{name}"
eb0714b
# RHBZ #1996330
eb0714b
%ifarch %{power64}
eb0714b
export CXXFLAGS="%{optflags} -DEIGEN_ALTIVEC_DISABLE_MMA"
eb0714b
%endif
84e05c4
%cmake3 -DCMAKE_BUILD_TYPE:STRING=Release \
71e8307
 -Wno-dev \
71e8307
 -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
71e8307
 -DENABLE_RPATH:BOOL=ON \
71e8307
 -DENABLE_TESTING:BOOL=OFF \
71e8307
 -DAvogadroLibs_DIR:PATH=%{_libdir} \
8fb8110
 -DBUILD_DOCUMENTATION:BOOL=ON
8fb8110
%cmake_build
71e8307
71e8307
%install
8fb8110
%cmake_install
71e8307
rm -rf %{buildroot}%{_datadir}/doc
71e8307
71e8307
chrpath -d %{buildroot}%{_bindir}/%{name}
71e8307
8fb8110
desktop-file-edit --set-key=Exec --set-value='env QT_QPA_PLATFORM=xcb LD_LIBRARY_PATH=%{_libdir}/avogadro2 %{name} %f' \
71e8307
 --set-key=Icon --set-value=%{_datadir}/icons/%{name}/avogadro2_128.png \
71e8307
 %{buildroot}%{_datadir}/applications/%{name}.desktop
71e8307
8fb8110
cp -p %{buildroot}%{_datadir}/applications/%{name}.desktop %{buildroot}%{_datadir}/applications/%{name}-x11.desktop
8fb8110
 desktop-file-edit --set-key=Exec --set-value='env LD_LIBRARY_PATH=%{_libdir}/avogadro2 %{name} %f' \
091fbb8
  --set-name='Avogadro2 for X11' \
8fb8110
 %{buildroot}%{_datadir}/applications/%{name}-x11.desktop
8fb8110
71e8307
mkdir -p %{buildroot}%{_datadir}/icons/%{name}
71e8307
cp -a avogadro/icons/* %{buildroot}%{_datadir}/icons/%{name}/
71e8307
091fbb8
mkdir -p %{buildroot}%{_datadir}/%{name}/i18n
091fbb8
cp -a avogadro-i18n-master/avogadroapp %{buildroot}%{_datadir}/%{name}/i18n/
091fbb8
cp -a avogadro-i18n-master/avogadrolibs %{buildroot}%{_datadir}/%{name}/i18n/
091fbb8
install -pm 644 i18n/* %{buildroot}%{_datadir}/%{name}/i18n/
091fbb8
a611d26
%if 0%{?fedora}
968cf5f
## Install appdata file
3024a5b
mkdir -p %{buildroot}%{_metainfodir}
3024a5b
install -pm 644 %{SOURCE1} %{buildroot}%{_metainfodir}/
a611d26
%endif
968cf5f
3024a5b
%if 0%{?rhel}
71e8307
%post
71e8307
/bin/touch --no-create %{_datadir}/icons/%{name} &>/dev/null || :
71e8307
71e8307
%postun
71e8307
if [ $1 -eq 0 ] ; then
71e8307
    /bin/touch --no-create %{_datadir}/icons/%{name} &>/dev/null
71e8307
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/%{name} &>/dev/null || :
71e8307
fi
71e8307
71e8307
%posttrans
71e8307
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/%{name} &>/dev/null || :
c7daa69
%endif
71e8307
71e8307
%check
a611d26
%if 0%{?fedora}
3024a5b
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
a611d26
%endif
71e8307
71e8307
%files
71e8307
%doc README.md
c0782e1
%license LICENSE
71e8307
%{_bindir}/%{name}
71e8307
%{_datadir}/applications/%{name}.desktop
8fb8110
%{_datadir}/applications/%{name}-x11.desktop
3024a5b
%{_metainfodir}/*.appdata.xml
71e8307
%{_datadir}/pixmaps/%{name}.png
eb0714b
%{_datadir}/icons/%{name}
eb0714b
%{_datadir}/%{name}/
71e8307
71e8307
%changelog
eb0714b
* Tue Aug 31 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.95.1-1
eb0714b
- Release 1.95.1
eb0714b
9bc72fd
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.94.0-2
9bc72fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
9bc72fd
8fb8110
* Mon Jun 07 2021 Antonio Trande <sagitter@fedoraproject.org> - 1.94.0-1
8fb8110
- Release 1.94.0
8fb8110
beb1f05
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.93.0-7
beb1f05
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
beb1f05
e573f9c
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.93.0-6
e573f9c
- Second attempt - Rebuilt for
e573f9c
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e573f9c
95fccf7
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.93.0-5
95fccf7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
95fccf7
c171f77
* Sat Feb 29 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-4
c171f77
- New rebuild
c171f77
7aaabd6
* Fri Feb 28 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-3
7aaabd6
- Add avogadro2-libs runtime dependency
7aaabd6
b47873b
* Fri Feb 28 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-2
b47873b
- New rebuild
b47873b
81fcdab
* Sun Feb 09 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.93.0-1
81fcdab
- Release 1.93.0
81fcdab
4a5f2f6
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.91.0-6
4a5f2f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
4a5f2f6
84e05c4
* Wed Jan 22 2020 Antonio Trande <sagitter@fedoraproject.org> - 1.91.0-5
84e05c4
- Rebuild for spglib-1.14.1
84e05c4
- Use devtools-8 on EPEL7
84e05c4
- Use CMake3
84e05c4
501e0a3
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.91.0-4
501e0a3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
501e0a3
40a9484
* Sat Mar 16 2019 Orion Poplawski <orion@nwra.com> - 1.91.0-3
40a9484
- Rebuild for hdf5 1.10.5
40a9484
f5b22ac
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.91.0-2
f5b22ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
f5b22ac
3024a5b
* Fri Aug 24 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.91.0-1
3024a5b
- Release 1.91.0
3024a5b
a2ea8f9
* Thu Aug 23 2018 Nicolas Chauvet <kwizart@gmail.com> - 1.90.0-14.20180713git74e1ede
a2ea8f9
- Rebuilt for glew 2.1.0
a2ea8f9
c0782e1
* Sun Jul 15 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-13.20180713git74e1ede
c0782e1
- Update to commit #74e1ede
c0782e1
522cb78
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-12
522cb78
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
522cb78
94f8b57
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-11
94f8b57
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
94f8b57
71d870b
* Wed Jan 31 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-10
71d870b
- Rebuild for moloqueue-0.9.0
71d870b
- Rebuild for GCC-8
71d870b
c7daa69
* Sun Jan 07 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.90.0-9
c7daa69
- Remove obsolete scriptlets
c7daa69
e3d25c6
* Thu Dec 21 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-8
e3d25c6
- Appdata file moved into metainfo data directory
e3d25c6
023148d
* Thu Dec 14 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-7
023148d
- Rebuild for spglib-1.10.2
023148d
9575cca
* Fri Sep 08 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-6
9575cca
- Require OpenBabel (bz#1489749)
9575cca
8690751
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-5
8690751
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
8690751
1ea7522
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.90.0-4
1ea7522
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1ea7522
a611d26
* Thu Jun 22 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-3
a611d26
- Modified for epel7 builds
a611d26
968cf5f
* Tue Apr 25 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-2
968cf5f
- Add appdata file
968cf5f
71e8307
* Sat Mar 11 2017 Antonio Trande <sagitter@fedoraproject.org> - 1.90.0-1
71e8307
- Initial package