diff --git a/WALinuxAgent.spec b/WALinuxAgent.spec index 8ddca10..6082ea7 100644 --- a/WALinuxAgent.spec +++ b/WALinuxAgent.spec @@ -1,21 +1,7 @@ %global commit 5bb9df7f2f485dbd5be057bbb657afe54bc1bf1b -%if 0%{?fedora} %global distro fedora %global initsys systemd -%else -%if 0%{?rhel} -%global distro redhat -%if 0%{?rhel} < 7 -%global initsys sysV -%{!?_udevrulesdir: %global _udevrulesdir /lib/udev/rules.d} -%else -%global initsys systemd -%endif -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif -%endif Name: WALinuxAgent Version: 2.0.18 @@ -41,23 +27,10 @@ Requires: openssl Requires: parted Requires: python2-pyasn1 -%if 0%{?rhel} && 0%{?rhel} < 7 -Conflicts: NetworkManager -%endif - -%if %{initsys} == systemd BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd -%else -%if %{initsys} == sysv -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(preun): initscripts -Requires(postun): initscripts -%endif -%endif %description The Microsoft Azure Linux Agent supports the provisioning and running of Linux @@ -68,8 +41,6 @@ images that are built to run in the Microsoft Azure environment. %setup -qn %{name}-%{commit} %patch0 -p1 -chmod 0755 distro/redhat/waagent.sysV - %build %{__python2} setup.py build @@ -84,36 +55,13 @@ mkdir -p %{buildroot}%{_udevrulesdir} mv %{buildroot}%{_sysconfdir}/udev/rules.d/99-azure-product-uuid.rules %{buildroot}%{_udevrulesdir}/99-azure-product-uuid.rules %post -%if %{initsys} == systemd %systemd_post waagent.service -%else -%if %{initsys} == sysV -/sbin/chkconfig --add waagent -%endif -%endif %preun -%if %{initsys} == systemd %systemd_preun waagent.service -%else -%if %{initsys} == sysV -if [ $1 = 0 ]; then - /sbin/service waagent stop >/dev/null 2>&1 - /sbin/chkconfig --del waagent -fi -%endif -%endif %postun -%if %{initsys} == systemd %systemd_postun_with_restart waagent.service -%else -%if %{initsys} == sysV -if [ "$1" -ge "1" ]; then - /sbin/service waagent restart >/dev/null 2>&1 || : -fi -%endif -%endif %files %doc Changelog LICENSE-2.0.txt NOTICE README @@ -123,12 +71,7 @@ fi %{_sbindir}/waagent %config(noreplace) %{_sysconfdir}/waagent.conf %{_udevrulesdir}/99-azure-product-uuid.rules - -%if %{initsys} == systemd %{_unitdir}/waagent.service -%else -%{_initddir}/waagent -%endif %changelog * Wed Feb 28 2018 Iryna Shcherbina - 2.0.18-5