diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 9b8bd21..e572ba4 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,3 +1,5 @@ +%global with_legacy 1 + Name: WALinuxAgent Version: 2.2.32 Release: 1%{?dist} @@ -29,6 +31,7 @@ The Microsoft Azure Linux Agent supports the provisioning and running of Linux VMs in the Microsoft Azure cloud. This package should be installed on Linux disk images that are built to run in the Microsoft Azure environment. +%if 0%{?with_legacy} %package legacy Summary: The Microsoft Azure Linux Agent (legacy) Group: System Environment/Daemons @@ -38,6 +41,7 @@ Requires: net-tools %description legacy The Microsoft Azure Linux Agent supporting old version of extensions. +%endif %prep %setup -q @@ -60,7 +64,11 @@ rm -rf %{buildroot}/%{python3_sitelib}/__main__.py rm -rf %{buildroot}/%{python3_sitelib}/__pycache__/__main__*.py* sed -i 's,#!/usr/bin/env python,#!/usr/bin/python3,' %{buildroot}%{_sbindir}/waagent +%if 0%{?with_legacy} sed -i 's,#!/usr/bin/env python,#!/usr/bin/python2,' %{buildroot}%{_sbindir}/waagent2.0 +%else +rm -f %{buildroot}%{_sbindir}/waagent2.0 +%endif sed -i 's,/usr/bin/python ,/usr/bin/python3 ,' %{buildroot}%{_unitdir}/waagent.service mv %{buildroot}%{_sysconfdir}/logrotate.d/waagent.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} @@ -87,8 +95,10 @@ mv %{buildroot}%{_sysconfdir}/logrotate.d/waagent.logrotate %{buildroot}%{_sysco %{python3_sitelib}/azurelinuxagent %{python3_sitelib}/*.egg-info +%if 0%{?with_legacy} %files legacy %{_sbindir}/waagent2.0 +%endif %changelog * Thu Sep 20 2018 Vitaly Kuznetsov - 2.2.32-1