a single package name (plnode-utils) but 2 ways to build it (2 specfiles)
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 18 Jul 2012 11:00:58 +0000 (13:00 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 18 Jul 2012 11:00:58 +0000 (13:00 +0200)
bwlimit_lxc.py [moved from bwlimitlxc.py with 100% similarity]
bwlimit_vs.py [moved from bwlimit.py with 100% similarity]
plnode-utils-lxc.spec [new file with mode: 0644]
plnode-utils-vs.spec [moved from plnode-utils.spec with 63% similarity]
setup.py

similarity index 100%
rename from bwlimitlxc.py
rename to bwlimit_lxc.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 (file)
index 0000000..aed7c12
--- /dev/null
@@ -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 <support@planet-lab.org>
+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
similarity index 63%
rename from plnode-utils.spec
rename to plnode-utils-vs.spec
index d6c8efc..ac40a87 100644 (file)
@@ -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 <support@planet-lab.org>
 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
index 9d73cff..a4eb86d 100755 (executable)
--- 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)