Blame SPECS/WALinuxAgent.spec

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