Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

# The package contains python code in /usr/share that is not executed on
# the machine where it is installed. Instead, it is distributed to its
# slaves to be executed there. To exclude these modules from the automatic
# byte compilation, we turn off the global byte-compile script here and
# compile the rest of the code manually.
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

# Macros for manual byte-compilation of python modules
%include %{_rpmconfigdir}/macros.python

Name:       lnst
Version:    1
Release:    2%{?dist}
Summary:    Common code for lnst-ctl and lnst-slave
Requires:   python2, python-lxml, python-pyroute2, bzip2

License:    GPLv2+
URL:        http://lnst-project.org
Source0:    http://lnst-project.org/files/%{name}-%{version}.tar.gz

BuildRequires:    python2-devel, systemd-units
BuildArch:        noarch


%package ctl
Summary:    Linux Network Stack Test Controller
Requires:   %{name} = %{version}-%{release}


%package slave
Summary:           Linux Network Stack Test Slave Daemon
Requires:          %{name} = %{version}-%{release}
Requires(post):    systemd
Requires(preun):   systemd
Requires(postun):  systemd

%description
Linux Network Stack Test is a tool useful for developing and performing
automated network tests. LNST focuses on maximum portability of the
so-called recipes (descriptions of test cases and scenarios).

This package contains the code that is common for both LNST controller
and LNST slave.

%description ctl
LNST controller is able to communicate with networks of LNST slave
daemons and execute tests on them.

%description slave
LNST slave is a daemon that waits for instructions from LNST controller.
It is able to react to a variety of commands from the controller and act
as a test node for executing network tests.


%prep
%setup -q -n %{name}-%{version}


%build
%{__python} setup.py build


%install
%{__python} setup.py install --root=%{buildroot}
install -D -m 0644 dist/%{name}-slave.service %{buildroot}/%{_unitdir}/%{name}-slave.service

# Manually compile files in python sitelib that need bytecompilation
%py_comp  %{buildroot}%{python_sitelib}
%py_ocomp %{buildroot}%{python_sitelib}

%post slave
%systemd_post lnst-slave.service

%preun slave
%systemd_preun lnst-slave.service

%postun slave
%systemd_postun_with_restart lnst-slave.service

%files
%doc README.md COPYING
%dir %{python_sitelib}/%{name}/
%{python_sitelib}/%{name}/__init__.*
%{python_sitelib}/%{name}/Common/
%{python_sitelib}/%{name}-%{version}-py2.7.egg-info

%files ctl
%{python_sitelib}/%{name}/Controller/
%{_bindir}/%{name}-ctl
%{_mandir}/man1/%{name}-ctl.1.*
%{_sysconfdir}/bash_completion.d/%{name}-ctl.bash
%config(noreplace) %{_sysconfdir}/%{name}-ctl.conf
%{_datadir}/%{name}/

%files slave
%{python_sitelib}/%{name}/Slave/
%{_bindir}/%{name}-slave
%{_mandir}/man1/%{name}-slave.1.*
%{_sysconfdir}/bash_completion.d/%{name}-slave.bash
%config(noreplace) %{_sysconfdir}/%{name}-slave.conf
%{_unitdir}/%{name}-slave.service

%changelog
* Thu Oct 10 2013 Radek Pazdera <rpazdera@redhat.com> - 1-2
- Fixing accidentally removed dist tag

* Thu Oct 10 2013 Radek Pazdera <rpazdera@redhat.com> - 1-1
- Updating to stable release 1
- Added new dependencies (python2-pyroute, python-lxml, bzip2)
- Fixed bogus date warnings in changelog

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1-0.7.20130717git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Jul 17 2013 Radek Pazdera <rpazdera@redhat.com> - 0.1-0.6.20130717git
- Update to commit 269de0a

* Wed Feb 06 2013 Radek Pazdera <rpazdera@redhat.com> - 0.1-0.5.20130206git
- Update to commit f901a34

* Tue Jan 15 2013 Radek Pazdera <rpazdera@redhat.com> - 0.1-0.4.20121204git
- removed -common subpackage, its content was moved to the base package
- fixed release number to meet the conventions for pre-release packages
- fixed inaccurate license

* Thu Jan 10 2013 Radek Pazdera <rpazdera@redhat.com> - 0.1-0.3.20121204git
- removed dependency on python3-devel for python bytecompile macros
- use py_copmp and py_ocomp macros from macros.python instead

* Thu Jan 03 2013 Radek Pazdera <rpazdera@redhat.com> - 0.1-0.2.20121204git
- Added a comment explaining disabling global byte-compile
- Removed superfluous dependency on python runtime
- Fixed a problem with unowned directories
- Man pages are now included by a wild-card
- Added proper systemd service handling

* Tue Dec 04 2012 Radek Pazdera <rpazdera@redhat.com> - 0.1-0.1.20121204git
- Initial package