Blame SPECS/WALinuxAgent.spec

59ec3a
%global with_legacy 0
75c452
%global dracut_modname_udev 97walinuxagent
75c452
%global dracut_modname_cvm 97walinuxagentcvm
59ec3a
59ec3a
Name:           WALinuxAgent
a85d1c
Version:        2.7.0.6
75c452
Release:        9%{?dist}
59ec3a
Summary:        The Microsoft Azure Linux Agent
59ec3a
59ec3a
License:        ASL 2.0
59ec3a
URL:            https://github.com/Azure/%{name}
59ec3a
Source0:        https://github.com/Azure/%{name}/archive/v%{version}.tar.gz
75c452
Source1:        module-setup-udev.sh
75c452
Source2:        module-setup-cvm.sh
75c452
Source3:        90-tpm2-import.rules
75c452
Source4:        tpm2-luks-import.sh
59ec3a
59ec3a
# Python3.9 fixes
a85d1c
Patch0001: 0001-Initial-redhat-build-configuation.patch
a85d1c
Patch0002: 0002-Implement-restart_if-for-RedHat-OS.patch
2acd00
# For bz#2098233 - [Azure][WALA][RHEL-9] [9.1] walinuxagent kills network during boot
a85d1c
Patch3: wla-redhat-Fix-command-sequence-for-restarting-net-inter.patch
2acd00
# For bz#2114830 - [Azure][WALA][RHEL-9.1] Provisioning failed if no ifcfg-eth0
2acd00
Patch4: wla-redhat-Use-NetworkManager-to-set-DHCP-hostnames-on-r.patch
2acd00
# For bz#2093965 - [Azure][WALA][RHEL-9] The description of "Logs.Collect" is incorrect
2acd00
Patch5: wla-Update-Log-Collector-default-in-Comments-and-Readme-.patch
a85d1c
59ec3a
# Source-git patches
59ec3a
59ec3a
BuildArch:      noarch
59ec3a
59ec3a
BuildRequires:  python3-devel
59ec3a
BuildRequires:  python3-setuptools
59ec3a
BuildRequires:  python3-distro
59ec3a
Requires:       %name-udev = %version-%release
59ec3a
%if 0%{?fedora}
59ec3a
Requires:       ntfsprogs
59ec3a
%endif
59ec3a
Requires:       openssh
59ec3a
Requires:       openssh-server
59ec3a
Requires:       openssl
59ec3a
Requires:       parted
59ec3a
Requires:       python3-pyasn1
59ec3a
Requires:       iptables
59ec3a
59ec3a
BuildRequires:   systemd
59ec3a
Requires(post):  systemd
59ec3a
Requires(preun): systemd
59ec3a
Requires(postun): systemd
59ec3a
59ec3a
%description
59ec3a
The Microsoft Azure Linux Agent supports the provisioning and running of Linux
59ec3a
VMs in the Microsoft Azure cloud. This package should be installed on Linux disk
59ec3a
images that are built to run in the Microsoft Azure environment.
59ec3a
59ec3a
%if 0%{?with_legacy}
59ec3a
%package legacy
59ec3a
Summary:        The Microsoft Azure Linux Agent (legacy)
59ec3a
Requires:	%name = %version-%release
59ec3a
Requires:	python2
59ec3a
Requires:	net-tools
59ec3a
59ec3a
%description legacy
59ec3a
The Microsoft Azure Linux Agent supporting old version of extensions.
59ec3a
%endif
59ec3a
59ec3a
%package udev
59ec3a
Summary:        Udev rules for Microsoft Azure
59ec3a
59ec3a
%description udev
59ec3a
Udev rules specific to Microsoft Azure Virtual Machines.
59ec3a
75c452
%package cvm
75c452
Summary:        Microsoft Azure CVM specific tools
75c452
Requires: tpm2-tools
75c452
Requires: cryptsetup
75c452
75c452
%description cvm
75c452
Scripts and udev rules specific to Microsoft Azure Confidential Virtual Machines.
75c452
59ec3a
%prep
59ec3a
%setup -q
a85d1c
%autopatch -p1
59ec3a
59ec3a
%build
59ec3a
%py3_build
59ec3a
59ec3a
%install
59ec3a
%{__python3} setup.py install -O1 --skip-build --root %{buildroot} --lnx-distro redhat
59ec3a
59ec3a
mkdir -p -m 0700 %{buildroot}%{_sharedstatedir}/waagent
59ec3a
mkdir -p %{buildroot}%{_localstatedir}/log
59ec3a
touch %{buildroot}%{_localstatedir}/log/waagent.log
59ec3a
59ec3a
mkdir -p %{buildroot}%{_udevrulesdir}
59ec3a
mv %{buildroot}%{_sysconfdir}/udev/rules.d/*.rules %{buildroot}%{_udevrulesdir}/
59ec3a
59ec3a
rm -rf %{buildroot}/%{python3_sitelib}/tests
59ec3a
rm -rf %{buildroot}/%{python3_sitelib}/__main__.py
59ec3a
rm -rf %{buildroot}/%{python3_sitelib}/__pycache__/__main__*.py*
59ec3a
59ec3a
%if 0%{?with_legacy}
59ec3a
sed -i 's,#!/usr/bin/env python,#!/usr/bin/python2,' %{buildroot}%{_sbindir}/waagent2.0
59ec3a
%else
59ec3a
rm -f %{buildroot}%{_sbindir}/waagent2.0
59ec3a
%endif
59ec3a
59ec3a
mv %{buildroot}%{_sysconfdir}/logrotate.d/waagent.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
59ec3a
75c452
mkdir -p %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname_udev}
75c452
cp %{SOURCE1} %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname_udev}/module-setup.sh
75c452
chmod 0755 %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname_udev}/module-setup.sh
75c452
75c452
mkdir -p %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname_cvm}
75c452
cp %{SOURCE2} %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname_cvm}/module-setup.sh
75c452
chmod 0755 %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modname_cvm}/module-setup.sh
75c452
install -m0644 -D -t %{buildroot}%{_udevrulesdir}/ %{SOURCE3}
75c452
install -m0755 -D -t %{buildroot}%{_sbindir} %{SOURCE4}
59ec3a
59ec3a
%post
59ec3a
%systemd_post waagent.service
59ec3a
59ec3a
%preun
59ec3a
%systemd_preun waagent.service
59ec3a
59ec3a
%postun
59ec3a
%systemd_postun_with_restart waagent.service
2acd00
rm -rf %{_unitdir}/waagent.service.d/
59ec3a
59ec3a
%files
59ec3a
%doc LICENSE.txt NOTICE README.md
59ec3a
%ghost %{_localstatedir}/log/waagent.log
2acd00
%ghost %{_unitdir}/waagent-network-setup.service
59ec3a
%dir %attr(0700, root, root) %{_sharedstatedir}/waagent
59ec3a
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
59ec3a
%{_sbindir}/waagent
59ec3a
%config(noreplace) %{_sysconfdir}/waagent.conf
59ec3a
%{_unitdir}/waagent.service
a85d1c
%{_unitdir}/azure.slice
a85d1c
%{_unitdir}/azure-vmextensions.slice
59ec3a
%{python3_sitelib}/azurelinuxagent
59ec3a
%{python3_sitelib}/*.egg-info
59ec3a
59ec3a
%files udev
75c452
%{_udevrulesdir}/66-azure-storage.rules
75c452
%{_udevrulesdir}/99-azure-product-uuid.rules
75c452
%dir %{_prefix}/lib/dracut/modules.d/%{dracut_modname_udev}
75c452
%{_prefix}/lib/dracut/modules.d/%{dracut_modname_udev}/*.sh
75c452
75c452
%files cvm
75c452
%{_sbindir}/tpm2-luks-import.sh
75c452
%{_udevrulesdir}/90-tpm2-import.rules
75c452
%dir %{_prefix}/lib/dracut/modules.d/%{dracut_modname_cvm}
75c452
%{_prefix}/lib/dracut/modules.d/%{dracut_modname_cvm}/*.sh
59ec3a
59ec3a
%if 0%{?with_legacy}
59ec3a
%files legacy
59ec3a
%{_sbindir}/waagent2.0
59ec3a
%endif
59ec3a
59ec3a
%changelog
75c452
* Wed Feb 08 2023 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-9
75c452
- wla-redhat-Adjust-tpm2_createprimary-key-attributes-to-m.patch [bz#2167322]
75c452
- Resolves: bz#2167322
75c452
  (Adjust TPM primary key creation parameters to match Azure)
75c452
75c452
* Mon Feb 06 2023 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-8
75c452
- wla-redhat-Explicitly-list-udev-rule-requirements-in-the.patch [bz#2165042]
75c452
- Resolves: bz#2165042
75c452
  ([9.0.z] /dev/disk/azure/ is created as symlink to sr0 or sda and not as a directory[Azure])
75c452
75c452
* Mon Jan 23 2023 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-7
75c452
- wla-redhat-Azure-CVM-specific-udev-rules.patch [bz#2162668]
75c452
- Resolves: bz#2162668
75c452
  (Add support for importing remotely sealed TPM2 objects)
1ff3d5
2acd00
* Mon Aug 29 2022 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-6
2acd00
- wla-redhat-Remove-files-inside-WALA-services-directory.patch [bz#2114768]
2acd00
- Resolves: bz#2114768
2acd00
  ([Azure][WALA][RHEL-9] When remove package some files left)
2acd00
2acd00
* Tue Aug 23 2022 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-5
2acd00
- wla-redhat-Mark-directories-properly-in-the-files-list.patch [bz#2114768]
2acd00
- Resolves: bz#2114768
2acd00
  ([Azure][WALA][RHEL-9] When remove package some files left)
2acd00
2acd00
* Wed Aug 17 2022 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-4
2acd00
- wla-redhat-Remove-all-waagent-unit-files-when-uninstalli.patch [bz#2114768]
2acd00
- Resolves: bz#2114768
2acd00
  ([Azure][WALA][RHEL-9] When remove package some files left)
2acd00
2acd00
* Mon Aug 08 2022 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-3
2acd00
- wla-redhat-Use-NetworkManager-to-set-DHCP-hostnames-on-r.patch [bz#2114830]
2acd00
- wla-Update-Log-Collector-default-in-Comments-and-Readme-.patch [bz#2093965]
2acd00
- Resolves: bz#2114830
2acd00
  ([Azure][WALA][RHEL-9.1] Provisioning failed if no ifcfg-eth0)
2acd00
- Resolves: bz#2093965
2acd00
  ([Azure][WALA][RHEL-9] The description of "Logs.Collect" is incorrect)
2acd00
2acd00
* Fri Jul 15 2022 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-2
2acd00
- wla-redhat-Fix-command-sequence-for-restarting-net-inter.patch [bz#2098233]
2acd00
- Resolves: bz#2098233
2acd00
  ([Azure][WALA][RHEL-9] [9.1] walinuxagent kills network during boot)
2acd00
2acd00
* Wed May 25 2022 Miroslav Rezanina <mrezanin@redhat.com> - 2.7.0.6-1
2acd00
- Rebase to 2.7.0.6-1 [bz#2083464]
2acd00
- Adding restart_if implementation for RHEL [bz#2081944]
2acd00
- Resolves: bz#2083464
2acd00
  ([Azure][RHEL-9]Rebase WALinuxAgent to v2.7.0.6)
2acd00
- Resolves: bz#2081944
2acd00
  ([Azure][WALA][9.0] WALA provisions VM failed because of no "ifdown")
a85d1c
59ec3a
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.3.0.2-3
59ec3a
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
59ec3a
  Related: rhbz#1991688
59ec3a
59ec3a
* Sun Jul 25 2021 Miroslav Rezanina <mrezanin@redhat.com> - 2.3.0.2-2
59ec3a
- wala-Require-iptables-package.patch [bz#1978572]
59ec3a
- Resolves: bz#1978572
59ec3a
  ([Azure][WALA][RHEL-9] WALA needs iptables package)
59ec3a
59ec3a
* Thu Jun 24 2021 Miroslav Rezanina <mrezanin@redhat.com> - 2.3.0.2-1
59ec3a
- Rebase to 2.3.0.2 [bz#1972101]
59ec3a
- Resolves: bz#1972101
59ec3a
  ([Azure][RHEL-9]Rebase WALinuxAgent to 2.3.0.2)
59ec3a
59ec3a
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 2.2.52-6
59ec3a
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
59ec3a
59ec3a
* Fri Feb 19 2021 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.52-5
59ec3a
- Require ntfsprogs on Fedora only
59ec3a
59ec3a
* Tue Jan 26 2021 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.52-4
59ec3a
- Fix distro resolution for RedHat
59ec3a
59ec3a
* Mon Jan 25 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.52-3
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
59ec3a
59ec3a
* Fri Jan 15 2021 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.52-2
59ec3a
- Add udev rules to initramfs (#1909287)
59ec3a
59ec3a
* Wed Dec 09 2020 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.52-1
59ec3a
- Update to 2.2.52 (#1849923)
59ec3a
- Add not yet upstream patches supporting Python3.9 changes
59ec3a
59ec3a
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.48.1-2
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
59ec3a
59ec3a
* Tue Jun 09 2020 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.48.1-1
59ec3a
- Update to 2.2.48.1 (#1641605)
59ec3a
- Split udev rules to a separate subpackage (#1748432)
59ec3a
59ec3a
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.2.46-2
59ec3a
- Rebuilt for Python 3.9
59ec3a
59ec3a
* Wed Apr 15 2020 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.46-1
59ec3a
- Update to 2.2.46
59ec3a
59ec3a
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.40-7
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
59ec3a
59ec3a
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.40-6
59ec3a
- Rebuilt for Python 3.8.0rc1 (#1748018)
59ec3a
59ec3a
* Wed Aug 21 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.40-5
59ec3a
- Rebuilt for Python 3.8
59ec3a
59ec3a
* Wed Aug 21 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.40-4
59ec3a
- Disable Python2 dependent 'legacy' subpackage (#1741029)
59ec3a
59ec3a
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.2.40-3
59ec3a
- Rebuilt for Python 3.8
59ec3a
59ec3a
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.40-2
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
59ec3a
59ec3a
* Mon Jun 03 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.40-1
59ec3a
- Update to 2.2.40
59ec3a
- Fix FTBFS in the preparation for Python3.8 (#1705219)
59ec3a
59ec3a
* Thu Mar 14 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.38-1
59ec3a
- Update to 2.2.38 (CVE-2019-0804)
59ec3a
59ec3a
* Thu Mar 14 2019 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.37-1
59ec3a
- Update to 2.2.37
59ec3a
59ec3a
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.32-2
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
59ec3a
59ec3a
* Thu Sep 20 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.32-1
59ec3a
- Update to 2.2.32.2
59ec3a
59ec3a
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.25-4
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
59ec3a
59ec3a
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.25-3
59ec3a
- Rebuilt for Python 3.7
59ec3a
59ec3a
* Wed Apr 25 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.25-2
59ec3a
- Move net-tools dependency to WALinuxAgent-legacy (#1106781)
59ec3a
59ec3a
* Mon Apr 16 2018 Vitaly Kuznetsov <vkuznets@redhat.com> - 2.2.25-1
59ec3a
- Update to 2.2.25
59ec3a
- Switch to Python3
59ec3a
- Legacy subpackage with waagent2.0 supporting old extensions
59ec3a
59ec3a
* Wed Feb 28 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.18-5
59ec3a
- Update Python 2 dependency declarations to new packaging standards
59ec3a
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
59ec3a
59ec3a
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.18-4
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
59ec3a
59ec3a
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.18-3
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
59ec3a
59ec3a
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.18-2
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
59ec3a
59ec3a
* Sat Apr 02 2016 Scott K Logan <logans@cottsay.net> - 2.0.18-1
59ec3a
- Update to 2.0.18
59ec3a
59ec3a
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.14-2
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
59ec3a
59ec3a
* Thu Jul 02 2015 Scott K Logan <logans@cottsay.net> - 2.0.14-1
59ec3a
- Update to 2.0.14
59ec3a
59ec3a
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.13-2
59ec3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
59ec3a
59ec3a
* Mon Jun 01 2015 Scott K Logan <logans@cottsay.net> - 2.0.13-1
59ec3a
- Update to 2.0.13
59ec3a
59ec3a
* Thu Apr 02 2015 Scott K Logan <logans@cottsay.net> - 2.0.12-1
59ec3a
- Update to 2.0.12-Oracle
59ec3a
59ec3a
* Sat Jan 10 2015 Scott K Logan <logans@cottsay.net> - 2.0.11-2
59ec3a
- Use systemd for rhel7
59ec3a
- Own logrotate.d
59ec3a
- Fix python2-devel dep
59ec3a
59ec3a
* Sat Dec 20 2014 Scott K Logan <logans@cottsay.net> - 2.0.11-1
59ec3a
- Initial package