File obsidian.spec of Package obsidian
%define name_reverse_notation md.obsidian.Obsidian
Name: obsidian
Version: 1.9.14
Release: 1%{?dist}
Summary: The free and flexible app for your private thoughts
License: NonFree
URL: https://obsidian.md
Source0: https://github.com/obsidianmd/obsidian-releases/releases/download/v%{version}/obsidian-%{version}.tar.gz
Source1: obsidian.sh
Source2: obsidian.desktop
BuildArch: x86_64
BuildRequires: desktop-file-utils
Requires: glibc
Requires: gcc
Requires: fontconfig
Requires: bash
Requires: zlib
Requires: hicolor-icon-theme
Requires: fuse
Requires: electron
%description
A powerful knowledge base that works on top of a local folder of plain text Markdown files.
%prep
%setup -q -n %{name}-%{version}
%build
%install
# Install application resources
install -dm755 %{buildroot}%{_libdir}
cp -r resources %{buildroot}%{_libdir}/obsidian
install -Dm755 %{SOURCE1} %{buildroot}%{_bindir}/obsidian
install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/applications/%{name_reverse_notation}.desktop
install -dm755 %{buildroot}%{_datadir}/pixmaps
ln -rs %{buildroot}%{_libdir}/obsidian/icon.png %{buildroot}%{_datadir}/pixmaps/obsidian.png
%post
update-desktop-database %{_datadir}/applications || :
%postun
update-desktop-database %{_datadir}/applications || :
%check
%files
%{_bindir}/obsidian
%{_datadir}/applications/%{name_reverse_notation}.desktop
%{_datadir}/pixmaps/obsidian.png
%dir %{_libdir}/obsidian
%{_libdir}/obsidian/*