Blame SPECS/hyperv-daemons.spec

b19ffd
# Hyper-V KVP daemon binary name
b19ffd
%global hv_kvp_daemon hypervkvpd
b19ffd
# Hyper-V VSS daemon binary name
b19ffd
%global hv_vss_daemon hypervvssd
b19ffd
# Hyper-V FCOPY daemon binary name
b19ffd
%global hv_fcopy_daemon hypervfcopyd
b19ffd
# snapshot version
b19ffd
%global snapver .20180415git
b19ffd
# use hardened build
b19ffd
%global _hardened_build 1
b19ffd
# udev rules prefix
b19ffd
%global udev_prefix 70
b19ffd
b19ffd
Name:     hyperv-daemons
b19ffd
Version:  0
b19ffd
Release:  0.27%{?snapver}%{?dist}
b19ffd
Summary:  Hyper-V daemons suite
b19ffd
b19ffd
Group:    System Environment/Daemons
b19ffd
License:  GPLv2
b19ffd
URL:      http://www.kernel.org
b19ffd
b19ffd
# Source files obtained from kernel upstream 4.17-rc1 (60cc43fc888428bb2f18f08997432d426a243338)
b19ffd
# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
b19ffd
Source0:  COPYING
b19ffd
b19ffd
# HYPERV KVP DAEMON
b19ffd
Source1:  hv_kvp_daemon.c
b19ffd
Source2:  hv_get_dhcp_info.sh
b19ffd
Source3:  hv_get_dns_info.sh
b19ffd
Source4:  hv_set_ifconfig.sh
b19ffd
Source5:  hypervkvpd.service
b19ffd
Source6:  hypervkvp.rules
b19ffd
b19ffd
# HYPERV VSS DAEMON
b19ffd
Source100:  hv_vss_daemon.c
b19ffd
Source101:  hypervvssd.service
b19ffd
Source102:  hypervvss.rules
b19ffd
b19ffd
# HYPERV FCOPY DAEMON
b19ffd
Source200:  hv_fcopy_daemon.c
b19ffd
Source201:  hypervfcopyd.service
b19ffd
Source202:  hypervfcopy.rules
b19ffd
b19ffd
# HYPERV TOOLS
b19ffd
Source301:  lsvmbus
b19ffd
b19ffd
# Make lsvmbus Python3 compatible
b19ffd
Patch0: 0001-tools-hv-update-lsvmbus-to-be-compatible-with-python.patch
b19ffd
b19ffd
# Do not set NM_CONTROLED=no
b19ffd
Patch1: 0002-hv_set_ifconfig_nm_enable.patch
b19ffd
b19ffd
# Hyper-V is available only on x86 architectures
b19ffd
# The base empty (a.k.a. virtual) package can not be noarch
b19ffd
# due to http://www.rpm.org/ticket/78
b19ffd
ExclusiveArch:  i686 x86_64
b19ffd
b19ffd
Requires:       hypervkvpd = %{version}-%{release}
b19ffd
Requires:       hypervvssd = %{version}-%{release}
b19ffd
Requires:       hypervfcopyd = %{version}-%{release}
b19ffd
BuildRequires:  gcc
b19ffd
b19ffd
%description
b19ffd
Suite of daemons that are needed when Linux guest
b19ffd
is running on Windows Host with Hyper-V.
b19ffd
b19ffd
b19ffd
%package -n hypervkvpd
b19ffd
Summary: Hyper-V key value pair (KVP) daemon
b19ffd
Group:   System Environment/Daemons
b19ffd
Requires: %{name}-license = %{version}-%{release}
b19ffd
BuildRequires: systemd, kernel-headers
b19ffd
Requires(post):   systemd
b19ffd
Requires(preun):  systemd
b19ffd
Requires(postun): systemd
b19ffd
b19ffd
%description -n hypervkvpd
b19ffd
Hypervkvpd is an implementation of Hyper-V key value pair (KVP)
b19ffd
functionality for Linux. The daemon first registers with the
b19ffd
kernel driver. After this is done it collects information
b19ffd
requested by Windows Host about the Linux Guest. It also supports
b19ffd
IP injection functionality on the Guest.
b19ffd
b19ffd
b19ffd
%package -n hypervvssd
b19ffd
Summary: Hyper-V VSS daemon
b19ffd
Group:   System Environment/Daemons
b19ffd
Requires: %{name}-license = %{version}-%{release}
b19ffd
BuildRequires: systemd, kernel-headers
b19ffd
Requires(post):   systemd
b19ffd
Requires(preun):  systemd
b19ffd
Requires(postun): systemd
b19ffd
b19ffd
%description -n hypervvssd
b19ffd
Hypervvssd is an implementation of Hyper-V VSS functionality
b19ffd
for Linux. The daemon is used for host initiated guest snapshot
b19ffd
on Hyper-V hypervisor. The daemon first registers with the
b19ffd
kernel driver. After this is done it waits for instructions
b19ffd
from Windows Host if to "freeze" or "thaw" the filesystem
b19ffd
on the Linux Guest.
b19ffd
b19ffd
b19ffd
%package -n hypervfcopyd
b19ffd
Summary: Hyper-V FCOPY daemon
b19ffd
Group:   System Environment/Daemons
b19ffd
Requires: %{name}-license = %{version}-%{release}
b19ffd
BuildRequires: systemd, kernel-headers
b19ffd
Requires(post):   systemd
b19ffd
Requires(preun):  systemd
b19ffd
Requires(postun): systemd
b19ffd
b19ffd
%description -n hypervfcopyd
b19ffd
Hypervfcopyd is an implementation of file copy service functionality
b19ffd
for Linux Guest running on Hyper-V. The daemon enables host to copy
b19ffd
a file (over VMBUS) into the Linux Guest. The daemon first registers
b19ffd
with the kernel driver. After this is done it waits for instructions
b19ffd
from Windows Host.
b19ffd
b19ffd
b19ffd
%package license
b19ffd
Summary:    License of the Hyper-V daemons suite
b19ffd
Group:      Applications/System
b19ffd
BuildArch:  noarch
b19ffd
b19ffd
%description license
b19ffd
Contains license of the Hyper-V daemons suite.
b19ffd
b19ffd
%package -n hyperv-tools
b19ffd
Summary:    Tools for Hyper-V guests
b19ffd
Group:      Applications/System
b19ffd
BuildArch:  noarch
b19ffd
b19ffd
%description -n hyperv-tools
b19ffd
Contains tools and scripts useful for Hyper-V guests.
b19ffd
b19ffd
%prep
b19ffd
%setup -Tc
b19ffd
cp -pvL %{SOURCE0} COPYING
b19ffd
b19ffd
cp -pvL %{SOURCE1} hv_kvp_daemon.c
b19ffd
cp -pvL %{SOURCE100} hv_vss_daemon.c
b19ffd
cp -pvL %{SOURCE200} hv_fcopy_daemon.c
b19ffd
b19ffd
cp -pvL %{SOURCE301} lsvmbus
b19ffd
%patch0 -p3 -b .lsvmbus_python3
b19ffd
b19ffd
cp -pvL %{SOURCE4} hv_set_ifconfig.sh
b19ffd
%patch1 -p0 -b .hv_set_ifconfig_nm_enable
b19ffd
b19ffd
%build
b19ffd
# HYPERV KVP DAEMON
b19ffd
gcc $RPM_OPT_FLAGS -c hv_kvp_daemon.c
b19ffd
gcc $RPM_LD_FLAGS  hv_kvp_daemon.o -o %{hv_kvp_daemon}
b19ffd
b19ffd
# HYPERV VSS DAEMON
b19ffd
gcc $RPM_OPT_FLAGS -c hv_vss_daemon.c
b19ffd
gcc $RPM_LD_FLAGS hv_vss_daemon.o -o %{hv_vss_daemon}
b19ffd
b19ffd
# HYPERV FCOPY DAEMON
b19ffd
gcc $RPM_OPT_FLAGS -c hv_fcopy_daemon.c
b19ffd
gcc $RPM_LD_FLAGS hv_fcopy_daemon.o -o %{hv_fcopy_daemon}
b19ffd
b19ffd
%install
b19ffd
rm -rf %{buildroot}
b19ffd
b19ffd
mkdir -p %{buildroot}%{_sbindir}
b19ffd
install -p -m 0755 %{hv_kvp_daemon} %{buildroot}%{_sbindir}
b19ffd
install -p -m 0755 %{hv_vss_daemon} %{buildroot}%{_sbindir}
b19ffd
install -p -m 0755 %{hv_fcopy_daemon} %{buildroot}%{_sbindir}
b19ffd
# Systemd unit file
b19ffd
mkdir -p %{buildroot}%{_unitdir}
b19ffd
install -p -m 0644 %{SOURCE5} %{buildroot}%{_unitdir}
b19ffd
install -p -m 0644 %{SOURCE101} %{buildroot}%{_unitdir}
b19ffd
install -p -m 0644 %{SOURCE201} %{buildroot}%{_unitdir}
b19ffd
# Udev rules
b19ffd
mkdir -p %{buildroot}%{_udevrulesdir}
b19ffd
install -p -m 0644 %{SOURCE6} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
b19ffd
install -p -m 0644 %{SOURCE102} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
b19ffd
install -p -m 0644 %{SOURCE202} %{buildroot}%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
b19ffd
# Shell scripts for the KVP daemon
b19ffd
mkdir -p %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}
b19ffd
install -p -m 0755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dhcp_info
b19ffd
install -p -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_get_dns_info
b19ffd
install -p -m 0755 hv_set_ifconfig.sh %{buildroot}%{_libexecdir}/%{hv_kvp_daemon}/hv_set_ifconfig
b19ffd
# Directory for pool files
b19ffd
mkdir -p %{buildroot}%{_sharedstatedir}/hyperv
b19ffd
b19ffd
# Tools
b19ffd
install -p -m 0755 lsvmbus %{buildroot}%{_sbindir}/
b19ffd
sed -i 's,#!/usr/bin/env python,#!%{__python3},' %{buildroot}%{_sbindir}/lsvmbus
b19ffd
b19ffd
%post -n hypervkvpd
b19ffd
if [ $1 -gt 1 ] ; then
b19ffd
	# Upgrade
b19ffd
	systemctl --no-reload disable hypervkvpd.service >/dev/null 2>&1 || :
b19ffd
fi
b19ffd
b19ffd
%preun -n hypervkvpd
b19ffd
%systemd_preun hypervkvpd.service
b19ffd
b19ffd
%postun -n hypervkvpd
b19ffd
# hypervkvpd daemon does NOT support restarting (driver, neither)
b19ffd
%systemd_postun hypervkvpd.service
b19ffd
# If removing the package, delete %%{_sharedstatedir}/hyperv directory
b19ffd
if [ "$1" -eq "0" ] ; then
b19ffd
    rm -rf %{_sharedstatedir}/hyperv || :
b19ffd
fi
b19ffd
b19ffd
b19ffd
%post -n hypervvssd
b19ffd
if [ $1 -gt 1 ] ; then
b19ffd
	# Upgrade
b19ffd
	systemctl --no-reload disable hypervvssd.service >/dev/null 2>&1 || :
b19ffd
fi
b19ffd
b19ffd
%postun -n hypervvssd
b19ffd
%systemd_postun hypervvssd.service
b19ffd
b19ffd
%preun -n hypervvssd
b19ffd
%systemd_preun hypervvssd.service
b19ffd
b19ffd
b19ffd
%post -n hypervfcopyd
b19ffd
if [ $1 -gt 1 ] ; then
b19ffd
	# Upgrade
b19ffd
	systemctl --no-reload disable hypervfcopyd.service >/dev/null 2>&1 || :
b19ffd
fi
b19ffd
b19ffd
%postun -n hypervfcopyd
b19ffd
%systemd_postun hypervfcopyd.service
b19ffd
b19ffd
%preun -n hypervfcopyd
b19ffd
%systemd_preun hypervfcopyd.service
b19ffd
b19ffd
b19ffd
%files
b19ffd
# the base package does not contain any files.
b19ffd
b19ffd
%files -n hypervkvpd
b19ffd
%{_sbindir}/%{hv_kvp_daemon}
b19ffd
%{_unitdir}/hypervkvpd.service
b19ffd
%{_udevrulesdir}/%{udev_prefix}-hypervkvp.rules
b19ffd
%dir %{_libexecdir}/%{hv_kvp_daemon}
b19ffd
%{_libexecdir}/%{hv_kvp_daemon}/*
b19ffd
%dir %{_sharedstatedir}/hyperv
b19ffd
b19ffd
%files -n hypervvssd
b19ffd
%{_sbindir}/%{hv_vss_daemon}
b19ffd
%{_unitdir}/hypervvssd.service
b19ffd
%{_udevrulesdir}/%{udev_prefix}-hypervvss.rules
b19ffd
b19ffd
%files -n hypervfcopyd
b19ffd
%{_sbindir}/%{hv_fcopy_daemon}
b19ffd
%{_unitdir}/hypervfcopyd.service
b19ffd
%{_udevrulesdir}/%{udev_prefix}-hypervfcopy.rules
b19ffd
b19ffd
%files license
b19ffd
%doc COPYING
b19ffd
b19ffd
%files -n hyperv-tools
b19ffd
%{_sbindir}/lsvmbus
b19ffd
b19ffd
%changelog
b19ffd
* Mon Sep 03 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.27.20180415git
b19ffd
- Do not set NM_CONTROLLED=no (#1624355)
b19ffd
b19ffd
* Wed Aug 01 2018 Charalampos Stratakis <cstratak@redhat.com> - 0-0.26.20180415git
b19ffd
- Fix python shebangs
b19ffd
b19ffd
* Mon Jun 11 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.25.20180415git
b19ffd
- Switch lsvmbus to Python3
b19ffd
b19ffd
* Thu Apr 26 2018 Tomas Hozza <thozza@redhat.com> - 0-0.24.20180415git
b19ffd
- Added gcc as an explicit BuildRequires
b19ffd
b19ffd
* Thu Apr 19 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.23.20180415git
b19ffd
- Rebase to 4.17-rc1
b19ffd
b19ffd
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.22.20170105git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b19ffd
b19ffd
* Mon Dec 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.21.20170105git
b19ffd
- Rebase to 4.15-rc2, drop fedora patches as changes are upstream
b19ffd
- Start kvpd after network.target
b19ffd
b19ffd
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20.20170105git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
b19ffd
b19ffd
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.19.20170105git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
b19ffd
b19ffd
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.18.20170105git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
b19ffd
b19ffd
* Wed Jan 11 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.17.20160728git
b19ffd
- Use '-gt' instead of '>' to do the right comparison (#1412033)
b19ffd
b19ffd
* Thu Jan 05 2017 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.16.20160728git
b19ffd
- Rebase to 4.9
b19ffd
- hyperv-tools subpackage added
b19ffd
b19ffd
* Thu Jul 28 2016 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.15.20160728git
b19ffd
- Rebase to 4.8-rc0 (20160728 git snapshot)
b19ffd
- Disable services and remove ConditionVirtualization, multi-user.target
b19ffd
  dependencies switching to udev-only activation (#1331577)
b19ffd
b19ffd
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.14.20150702git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
b19ffd
b19ffd
* Wed Nov 18 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.13.20150702git
b19ffd
- Add udev rules to properly restart services (#1195029)
b19ffd
- Spec cleanup
b19ffd
b19ffd
* Thu Jul 02 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.12.20150702git
b19ffd
- Rebase to 4.2-rc0 (20150702 git snapshot)
b19ffd
- Switch to new chardev-based communication layer (#1195029)
b19ffd
b19ffd
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.11.20150108git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b19ffd
b19ffd
* Thu Jan 08 2015 Vitaly Kuznetsov <vkuznets@redhat.com> - 0-0.10.20150108git
b19ffd
- Rebase to 3.19-rc3 (20150108 git snapshot)
b19ffd
- Drop 'nodaemon' patches, use newly introduced '-n' option
b19ffd
b19ffd
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.9.20140714git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
b19ffd
b19ffd
* Mon Jul 14 2014 Tomas Hozza <thozza@redhat.com> - 0-0.8.20140714git
b19ffd
- Update the File copy daemon to the latest git snapshot
b19ffd
- Fix hyperfcopyd.service to check for /dev/vmbus/hv_fcopy
b19ffd
b19ffd
* Wed Jun 11 2014 Tomas Hozza <thozza@redhat.com> - 0-0.7.20140611git
b19ffd
- Fix FTBFS (#1106781)
b19ffd
- Use kernel-headers instead of kernel-devel for building
b19ffd
- package new Hyper-V fcopy daemon as hypervfcopyd sub-package
b19ffd
b19ffd
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20140219git
b19ffd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
b19ffd
b19ffd
* Wed Feb 19 2014 Tomas Hozza <thozza@redhat.com> - 0-0.5.20140219git
b19ffd
- rebase to the latest git snapshot next-20140219
b19ffd
  - KVP, VSS: removed inclusion of linux/types.h
b19ffd
  - VSS: Ignore VFAT mounts during freeze operation
b19ffd
b19ffd
* Fri Jan 10 2014 Tomas Hozza <thozza@redhat.com> - 0-0.4.20131022git
b19ffd
- provide 'hyperv-daemons' package for convenient installation of all daemons
b19ffd
b19ffd
* Tue Oct 22 2013 Tomas Hozza <thozza@redhat.com> - 0-0.3.20131022git
b19ffd
- rebase to the latest git snapshot next-20130927 (obtained 2013-10-22)
b19ffd
  - KVP, VSS: daemon use single buffer for send/recv
b19ffd
  - KVP: FQDN is obtained on start and cached
b19ffd
b19ffd
* Fri Sep 20 2013 Tomas Hozza <thozza@redhat.com> - 0-0.2.20130826git
b19ffd
- Use 'hypervkvpd' directory in libexec for KVP daemon scripts (#1010268)
b19ffd
- daemons are now WantedBy multi-user.target instead of basic.target (#1010260)
b19ffd
b19ffd
* Mon Aug 26 2013 Tomas Hozza <thozza@redhat.com> - 0-0.1.20130826git
b19ffd
- Initial package