#=============================================================================== # Name: walinuxagent.spec #------------------------------------------------------------------------------- # Purpose : RPM Spec file for Python script packaging # Version : 2.0.8 # Created : April 20 2012 #=============================================================================== Name: WALinuxAgent Summary: The Windows Azure Linux Agent Version: 2.0.8 Release: 6%{?dist} License: ASL 2.0 Group: System Environment/Daemons Url: http://go.microsoft.com/fwlink/?LinkId=250998 Source0: https://github.com/Azure/%{name}/archive/%{name}-%{version}.tar.gz BuildRequires: python python-setuptools Requires: python python-pyasn1 openssh openssl util-linux sed grep sudo iptables net-tools BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Vendor: Microsoft Corporation Packager: Microsoft Corporation # Already merged upstream Patch0: WALinuxAgent-2.0.8-support-fedora.patch # Fedora-specific patch (not submitted upstream) Patch1: WALinuxAgent-2.0.8-logrotate-name.patch %if 0%{?rhel} && 0%{?rhel} < 7 Conflicts: NetworkManager %endif %if 0%{?fedora} %define initsys systemd %define distro fedora BuildRequires: systemd Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %else %define distro redhat %define initsys sysV %endif %description The Windows Azure Linux Agent supports the provisioning and running of Linux VMs in the Windows Azure cloud. This package should be installed on Linux disk images that are built to run in the Windows Azure environment. %prep %setup -qn %{name}-%{name}-%{version} %patch0 -p1 %patch1 -p1 find . -type f -exec sed -i 's/\r//' {} + find . -type f -exec chmod 0644 {} + %build # Nothing to do %install %{__python} setup.py install --prefix=%{_prefix} --lnx-distro='%{distro}' --init-system='%{initsys}' --root=%{buildroot} mkdir -p %{buildroot}/%{_localstatedir}/log mkdir -p -m 0700 %{buildroot}/%{_sharedstatedir}/waagent touch %{buildroot}/%{_localstatedir}/log/waagent.log %if %{initsys} == systemd %post %systemd_post waagent.service # Tests run for informational purposes only %preun %systemd_preun waagent.service %postun %systemd_postun_with_restart waagent.service %else %post /sbin/chkconfig --add waagent %preun -p /bin/sh if [ $1 = 0 ]; then /sbin/service waagent stop >/dev/null 2>&1 /sbin/chkconfig --del waagent fi %postun -p /bin/sh if [ "$1" -ge "1" ]; then /sbin/service waagent restart >/dev/null 2>&1 || : fi %endif %files %if "%{initsys}" == "systemd" %attr(0644,root,root) %{_unitdir}/waagent.service %else %attr(0755,root,root) %{_initddir}/waagent %endif %defattr(0644,root,root,0755) %doc Changelog LICENSE-2.0.txt NOTICE README %attr(0755,root,root) %{_sbindir}/waagent %config(noreplace) %{_sysconfdir}/logrotate.d/WALinuxAgent %config %{_sysconfdir}/waagent.conf %ghost %{_localstatedir}/log/waagent.log %dir %attr(0700, root, root) %{_sharedstatedir}/waagent %changelog * Sat Oct 25 2014 Scott K Logan - 2.0.8-6 - Update version to 2.0.8 for release - Fedora-specific spec modifications * Thu Sep 18 2014 Microsoft Corporation - Remove NetworkManager conflict for EL7+ * Tue Mar 25 2014 Microsoft Corporation - Create directory /var/lib/waagent - Updated version to 2.0.4 for release * Thu Jan 16 2014 Microsoft Corporation - Updated version to 2.0.3 for release * Wed Dec 18 2013 Microsoft Corporation - Updated version to 2.0.2 for release * Tue Nov 05 2013 Microsoft Corporation - Updated version to 2.0.1 for release * Fri Sep 20 2013 Microsoft Corporation - Updated version to 2.0.0 for release * Fri Aug 23 2013 Microsoft Corporation - Updated version to 1.4.0 for release * Thu May 30 2013 Microsoft Corporation - Updated version to 1.3.3 for release * Tue Feb 26 2013 Microsoft Corporation - Updated version to 1.3.2 for release * Fri Feb 15 2013 Microsoft Corporation - Updated version to 1.3.1 for release * Fri Jan 18 2013 Microsoft Corporation - Updated version to 1.3 for release * Fri Dec 07 2012 Microsoft Corporation - Updated version to 1.2 for release * Fri Nov 09 2012 Microsoft Corporation - Added README and Changelog - Updated version to 1.1 for release * Thu May 17 2012 Microsoft Corporation - Initial WALinuxAgent packages.