71e8307
Name:           avogadro2
71e8307
Version:        1.90.0
023148d
Release:        7%{?dist}
71e8307
Summary:        Advanced molecular editor
71e8307
71e8307
License:        BSD
71e8307
URL:            http://avogadro.openmolecules.net/
71e8307
Source0:        https://github.com/OpenChemistry/avogadroapp/archive/%{version}.tar.gz#/avogadroapp-%{version}.tar.gz
71e8307
968cf5f
Source1:        %{name}.appdata.xml
968cf5f
71e8307
BuildRequires:  cmake, chrpath, desktop-file-utils
71e8307
BuildRequires:  avogadro2-libs-devel, molequeue-devel, spglib-devel
71e8307
BuildRequires:  gcc-c++, doxygen
71e8307
BuildRequires:  eigen3-devel, hdf5-devel, glew-devel
71e8307
BuildRequires:  qt5-qtbase-devel, qt5-qttools-devel
a611d26
%if 0%{?fedora}
71f2047
BuildRequires:  libappstream-glib
a611d26
%endif
71e8307
a611d26
Requires: python%{python3_pkgversion}
9575cca
Requires: openbabel%{?_isa}
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
71e8307
%setup -q -n avogadroapp-%{version}
71e8307
71e8307
%build
71e8307
mkdir build && pushd build
71e8307
export LDFLAGS="%{__global_ldflags} -Wl,--as-needed"
71e8307
export CFLAGS="%{optflags} -I%{_includedir}/%{name}"
71e8307
export CXXFLAGS="%{optflags} -I%{_includedir}/%{name}"
71e8307
%cmake -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} \
71e8307
 -DBUILD_DOCUMENTATION:BOOL=ON ..
71e8307
71e8307
%make_build
71e8307
71e8307
%install
71e8307
%make_install -C build
71e8307
rm -rf %{buildroot}%{_datadir}/doc
71e8307
71e8307
chrpath -d %{buildroot}%{_bindir}/%{name}
71e8307
71e8307
desktop-file-edit --set-key=Exec --set-value='env LD_LIBRARY_PATH=%{_libdir}/%{name} %{name} %f' \
71e8307
 --set-key=Icon --set-value=%{_datadir}/icons/%{name}/avogadro2_128.png \
71e8307
 %{buildroot}%{_datadir}/applications/%{name}.desktop
71e8307
71e8307
mkdir -p %{buildroot}%{_datadir}/icons/%{name}
71e8307
cp -a avogadro/icons/* %{buildroot}%{_datadir}/icons/%{name}/
71e8307
a611d26
%if 0%{?fedora}
968cf5f
## Install appdata file
968cf5f
mkdir -p %{buildroot}%{_datadir}/appdata
968cf5f
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/appdata/
a611d26
%endif
968cf5f
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 || :
71e8307
71e8307
%check
71e8307
pushd build
71e8307
#ctest -V
a611d26
%if 0%{?fedora}
968cf5f
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata.xml
a611d26
%endif
71e8307
71e8307
%files
71e8307
%doc README.md
71e8307
%license COPYING
71e8307
%{_bindir}/%{name}
71e8307
%{_datadir}/applications/%{name}.desktop
a611d26
%if 0%{?fedora}
968cf5f
%{_datadir}/appdata/*.appdata.xml
a611d26
%endif
71e8307
%{_datadir}/pixmaps/%{name}.png
71e8307
%{_datadir}/icons/%{name}/
71e8307
71e8307
%changelog
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