-
Notifications
You must be signed in to change notification settings - Fork 0
/
parallels-tools.spec
248 lines (182 loc) · 7.83 KB
/
parallels-tools.spec
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
Name: parallels-tools
Version: 16.0.0.48916
Release: 1%{?dist}
Summary: Parallels Tools for Linux
Group: Applications/System
License: Parallels
URL: https://www.parallels.com/products/desktop
Source: parallels-tools-%{version}.tar.gz
Source1: kmodtool-parallels-tools
Source2: parallels-tools-prltoolsd.service
Source3: parallels-tools-systemd.preset
Source10: parallels-tools-dracut.conf
Source11: parallels-tools-modules-load.conf
Patch1: parallels-tools-modprobe.patch
Requires: kmod-%{name} = %{version}-%{release}
Requires: systemd
BuildRequires: kernel-abi-whitelists
BuildRequires: kernel-devel
BuildRequires: elfutils-libelf-devel
BuildRequires: make
BuildRequires: perl
BuildRequires: redhat-rpm-config
BuildRequires: gcc
ExclusiveOS: linux
ExclusiveArch: x86_64
# Kmod magic hidden here.
%define kmod_version %{version}
%define kmod_release %{release}
%{!?kversion: %define kversion $(uname -r)}
%{expand:%(sh %{SOURCE1} rpmtemplate %{name} %{kversion} "")}
%define debug_package %{nil}
%description
Parallels Tools are a suite of special utilities that help you use your
virtual machines in the most comfortable and efficient way. With Parallels
Tools, you can move the mouse seamlessly between the virtual machine and your
Mac, change the virtual machine's screen resolution by simply resizing its
window, synchronize your virtual machine's time and date settings with the
time settings of the host computer, share your Mac's disks and folders with
its virtual machines, copy text and drag and drop objects from Mac OS to a
virtual machine and vice versa.
%prep
%setup -q -n %{name}-%{version} -c
%patch1 -p0 -b .modprobe
%build
# kernel modules
pushd kmods
tar xzf prl_mod.tar.gz
pushd prl_eth/pvmnet
%{__make} KERNEL_DIR=%{_usrsrc}/kernels/%{kversion}
popd
pushd prl_tg/Toolgate/Guest/Linux/prl_tg
%{__make} KERNEL_DIR=%{_usrsrc}/kernels/%{kversion}
popd
cp prl_tg/Toolgate/Guest/Linux/prl_tg/*.symvers prl_fs/SharedFolders/Guest/Linux/prl_fs
cp prl_tg/Toolgate/Guest/Linux/prl_tg/*.symvers prl_vid/Video/Guest/Linux/kmod
pushd prl_fs/SharedFolders/Guest/Linux/prl_fs
%{__make} KERNEL_DIR=%{_usrsrc}/kernels/%{kversion}
popd
pushd prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze
%{__make} KERNEL_DIR=%{_usrsrc}/kernels/%{kversion}
popd
pushd prl_vid/Video/Guest/Linux/kmod
%{__make} KERNEL_DIR=%{_usrsrc}/kernels/%{kversion}
popd
find . -type f -name '*.ko' -print0 | xargs -0 %{__strip} --strip-debug
popd
# Selinux
mkdir selinux
cp installer/*.te selinux/
cp installer/*.fc selinux/
rm -f selinux/prlvtg.*
pushd selinux
%{__make} -f %{_datadir}/selinux/devel/Makefile
popd
%install
# tools
%{__install} -d %{buildroot}%{_sysconfdir}/pm/sleep.d
%{__install} -m 755 tools/99prltoolsd-hibernate %{buildroot}%{_sysconfdir}/pm/sleep.d/99-prltoolsd
%{__install} -d %{buildroot}%{_unitdir}
%{__install} %{SOURCE2} %{buildroot}%{_unitdir}/prltoolsd.service
%{__install} -d %{buildroot}%{_presetdir}
%{__install} %{SOURCE3} %{buildroot}%{_presetdir}/10-parallels.preset
%{__install} -d %{buildroot}%{_bindir}
%{__install} tools/prlfsmountd.sh %{buildroot}%{_bindir}/prlfsmountd
%{__install} tools/tools64/bin/prl_showvmcfg %{buildroot}%{_bindir}/prl_showvmcfg
%{__install} tools/tools64/bin/prlhosttime %{buildroot}%{_bindir}/prlhosttime
%{__install} tools/tools64/bin/prltimesync %{buildroot}%{_bindir}/prltimesync
%{__install} tools/tools64/bin/prltoolsd %{buildroot}%{_bindir}/prltoolsd
%{__install} -d %{buildroot}%{_sbindir}
%{__install} tools/tools64/sbin/prl_nettool %{buildroot}%{_sbindir}/prl_nettool
%{__install} tools/tools64/sbin/prl_snapshot %{buildroot}%{_sbindir}/prl_snapshot
%{__install} -d %{buildroot}%{_mandir}/man8
%{__install} tools/mount.prl_fs.8 %{buildroot}%{_mandir}/man8/mount.prl_fs.8
%{__install} -d %{buildroot}/usr/lib/parallels-tools/tools/scripts/
%{__install} -m 755 tools/scripts/functions %{buildroot}/usr/lib/parallels-tools/tools/scripts/functions
%{__install} -m 755 tools/scripts/list_services.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/list_services.sh
%{__install} -m 755 tools/scripts/list_software.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/list_software.sh
%{__install} -m 755 tools/scripts/redhat-get_dhcp.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/redhat-get_dhcp.sh
%{__install} -m 755 tools/scripts/redhat-restart.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/redhat-restart.sh
%{__install} -m 755 tools/scripts/redhat-set_dhcp.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/redhat-set_dhcp.sh
%{__install} -m 755 tools/scripts/redhat-set_gateway.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/redhat-set_gateway.sh
%{__install} -m 755 tools/scripts/redhat-set_ip.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/redhat-set_ip.sh
%{__install} -m 755 tools/scripts/redhat-set_route.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/redhat-set_route.sh
%{__install} -m 755 tools/scripts/set_dns.sh %{buildroot}/usr/lib/parallels-tools/tools/scripts/set_dns.sh
# kernel modules
%{__install} -d %{buildroot}/lib/modules/%{kversion}/extra/%{name}
find kmods -type f -name '*.ko' -print0 | xargs -0 %{__install} -t %{buildroot}/lib/modules/%{kversion}/extra/%{name}
%{__install} -d %{buildroot}%{_sysconfdir}/modprobe.d
%{__install} installer/blacklist-parallels.conf %{buildroot}%{_sysconfdir}/modprobe.d/parallels.conf
%{__install} -d %{buildroot}%{_prefix}/lib/dracut/dracut.conf.d
%{__install} %{SOURCE10} %{buildroot}%{_prefix}/lib/dracut/dracut.conf.d/99-parallels.conf
%{__install} -d %{buildroot}%{_prefix}/lib/modules-load.d/
%{__install} %{SOURCE11} %{buildroot}%{_prefix}/lib/modules-load.d/parallels.conf
%{__install} -d %{buildroot}%{_udevrulesdir}
%{__install} tools/parallels-video.rules %{buildroot}%{_udevrulesdir}/99-parallels-video.rules
# Selinux
%{__install} -d %{buildroot}%{_datadir}/selinux/packages/%{name}
find selinux -name '*.pp' -print0 | xargs -0 %{__install} -t %{buildroot}%{_datadir}/selinux/packages/%{name}
%files
%{_bindir}/prl_showvmcfg
%{_bindir}/prlfsmountd
%{_bindir}/prlhosttime
%{_bindir}/prltimesync
%{_bindir}/prltoolsd
%{_sbindir}/prl_nettool
%{_sbindir}/prl_snapshot
%{_sysconfdir}/pm/sleep.d/99-prltoolsd
/usr/lib/parallels-tools
%defattr(644,root,root,755)
%{_mandir}/man8/mount.prl_fs.8.gz
%{_presetdir}/10-parallels.preset
%{_unitdir}/prltoolsd.service
%post
%systemd_post prltoolsd.service
%preun
%systemd_preun prltoolsd.service
%postun
%systemd_postun_with_restart prltoolsd.service
%clean
%{__rm} -rf %{buildroot}
# Selinux
%package selinux
Summary: SELinux module for %{name}
BuildArch: noarch
BuildRequires: checkpolicy, selinux-policy-devel
Requires: %{name} = %{version}-%{release}
Requires(post): selinux-policy-base >= %{_selinux_policy_version}
Requires(post): policycoreutils
%if 0%{?rhel} == 7
Requires(post): policycoreutils-python
%else
Requires(post): policycoreutils-python-utils
%endif
Requires(pre): libselinux-utils
Requires(post): libselinux-utils
%description selinux
This package provides the SELinux policy module to ensure %{name}
runs properly under an environment with SELinux enabled.
%files selinux
%defattr(644,root,root,755)
%{_datadir}/selinux/packages/%{name}
%pre selinux
%selinux_relabel_pre
%post selinux
%selinux_modules_install %{_datadir}/selinux/packages/%{name}/prlfs.pp %{_datadir}/selinux/packages/%{name}/prltimesync.pp %{_datadir}/selinux/packages/%{name}/prltoolsd.pp
%selinux_relabel_post
%posttrans selinux
%selinux_relabel_post
%systemd_postun_with_restart prltoolsd.service
%postun selinux
%selinux_modules_uninstall prlfs prltimesync prltoolsd
if [ $1 -eq 0 ]; then
%selinux_relabel_post
fi
# Changelog
%changelog
* Fri Aug 12 2020 Andre Sencioles <asenci@gmail.com> - 16.0.0.48916-1
- Updated to version 16.0.0.48916
* Fri May 22 2020 Andre Sencioles <asenci@gmail.com> - 15.1.4.47270-1
- Updated to version 15.1.4.47270
* Fri Nov 22 2019 Andre Sencioles <asenci@gmail.com> - 15.1.1.47117-1
- Initial release