/[packages]/cauldron/hyperv-daemons/current/SPECS/hyperv-daemons.spec
ViewVC logotype

Contents of /cauldron/hyperv-daemons/current/SPECS/hyperv-daemons.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1824170 - (show annotations) (download)
Thu Mar 24 00:29:55 2022 UTC (2 years ago) by umeabot
File size: 8178 byte(s)
Mageia 9 Mass Rebuild
1 # HyperV KVP daemon binary name
2 %global hv_kvp_daemon hypervkvpd
3 # HyperV VSS daemon binary name
4 %global hv_vss_daemon hypervvssd
5 # HyperV FCOPY daemon binary name
6 %global hv_fcopy_daemon hypervfcopyd
7 # snapshot version
8 %global snapver .20150702git
9 # use hardened build
10 %global _hardened_build 1
11 # udev rules prefix
12 %global udev_prefix 70
13
14 Name: hyperv-daemons
15 Version: 0%{snapver}
16 Release: %mkrel 6
17 Summary: HyperV daemons suite
18
19 Group: System/Kernel and hardware
20 License: GPLv2
21 URL: https://www.kernel.org
22
23 # Source files obtained from kernel upstream 4.2-rc0 (4da3064d1775810f10f7ddc1c34c3f1ff502a654)
24 # git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
25 # The daemon and scripts are located in "master branch - /tools/hv"
26 # COPYING -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/COPYING?id=b1940cd21c0f4abdce101253e860feff547291b
27 Source0: COPYING
28
29 # HYPERV KVP DAEMON
30 # hv_kvp_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_kvp_daemon.c?id=4da3064d1775810f10f7ddc1c34c3f1ff502a654
31 Source1: hv_kvp_daemon.c
32 # hv_get_dhcp_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_get_dhcp_info.sh?id=4da3064d1775810f10f7ddc1c34c3f1ff502a654
33 Source2: hv_get_dhcp_info.sh
34 # hv_get_dns_info.sh -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_get_dns_info.sh?id=4da3064d1775810f10f7ddc1c34c3f1ff502a654
35 Source3: hv_get_dns_info.sh
36 # hv_set_ifconfig.sh -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_set_ifconfig.sh?id=4da3064d1775810f10f7ddc1c34c3f1ff502a654
37 Source4: hv_set_ifconfig.sh
38 Source5: hypervkvpd.service
39 Source6: hypervkvp.rules
40
41 # HYPERV VSS DAEMON
42 # hv_vss_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_vss_daemon.c?id=4da3064d1775810f10f7ddc1c34c3f1ff502a654
43 Source100: hv_vss_daemon.c
44 Source101: hypervvssd.service
45 Source102: hypervvss.rules
46
47 # HYPERV FCOPY DAEMON
48 # hv_fcopy_daemon.c -> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/tools/hv/hv_fcopy_daemon.c?id=4da3064d1775810f10f7ddc1c34c3f1ff502a654
49 Source200: hv_fcopy_daemon.c
50 Source201: hypervfcopyd.service
51 Source202: hypervfcopy.rules
52
53
54 # HYPERV KVP DAEMON
55 # Correct paths to external scripts ("/usr/libexec/hypervkvpd").
56 Patch0: hypervkvpd-0-corrected_paths_to_external_scripts.patch
57 # rhbz#872566
58 Patch1: hypervkvpd-0-long_file_names_from_readdir.patch
59
60
61 # HyperV is available only on x86 architectures
62 # The base empty (a.k.a. virtual) package can not be noarch
63 # due to http://www.rpm.org/ticket/78
64 ExclusiveArch: i586 x86_64
65
66 Requires: hypervkvpd = %{version}-%{release}
67 Requires: hypervvssd = %{version}-%{release}
68 Requires: hypervfcopyd = %{version}-%{release}
69
70 %description
71 Suite of daemons that are needed when Linux guest
72 is running on Windows Host with HyperV.
73
74
75 %package -n hypervkvpd
76 Summary: HyperV key value pair (KVP) daemon
77 Group: System/Kernel and hardware
78 Requires: %{name}-license = %{version}-%{release}
79 # for macro definition:
80 BuildRequires: pkgconfig(libsystemd)
81 BuildRequires: systemd
82 BuildRequires: kernel-headers
83 Requires(post): systemd
84 Requires(preun): systemd
85 Requires(postun): systemd
86
87 %description -n hypervkvpd
88 Hypervkvpd is an implementation of HyperV key value pair (KVP)
89 functionality for Linux. The daemon first registers with the
90 kernel driver. After this is done it collects information
91 requested by Windows Host about the Linux Guest. It also supports
92 IP injection functionality on the Guest.
93
94
95 %package -n hypervvssd
96 Summary: HyperV VSS daemon
97 Group: System/Kernel and hardware
98 Requires: %{name}-license = %{version}-%{release}
99 BuildRequires: systemd
100 BuildRequires: kernel-headers
101 Requires(post): systemd
102 Requires(preun): systemd
103 Requires(postun): systemd
104
105 %description -n hypervvssd
106 Hypervvssd is an implementation of HyperV VSS functionality
107 for Linux. The daemon is used for host initiated guest snapshot
108 on HyperV hypervisor. The daemon first registers with the
109 kernel driver. After this is done it waits for instructions
110 from Windows Host if to "freeze" or "thaw" the filesystem
111 on the Linux Guest.
112
113
114 %package -n hypervfcopyd
115 Summary: HyperV FCOPY daemon
116 Group: System/Kernel and hardware
117 Requires: %{name}-license = %{version}-%{release}
118 BuildRequires: systemd
119 BuildRequires: kernel-headers
120 Requires(post): systemd
121 Requires(preun): systemd
122 Requires(postun): systemd
123
124 %description -n hypervfcopyd
125 Hypervfcopyd is an implementation of file copy service functionality
126 for Linux Guest running on HyperV. The daemon enables host to copy
127 a file (over VMBUS) into the Linux Guest. The daemon first registers
128 with the kernel driver. After this is done it waits for instructions
129 from Windows Host.
130
131
132 %package license
133 Summary: License of the HyperV daemons suite
134 Group: System/Kernel and hardware
135 BuildArch: noarch
136
137 %description license
138 Contains license of the HyperV daemons suite.
139
140
141 %prep
142 %setup -Tc
143 cp -pvL %{SOURCE0} COPYING
144
145 cp -pvL %{SOURCE1} hv_kvp_daemon.c
146 cp -pvL %{SOURCE100} hv_vss_daemon.c
147 cp -pvL %{SOURCE200} hv_fcopy_daemon.c
148
149 %patch0 -p1 -b .external_scripts
150 %patch1 -p1 -b .long_names
151
152 %build
153 # HYPERV KVP DAEMON
154 gcc $RPM_OPT_FLAGS -c hv_kvp_daemon.c
155 gcc $RPM_LD_FLAGS hv_kvp_daemon.o -o %{hv_kvp_daemon}
156
157 # HYPERV VSS DAEMON
158 gcc $RPM_OPT_FLAGS -c hv_vss_daemon.c
159 gcc $RPM_LD_FLAGS hv_vss_daemon.o -o %{hv_vss_daemon}
160
161 # HYPERV FCOPY DAEMON
162 gcc $RPM_OPT_FLAGS -c hv_fcopy_daemon.c
163 gcc $RPM_LD_FLAGS hv_fcopy_daemon.o -o %{hv_fcopy_daemon}
164
165 %install
166
167 mkdir -p %{buildroot}%{_sbindir}
168 install -p -m 0755 %{hv_kvp_daemon} %{buildroot}%{_sbindir}
169 install -p -m 0755 %{hv_vss_daemon} %{buildroot}%{_sbindir}
170 install -p -m 0755 %{hv_fcopy_daemon} %{buildroot}%{_sbindir}
171 # Systemd unit file
172 mkdir -p %{buildroot}%{_unitdir}
173 install -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}
174 install -p -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}
175 install -p -m 0644 %{SOURCE201} %{buildroot}%{_unitdir}
176 # Udev rules
177 mkdir -p %{buildroot}%{_udevrulesdir}
178 install -p -m 0644 %{SOURCE6} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
179 install -p -m 0644 %{SOURCE102} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
180 install -p -m 0644 %{SOURCE202} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
181 # Shell scripts for the KVP daemon
182 mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}
183 install -p -m 0755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info
184 install -p -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dns_info
185 install -p -m 0755 %{SOURCE4} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set_ifconfig
186 # Directory for pool files
187 mkdir -p %{buildroot}%{_sharedstatedir}/hyperv
188
189
190 %post -n hypervkvpd
191 %systemd_post hypervkvpd.service
192
193 %preun -n hypervkvpd
194 %systemd_preun hypervkvpd.service
195
196 %postun -n hypervkvpd
197 # hypervkvpd daemon does NOT support restarting (driver, neither)
198 %systemd_postun hypervkvpd.service
199 # If removing the package, delete %%{_sharedstatedir}/hyperv directory
200 if [ "$1" -eq "0" ] ; then
201 rm -rf %{_sharedstatedir}/hyperv || :
202 fi
203
204
205 %post -n hypervvssd
206 %systemd_post hypervvssd.service
207
208 # (tv) empty %%postun:
209 #postun -n hypervvssd
210 #systemd_postun hypervvssd.service
211
212 %preun -n hypervvssd
213 %systemd_preun hypervvssd.service
214
215
216 %post -n hypervfcopyd
217 %systemd_post hypervfcopyd.service
218
219 # (tv) empty %%postun:
220 #postun -n hypervfcopyd
221 #systemd_postun hypervfcopyd.service
222
223 %preun -n hypervfcopyd
224 %systemd_preun hypervfcopyd.service
225
226
227 %files
228 # the base package does not contain any files.
229
230 %files -n hypervkvpd
231 %{_sbindir}/%{hv_kvp_daemon}
232 %{_unitdir}/hypervkvpd.service
233 %{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
234 %dir %{_libexecdir}/%{hv_kvp_daemon}
235 %{_libexecdir}/%{hv_kvp_daemon}/*
236 %dir %{_sharedstatedir}/hyperv
237
238 %files -n hypervvssd
239 %{_sbindir}/%{hv_vss_daemon}
240 %{_unitdir}/hypervvssd.service
241 %{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
242
243 %files -n hypervfcopyd
244 %{_sbindir}/%{hv_fcopy_daemon}
245 %{_unitdir}/hypervfcopyd.service
246 %{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
247
248 %files license
249 %doc COPYING
250

  ViewVC Help
Powered by ViewVC 1.1.30