File zotero.spec of Package zotero-bin
#
# spec file for package zotero
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2022 Tejas Guruswamy <tejas.guruswamy@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: zotero-bin
Version: 7.0.5
Release: 0
Summary: Tool to help collect, organize, cite, and share research sources
License: AGPL-3.0-only
Group: Productivity/Office/Organizers
URL: https://www.zotero.org
Source: https://download.zotero.org/client/release/%{version}/Zotero-%{version}_linux-x86_64.tar.bz2
Source1: policies.json
Source2: zotero.desktop
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
Provides: application(zotero.desktop)
Provides: mimehandler(text/plain)
AutoReqProv: no
ExclusiveArch: x86_64
%description
Zotero is a free, easy-to-use tool to help you collect, organize, cite, and share your research sources.
%define source_dir Zotero_linux-x86_64
%prep
%autosetup -cn %{source_dir}
%build
%install
mkdir -p %{buildroot}/%{_bindir} %{buildroot}/%{_datadir}/applications %{buildroot}/%{_libexecdir}
cp -r %{source_dir}/ %{buildroot}/%{_libexecdir}/zotero
ln -s ../../%{_libexecdir}/zotero/zotero %{buildroot}/%{_bindir}/zotero
install -D %{source_dir}/icons/icon32.png %{buildroot}/%{_datadir}/icons/hicolor/32x32/apps/zotero.png
install -D %{source_dir}/icons/icon64.png %{buildroot}/%{_datadir}/icons/hicolor/64x64/apps/zotero.png
install -D %{source_dir}/icons/icon128.png %{buildroot}/%{_datadir}/icons/hicolor/128x128/apps/zotero.png
# .desktop
desktop-file-install --dir %{buildroot}/%{_datadir}/applications %{SOURCE2}
%suse_update_desktop_file zotero
# Disable APP update
mkdir -p %{buildroot}/%{_datadir}/zotero/distribution
install -D %{SOURCE1} %{buildroot}/%{_datadir}/zotero/distribution/policies.json
%files
%{_bindir}/zotero
%{_libexecdir}/zotero
%{_datadir}/zotero
%{_datadir}/zotero/distribution/policies.json
%{_datadir}/applications/zotero.desktop
%{_datadir}/icons/*