Blame SPECS/WALinuxAgent.spec

2c704c
2c704c
%if 0%{?fedora}
2c704c
%global distro fedora
2c704c
%global initsys systemd
2c704c
%else
2c704c
%if 0%{?rhel}
2c704c
%global distro redhat
2c704c
%if 0%{?rhel} < 7
2c704c
%global initsys sysV
2c704c
%else
2c704c
%global initsys systemd
2c704c
%endif
2c704c
%{!?__python2: %global __python2 /usr/bin/python2}
2c704c
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
2c704c
%endif
2c704c
%endif
2c704c
2c704c
Name:           WALinuxAgent
2c704c
Version:        2.0.13
2c704c
Release:        1%{?dist}
2c704c
Summary:        The Windows Azure Linux Agent
2c704c
2c704c
Group:          System Environment/Daemons
2c704c
License:        ASL 2.0
2c704c
URL:            https://github.com/Azure/%{name}
2c704c
Source0: 	https://github.com/Azure/%{name}/archive/%{name}-%{name}-%{version}.tar.gz
2c704c
# Redhat-specific patch (not submitted upstream)
2c704c
Patch0:         %{name}-2.0.8-logrotate-name.patch
2c704c
2c704c
BuildArch:      noarch
2c704c
2c704c
BuildRequires:  python2-devel
2c704c
BuildRequires:  python-setuptools
2c704c
Requires:       net-tools
2c704c
# Requires:       ntfsprogs
2c704c
Requires:       openssh
2c704c
Requires:       openssh-server
2c704c
Requires:       openssl
2c704c
Requires:       parted
2c704c
Requires:       python-pyasn1
2c704c
2c704c
%if 0%{?rhel} && 0%{?rhel} < 7
2c704c
Conflicts:      NetworkManager
2c704c
%endif
2c704c
2c704c
%if %{initsys} == systemd
2c704c
BuildRequires:   systemd
2c704c
Requires(post):  systemd
2c704c
Requires(preun): systemd
2c704c
Requires(postun): systemd
2c704c
%else
2c704c
%if %{initsys} == sysv
2c704c
Requires(post):  chkconfig
2c704c
Requires(preun): chkconfig
2c704c
Requires(preun): initscripts
2c704c
Requires(postun): initscripts
2c704c
%endif
2c704c
%endif
2c704c
2c704c
%description
2c704c
The Windows Azure Linux Agent supports the provisioning and running of Linux
2c704c
VMs in the Windows Azure cloud. This package should be installed on Linux disk
2c704c
images that are built to run in the Windows Azure environment.
2c704c
2c704c
%prep
2c704c
%setup -qn %{name}-%{name}-%{version}
2c704c
%patch0 -p1
2c704c
2c704c
chmod 0755 distro/redhat/waagent.sysV
2c704c
2c704c
%build
2c704c
%{__python2} setup.py build
2c704c
2c704c
%install
2c704c
%{__python2} setup.py install --skip-build --root %{buildroot} --lnx-distro '%{distro}' --init-system '%{initsys}'
2c704c
2c704c
mkdir -p -m 0700 %{buildroot}%{_sharedstatedir}/waagent
2c704c
mkdir -p %{buildroot}%{_localstatedir}/log
2c704c
touch %{buildroot}%{_localstatedir}/log/waagent.log
2c704c
2c704c
%post
2c704c
%if %{initsys} == systemd
2c704c
%systemd_post waagent.service
2c704c
%else
2c704c
%if %{initsys} == sysV
2c704c
/sbin/chkconfig --add waagent
2c704c
%endif
2c704c
%endif
2c704c
2c704c
%preun
2c704c
%if %{initsys} == systemd
2c704c
%systemd_preun waagent.service
2c704c
%else
2c704c
%if %{initsys} == sysV
2c704c
if [ $1 = 0 ]; then
2c704c
        /sbin/service waagent stop >/dev/null 2>&1
2c704c
        /sbin/chkconfig --del waagent
2c704c
fi
2c704c
%endif
2c704c
%endif
2c704c
2c704c
%postun
2c704c
%if %{initsys} == systemd
2c704c
%systemd_postun_with_restart waagent.service
2c704c
%else
2c704c
%if %{initsys} == sysV
2c704c
if [ "$1" -ge "1" ]; then
2c704c
        /sbin/service waagent restart >/dev/null 2>&1 || :
2c704c
fi
2c704c
%endif
2c704c
%endif
2c704c
2c704c
%files
2c704c
%doc Changelog LICENSE-2.0.txt NOTICE README
2c704c
%ghost %{_localstatedir}/log/waagent.log
2c704c
%dir %attr(0700, root, root) %{_sharedstatedir}/waagent
2c704c
%config(noreplace) %{_sysconfdir}/logrotate.d
2c704c
%{_sbindir}/waagent
2c704c
%config(noreplace) %{_sysconfdir}/waagent.conf
2c704c
%{_sysconfdir}/udev/rules.d/99-azure-product-uuid.rules
2c704c
2c704c
%if %{initsys} == systemd
2c704c
%{_unitdir}/waagent.service
2c704c
%else
2c704c
%{_initddir}/waagent
2c704c
%endif
2c704c
2c704c
%changelog
2c704c
* Mon Jun 01 2015 Dave Anderson <anderson@redhat.com> - 2.0.13-1
2c704c
- Update to upstream 2.0.13 package.
2c704c
- Remove global commit md5sum and fix Source0 to point to correct location.
2c704c
- Fix setup to deal with "WALinuxAgent-WALinuxAgent" naming scheme
2c704c
- Added files reference for /udev/rules.d/99-azure-product-uuid.rules
2c704c
2c704c
* Thu May 07 2015 Dave Anderson <anderson@redhat.com> - 2.0.11-3
2c704c
- Remove Requires: ntfsprogs for RHEL7
2c704c
2c704c
* Sat Jan 10 2015 Scott K Logan <logans@cottsay.net> - 2.0.11-2
2c704c
- Use systemd for rhel7
2c704c
- Own logrotate.d
2c704c
- Fix python2-devel dep
2c704c
2c704c
* Sat Dec 20 2014 Scott K Logan <logans@cottsay.net> - 2.0.11-1
2c704c
- Initial package