# vim: syntax=spec Name: {{{ git_dir_name }}} Version: 21.2.0 Release: 1%{?dist} Summary: A Buddhist text reader using CBETA APIs. URL: https://github.com/MrMYHuang/%{name} License: MIT # Detailed information about the source Git repository and the source commit # for the created rpm package VCS: {{{ git_dir_vcs }}} Source0: {{{ git_dir_pack }}} BuildRequires: nodejs BuildRequires: npm BuildRequires: jq BuildRequires: make BuildRequires: python3 BuildRequires: gcc-c++ BuildRequires: desktop-file-utils BuildRequires: libappstream-glib Requires: at-spi2-core Requires: gtk3 Requires: libXScrnSaver Requires: libXtst Requires: libnotify Requires: libuuid Requires: nss Requires: rpm-libs Requires: xdg-utils %description CBETA Electronic Buddhist Text Reader 2 app features: search by categories, full text search, bookmarks, share by link, offline browsing, text to speech, Buddhism dictionary, themes, pagination, adjustable font size, Kai font, vertical text layout, Buddhist text printing, cross platforms, no ad, open source. # The following four sections already describe the rpm build process itself. # prep will extract the tarball defined as Source above and descend into it. %prep tar zxf %{SOURCE0} %build cd %{name} npm i --ignore-scripts npm run build-electron npm x -- electron-builder -l dir -c electronBuilderConfigs/flatpak.json %install electronPackagePath=$(ls -d ./%{name}/dist/linux*unpacked) mkdir -p %{buildroot}/%{_usr}/%{name} cp -a ${electronPackagePath}/. %{buildroot}/%{_usr}/%{name} mkdir -p %{buildroot}/%{_bindir} ln -s %{_usr}/%{name}/%{name} %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_metainfodir} mv %{name}/buildElectron/io.github.mrmyhuang.%{name}.metainfo.xml %{buildroot}/%{_metainfodir} mkdir -p %{buildroot}/%{_datadir}/applications mv %{name}/buildElectron/io.github.mrmyhuang.%{name}.desktop %{buildroot}/%{_datadir}/applications desktop-file-validate %{buildroot}/%{_datadir}/applications/io.github.mrmyhuang.%{name}.desktop mkdir -p %{buildroot}/%{_datadir}/icons cp %{name}/buildElectron/icon.png %{buildroot}/%{_datadir}/icons/%{name}.png sed -i 's#^Exec=.*$#Exec=%{_bindir}/%{name} --no-sandbox#' %{buildroot}/%{_datadir}/applications/io.github.mrmyhuang.%{name}.desktop sed -i 's#^Icon=.*$#Icon=%{_datadir}/icons/%{name}.png#' %{buildroot}/%{_datadir}/applications/io.github.mrmyhuang.%{name}.desktop %check appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml # This lists all the files that are included in the rpm package and that # are going to be installed into target system where the rpm is installed. %files %license %{name}/LICENSE.txt %{_usr}/%{name} %{_bindir}/%{name} %{_metainfodir}/io.github.mrmyhuang.%{name}.metainfo.xml %{_datadir}/applications/io.github.mrmyhuang.%{name}.desktop %{_datadir}/icons/%{name}.png %changelog * Tue Aug 23 2022 Meng-Yuan Huang 21.2.0-1 - 21.2.0: Support to disable file system offline DB modes. * Sat Jun 18 2022 Meng-Yuan Huang 21.0.0-1 - 21.0.0: Increase reliability. * Fri Jun 17 2022 Meng-Yuan Huang 20.0.1-1 - 20.0.1: Update to Electron 19.0.4. * Wed May 25 2022 Meng-Yuan Huang 19.2.2-1 - 19.2.2: Use distro's nodejs to build. * Thu Apr 21 2022 Meng-Yuan Huang 19.2.0-1 - 19.2.0: Fix Gnome Shell app menu name and icon. * Wed Apr 20 2022 Meng-Yuan Huang 19.1.0-2 - 19.1.0: Initial release on COPR.