-
Notifications
You must be signed in to change notification settings - Fork 4
/
cbetar2.spec.rpkg
100 lines (78 loc) · 3.4 KB
/
cbetar2.spec.rpkg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# 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 <[email protected]> 21.2.0-1
- 21.2.0: Support to disable file system offline DB modes.
* Sat Jun 18 2022 Meng-Yuan Huang <[email protected]> 21.0.0-1
- 21.0.0: Increase reliability.
* Fri Jun 17 2022 Meng-Yuan Huang <[email protected]> 20.0.1-1
- 20.0.1: Update to Electron 19.0.4.
* Wed May 25 2022 Meng-Yuan Huang <[email protected]> 19.2.2-1
- 19.2.2: Use distro's nodejs to build.
* Thu Apr 21 2022 Meng-Yuan Huang <[email protected]> 19.2.0-1
- 19.2.0: Fix Gnome Shell app menu name and icon.
* Wed Apr 20 2022 Meng-Yuan Huang <[email protected]> 19.1.0-2
- 19.1.0: Initial release on COPR.