1 |
Name: chrome-token-signing |
2 |
Version: 1.1.2 |
3 |
Release: %mkrel 2 |
4 |
Summary: Estonian ID Card signing plugin for supported browsers |
5 |
License: LGPLv2 |
6 |
Group: Networking/WWW |
7 |
URL: https://github.com/open-eid/chrome-token-signing |
8 |
Source0: https://github.com/open-eid/%{name}/archive/v%{version}-1.tar.gz |
9 |
|
10 |
BuildRequires: pkgconfig(openssl) >= 1.1 |
11 |
BuildRequires: pkgconfig(libpcsclite) |
12 |
BuildRequires: pkgconfig(Qt5Core) |
13 |
BuildRequires: pkgconfig(Qt5Network) |
14 |
BuildRequires: pkgconfig(Qt5Widgets) |
15 |
BuildRequires: qtbase5-common-devel |
16 |
|
17 |
# fix mga#11352 |
18 |
Requires: locales-et |
19 |
Requires: mozilla-esteid |
20 |
Requires: mozilla-filesystem |
21 |
|
22 |
Requires(post): jq |
23 |
|
24 |
Recommends: opensc |
25 |
Recommends: ccid |
26 |
Recommends: pcsc-lite |
27 |
|
28 |
# Requires std::future |
29 |
ExcludeArch: armv5tl |
30 |
|
31 |
%description |
32 |
Estonian ID Card signing plugin for Chrome and other supported browsers. |
33 |
|
34 |
%prep |
35 |
%autosetup -n %{name}-%{version}-1 |
36 |
|
37 |
%build |
38 |
%make_build |
39 |
|
40 |
%install |
41 |
# Create directories |
42 |
install -d %{buildroot}%{_sysconfdir}/opt/chrome/native-messaging-hosts |
43 |
install -d %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts |
44 |
install -d %{buildroot}%{_sysconfdir}/chromium-browser/native-messaging-hosts |
45 |
install -d %{buildroot}%{_bindir} |
46 |
install -d %{buildroot}%{_datadir}/%{name} |
47 |
install -d %{buildroot}%{_datadir}/chromium/extensions |
48 |
install -d %{buildroot}%{_datadir}/chromium-browser/extensions |
49 |
install -d %{buildroot}%{_datadir}/google-chrome/extensions |
50 |
install -d %{buildroot}%{_datadir}/mozilla/native-messaging-hosts |
51 |
install -d %{buildroot}%{_datadir}/mozilla/extensions/\{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} |
52 |
install -d %{buildroot}%{_libdir}/mozilla/native-messaging-hosts |
53 |
install -d %{buildroot}%{_libdir}/firefox/distribution |
54 |
|
55 |
# Install files |
56 |
install -D -c -p -m 755 ./host-linux/%{name} %{buildroot}%{_bindir}/ |
57 |
install -D -c -p -m 644 ./host-linux/ee.ria.esteid.json %{buildroot}%{_datadir}/%{name}/ |
58 |
install -D -c -p -m 644 ./host-linux/ff/ee.ria.esteid.json %{buildroot}%{_datadir}/mozilla/native-messaging-hosts/ |
59 |
install -D -c -p -m 644 ./ckjefchnfjhjfedoccjbhjpbncimppeg.json %{buildroot}%{_datadir}/%{name}/ |
60 |
install -D -c -p -m 644 ./\{443830f0-1fff-4f9a-aa1e-444bafbc7319\}.xpi %{buildroot}%{_datadir}/mozilla/extensions/\{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}/ |
61 |
# This is temporary workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1318461 |
62 |
install -D -c -p -m 644 ./host-linux/ff/ee.ria.esteid.json %{buildroot}%{_libdir}/mozilla/native-messaging-hosts/ |
63 |
|
64 |
# Create links |
65 |
ln -s %{_datadir}/%{name}/ee.ria.esteid.json %{buildroot}%{_sysconfdir}/opt/chrome/native-messaging-hosts/ee.ria.esteid.json |
66 |
ln -s %{_datadir}/%{name}/ee.ria.esteid.json %{buildroot}%{_sysconfdir}/chromium/native-messaging-hosts/ee.ria.esteid.json |
67 |
ln -s %{_datadir}/%{name}/ee.ria.esteid.json %{buildroot}%{_sysconfdir}/chromium-browser/native-messaging-hosts/ee.ria.esteid.json |
68 |
ln -s %{_datadir}/%{name}/ckjefchnfjhjfedoccjbhjpbncimppeg.json %{buildroot}%{_datadir}/chromium/extensions/ckjefchnfjhjfedoccjbhjpbncimppeg.json |
69 |
ln -s %{_datadir}/%{name}/ckjefchnfjhjfedoccjbhjpbncimppeg.json %{buildroot}%{_datadir}/chromium-browser/extensions/ckjefchnfjhjfedoccjbhjpbncimppeg.json |
70 |
ln -s %{_datadir}/%{name}/ckjefchnfjhjfedoccjbhjpbncimppeg.json %{buildroot}%{_datadir}/google-chrome/extensions/ckjefchnfjhjfedoccjbhjpbncimppeg.json |
71 |
|
72 |
%post |
73 |
POLICIES=%{_libdir}/firefox/distribution |
74 |
mkdir -p ${POLICIES} |
75 |
if [ ! -f ${POLICIES}/policies.json ]; then |
76 |
JQARGS=-n; |
77 |
else |
78 |
JQARGS=${POLICIES}/policies.json; |
79 |
fi |
80 |
jq '.policies.ExtensionSettings["{443830f0-1fff-4f9a-aa1e-444bafbc7319}"] = {"installation_mode": "normal_installed", "install_url": "https://addons.mozilla.org/firefox/downloads/latest/token-signing2/latest.xpi"}' ${JQARGS} > ${POLICIES}/policies.tmp |
81 |
mv ${POLICIES}/policies.tmp ${POLICIES}/policies.json |
82 |
|
83 |
%postun |
84 |
POLICIES=%{_libdir}/firefox/distribution |
85 |
mkdir -p ${POLICIES} |
86 |
if [ ! -f ${POLICIES}/policies.json ]; then |
87 |
JQARGS=-n; |
88 |
else |
89 |
JQARGS=${POLICIES}/policies.json; |
90 |
fi |
91 |
jq '.policies.ExtensionSettings["{443830f0-1fff-4f9a-aa1e-444bafbc7319}"] = {"installation_mode": "blocked"}' ${JQARGS} > ${POLICIES}/policies.tmp |
92 |
mv ${POLICIES}/policies.tmp ${POLICIES}/policies.json |
93 |
|
94 |
%files |
95 |
%doc LICENSE.LGPL RELEASE-NOTES.md |
96 |
%{_sysconfdir}/opt/chrome/native-messaging-hosts |
97 |
%{_sysconfdir}/chromium/native-messaging-hosts |
98 |
%{_sysconfdir}/chromium-browser/native-messaging-hosts |
99 |
%{_bindir}/%{name} |
100 |
%{_datadir}/%{name} |
101 |
%{_datadir}/chromium |
102 |
%{_datadir}/chromium-browser |
103 |
%{_datadir}/google-chrome |
104 |
%{_datadir}/mozilla/native-messaging-hosts |
105 |
%{_datadir}/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/ |
106 |
%{_libdir}/mozilla/native-messaging-hosts/ |
107 |
%{_libdir}/firefox/distribution/ |