forked from QubesOS/qubes-gui-agent-linux
/
gui-agent.spec.in
297 lines (252 loc) · 9.17 KB
/
gui-agent.spec.in
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
#
# This is the SPEC file for creating binary and source RPMs for the VMs.
#
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2010 Joanna Rutkowska <joanna@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# default value in case of no qubes-builder's one
Name: qubes-gui-agent
Version: @VERSION@
Release: 1%{dist}
Summary: The Qubes GUI Agent for AppVMs
Group: Qubes
Vendor: Invisible Things Lab
License: GPL
URL: https://www.qubes-os.org
%define pa_ver_full %((pkg-config --modversion libpulse 2>/dev/null || echo 0.0) | cut -d "-" -f 1)
%define pa_module_dir %(pkg-config --variable=modlibexecdir libpulse)
BuildRequires: gcc
BuildRequires: libX11-devel
BuildRequires: libXcomposite-devel
BuildRequires: libXdamage-devel
BuildRequires: libXfixes-devel
BuildRequires: libXt-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: pulseaudio-libs-devel >= 0.9.21, pulseaudio-libs-devel <= 16.1
BuildRequires: xorg-x11-server-devel
BuildRequires: pam-devel
BuildRequires: qubes-libvchan-devel
BuildRequires: qubes-gui-common-devel >= 4.1.0
BuildRequires: qubes-db-devel
BuildRequires: xen-devel
BuildRequires: mesa-libgbm-devel
BuildRequires: systemd-rpm-macros
Requires: Xorg %(xserver-sdk-abi-requires ansic)
Requires: Xorg %(xserver-sdk-abi-requires videodrv)
Requires: libXfixes
Requires: qubes-core-vm >= 3.0.14
Requires: xorg-x11-xinit
# qubesdb-read --wait option
Requires: qubes-db >= 4.1.4
Requires: python%{python3_pkgversion}-xcffib
Requires: xorg-x11-server-Xorg
Requires: xorg-x11-server-Xephyr
Requires: setxkbmap
Requires: xsetroot
Requires: xrdb
Requires: xmodmap
Requires: xev
Requires: xdpyinfo
Requires: xprop
Requires: xrandr
Provides: qubes-gui-vm = %{version}-%{release}
Obsoletes: qubes-gui-vm < 4.0.0
Source0: %{name}-%{version}.tar.gz
Requires: (%{name}-selinux if selinux-policy)
%package -n pulseaudio-qubes
Summary: Audio support for Qubes VM
# The vchan sink needs .h files from pulseaudio sources
# that are not exported by any *-devel packages; thus they are internal and
# possible to change across version. They are copied to gui git.
# It is possible that our code will work fine with any later pulseaudio
# version; but this needs to be verified for each pulseaudio version.
Requires: pulseaudio = %{pa_ver_full}
# Needed so that systemd can manage PulseAudio
Conflicts: qubes-core-agent < 4.2.5
Conflicts: qubes-gui-vm < 4.0.0
%description -n pulseaudio-qubes
Pulseaudio module to enable sound support in Qubes VM
%package -n pipewire-qubes
Summary: Experimental PipeWire audio support for Qubes VMs
Requires: pipewire
BuildRequires: pipewire-devel
BuildRequires: qubes-db-devel
BuildRequires: qubes-libvchan-devel
%description -n pipewire-qubes
Experimental PipeWire module to enable sound support in Qubes VMs.
Unlike the PulseAudio support in the pulseaudio-qubes package, this
works with the stock PipeWire service and does not depend on internal
PipeWire headers. It also promises lower latency than PulseAudio,
at least once the audio daemon supports low latency.
%package xfce
Summary: XFCE desktop support for Qubes VM
%description xfce
XFCE desktop support for Qubes VM
%package -n qubes-gui-vnc
Summary: Remote GuiVM support using VNC
Requires: x11vnc
%description -n qubes-gui-vnc
Remote GuiVM support using VNC
%description
The Qubes GUI agent that needs to be installed in VM in order to provide the
Qubes fancy GUI.
%prep
%setup -q
rm -f pulse/pulsecore
ln -s pulsecore-%{pa_ver_full} pulse/pulsecore
%build
%{?set_build_flags}
#make clean
make appvm
%install
rm -rf -- "$RPM_BUILD_ROOT"
make install "DESTDIR=$RPM_BUILD_ROOT" \
LIBDIR=%{_libdir} \
DATADIR=%{_datadir} \
SYSLIBDIR=/usr/lib \
PA_VER_FULL=%{pa_ver_full} \
ENABLE_SELINUX=%{with selinux} \
UNITDIR=%{_unitdir} \
USERUNITDIR=%{_userunitdir} \
USERPRESETDIR=%{_userpresetdir} \
UDEVRULESDIR=%{_udevrulesdir}
%post
if [ -x /bin/systemctl ] && readlink /sbin/init | grep -q systemd; then
/bin/systemctl enable qubes-gui-agent.service 2> /dev/null
fi
%post -n pulseaudio-qubes
sed -i '/^autospawn/d' /etc/pulse/client.conf
echo autospawn=no >> /etc/pulse/client.conf
# simplified version of preset_units() from core-agent-linux
preset_units() {
local represet=
cat "$1" | while read action unit_name
do
if [ "$action" = "#" -a "$unit_name" = "Units below this line will be re-preset on package upgrade" ]
then
represet=1
continue
fi
echo "$action $unit_name" | grep -q '^[[:space:]]*[^#;]' || continue
[ -n "$action" -a -n "$unit_name" ] || continue
if [ "$2" = "initial" -o "$represet" = "1" ]
then
systemctl --no-reload --global preset "$unit_name" >/dev/null 2>&1 || :
fi
done
}
if [ $1 -eq 1 ]
then
preset_units /usr/lib/systemd/user-preset/75-pulseaudio-qubes.preset initial
else
preset_units /usr/lib/systemd/user-preset/75-pulseaudio-qubes.preset upgrade
fi
%postun -n pulseaudio-qubes
for unit_name in pipewire.socket pipewire.service \
pipewire-pulse.socket pipewire-pulse.service \
wireplumber.service; do
systemctl --no-reload --global preset "$unit_name" >/dev/null 2>&1 || :
done
%post -n pipewire-qubes
%systemd_user_post pipewire.service pipewire.socket wireplumber.service
%preun -n pipewire-qubes
%systemd_user_preun pipewire.service pipewire.socket wireplumber.service
%preun
if [ "$1" = 0 ] ; then
chkconfig qubes-gui-agent off
[ -x /bin/systemctl ] && /bin/systemctl disable qubes-gui-agent.service
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
fi
%posttrans
/usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
if [ -d '/etc/init.d' ] && ! [ "$(ls -A /etc/init.d/ 2> /dev/null)" ]; then
rmdir /etc/init.d
fi
%triggerin -n pulseaudio-qubes -- pulseaudio-libs
sed -i '/^autospawn/d' /etc/pulse/client.conf
echo autospawn=no >> /etc/pulse/client.conf
%clean
rm -rf $RPM_BUILD_ROOT
rm -f %{name}-%{version}
%files
%defattr(-,root,root,-)
%_bindir/qubes-gui
%_bindir/qubes-gui-runuser
%_bindir/qubes-session
%_bindir/qubes-run-xorg
%_bindir/qubes-run-xephyr
%_bindir/qubes-start-xephyr
%_bindir/qubes-change-keyboard-layout
%_bindir/qubes-set-monitor-layout
%_libdir/xorg/modules/drivers/qubes_drv.so
%_libdir/xorg/modules/drivers/dummyqbs_drv.so
%_libdir/libxf86-qubes-common.so
%attr(0644,root,root) /etc/X11/xorg-qubes.conf.template
/etc/profile.d/qubes-gui.sh
/etc/profile.d/qubes-gui.csh
%config /etc/pam.d/qubes-gui-agent
%config /etc/security/limits.d/90-qubes-gui.conf
%config /etc/xdg/Trolltech.conf
/etc/X11/xinit/xinitrc.d/20qt-x11-no-mitshm.sh
/etc/X11/xinit/xinitrc.d/20qt-gnome-desktop-session-id.sh
/etc/X11/xinit/xinitrc.d/50guivm-windows-prefix.sh
/etc/qubes-rpc/qubes.SetMonitorLayout
/etc/qubes-rpc/qubes.GuiVMSession
/etc/qubes/post-install.d/20-qubes-guivm-gui-agent.sh
%config /etc/sysconfig/desktop
%_unitdir/qubes-gui-agent.service
%_udevrulesdir/70-master-of-seat.rules
%_udevrulesdir/90-qubes-virtual-input-device.rules
%_sysctldir/30-qubes-gui-agent.conf
/usr/lib/qubes/gtk4-workarounds.sh
/usr/lib/qubes/qubes-gui-agent-pre.sh
/usr/lib/qubes/qubes-keymap.sh
/usr/lib/qubes/qubes-xorg-wrapper
%{_datadir}/glib-2.0/schemas/20_qubes-gui-vm.gschema.override
/usr/lib/qubes/icon-sender
/etc/xdg/autostart/qubes-gtk4-workarounds.desktop
/etc/xdg/autostart/qubes-icon-sender.desktop
/etc/xdg/autostart/qubes-qrexec-fork-server.desktop
/etc/xdg/autostart/qubes-keymap.desktop
%dir /var/log/qubes
%files -n pulseaudio-qubes
%_tmpfilesdir/qubes-pulseaudio.conf
/etc/pulse/qubes-default.pa
%_bindir/start-pulseaudio-with-vchan
%{pa_module_dir}/module-vchan-sink.so
/etc/xdg/autostart/qubes-pulseaudio.desktop
/usr/lib/systemd/user-preset/75-pulseaudio-qubes.preset
/usr/lib/systemd/user/pulseaudio.service.d/30_qubes.conf
%files -n pipewire-qubes
%_datadir/pipewire/pipewire.conf.d/30_qubes.conf
%_userpresetdir/74-qubes-vm.preset
%_libdir/pipewire-0.3/libpipewire-module-qubes.so
%_defaultlicensedir/pipewire-qubes/COPYING
/etc/qubes/post-install.d/20-qubes-pipewire.sh
# Works with ordinary PipeWire service :)
%files xfce
/etc/X11/xinit/xinitrc.d/60xfce-desktop.sh
%files -n qubes-gui-vnc
#/lib/systemd/system/qubes-gui-vncserver.service
%attr(0644,root,root) /etc/X11/xorg-qubes-x11vnc.conf.template
%attr(0644,root,root) /etc/systemd/system/lightdm.service.d/qubes-guivm-vnc.conf
%_bindir/qubes-run-x11vnc
%changelog
@CHANGELOG@