From a763f46c558a14a0b0be5cae6deb633cef64685e Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 18 Jul 2012 13:00:58 +0200 Subject: [PATCH] a single package name (plnode-utils) but 2 ways to build it (2 specfiles) --- bwlimitlxc.py => bwlimit_lxc.py | 0 bwlimit.py => bwlimit_vs.py | 0 plnode-utils-lxc.spec | 45 +++++++++++++++++++++++ plnode-utils.spec => plnode-utils-vs.spec | 9 ++++- setup.py | 13 +++---- 5 files changed, 58 insertions(+), 9 deletions(-) rename bwlimitlxc.py => bwlimit_lxc.py (100%) rename bwlimit.py => bwlimit_vs.py (100%) create mode 100644 plnode-utils-lxc.spec rename plnode-utils.spec => plnode-utils-vs.spec (63%) diff --git a/bwlimitlxc.py b/bwlimit_lxc.py similarity index 100% rename from bwlimitlxc.py rename to bwlimit_lxc.py diff --git a/bwlimit.py b/bwlimit_vs.py similarity index 100% rename from bwlimit.py rename to bwlimit_vs.py diff --git a/plnode-utils-lxc.spec b/plnode-utils-lxc.spec new file mode 100644 index 0000000..aed7c12 --- /dev/null +++ b/plnode-utils-lxc.spec @@ -0,0 +1,45 @@ +%define name plnode-utils +%define version 0.2 +%define taglevel 1 + +%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} + +Summary: Python utilities for a PlanetLab node +Name: %{name} +Version: %{version} +Release: %{release} +License: PlanetLab +Group: System Environment/Libraries +Source0: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +Vendor: PlanetLab +Packager: PlanetLab Central +Distribution: PlanetLab %{plrelease} +URL: %{SCMURL} + +Provides: bwlimit + +%description +This python package provides utilities like bwlimit, used in various places on a PlanetLab node, nodemanager and mom among others. It aims at cleaning up the packaging scheme, as bwlimit used to ship with util-vserver-pl, but is relevant in the lxc variant as well. + +%prep +%setup -q + +%build +# xxx fixme +# this is where we chose which flavour of bwlimit gets shipped +cp bwlimit_lxc.py bwlimit.py +python setup.py build + +%install +python setup.py install --skip-build --root "$RPM_BUILD_ROOT" + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{python_sitelib}/* +%{_bindir} + +%changelog diff --git a/plnode-utils.spec b/plnode-utils-vs.spec similarity index 63% rename from plnode-utils.spec rename to plnode-utils-vs.spec index d6c8efc..ac40a87 100644 --- a/plnode-utils.spec +++ b/plnode-utils-vs.spec @@ -1,5 +1,5 @@ %define name plnode-utils -%define version 0.1 +%define version 0.2 %define taglevel 1 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -18,13 +18,18 @@ Packager: PlanetLab Central Distribution: PlanetLab %{plrelease} URL: %{SCMURL} +Provides: bwlimit + %description -This package provides the plnode_utils python package that provides utilities used in various places on a PlanetLab node, nodemanager among others +This python package provides utilities like bwlimit, used in various places on a PlanetLab node, nodemanager and mom among others. It aims at cleaning up the packaging scheme, as bwlimit used to ship with util-vserver-pl, but is relevant in the lxc variant as well. %prep %setup -q %build +# xxx fixme +# this is where we chose which flavour of bwlimit gets shipped +cp bwlimit_vs.py bwlimit.py python setup.py build %install diff --git a/setup.py b/setup.py index 9d73cff..a4eb86d 100755 --- a/setup.py +++ b/setup.py @@ -1,9 +1,5 @@ #!/usr/bin/python -""" -Installation script for the sfa module -""" - import sys, os, os.path from glob import glob import shutil @@ -11,7 +7,10 @@ from distutils.core import setup scripts = [ "bwlimit" ] -setup(name='plnode_utils', - package_dir={'plnode_utils':''}, - packages='', +# xxx fixme +# for now we only have bwlimit.py and its flavour is selected in the main specfile +# that copies the right bwlimit_xxx.py into bwlimit.py +setup(name='plnode', + package_dir={'plnode':'.'}, + py_modules = [ 'bwlimit' ] , scripts = scripts) -- 2.43.0