first stab at splitting into 2 packages nodemanager-lib and nodemanager-vs
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 25 Jun 2012 12:51:55 +0000 (14:51 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 25 Jun 2012 12:51:55 +0000 (14:51 +0200)
we have nodemanager-vs Obsolete'ing NodeManager for hopefully smooth transition

Makefile
README
bwmon.py
nodemanager-lib.spec [moved from NodeManager.spec with 97% similarity]
nodemanager-vs.spec [new file with mode: 0644]
setup-lib.py [moved from setup.py with 97% similarity]
setup-vs.py [new file with mode: 0644]

index c9e0d91..e17e263 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,29 +5,38 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: Makefile,v 1.2 2006/11/13 20:04:44 mlhuang Exp $
-#
 
 # autoconf compatible variables
 datadir := /usr/share
 bindir := /usr/bin
 
-all: forward_api_calls
-       python setup.py build
+lib: forward_api_calls
+       python setup-lib.py build
+
+vs: 
+       python setup-vs.py build
 
 forward_api_calls: forward_api_calls.c
        $(CC) -Wall -Os -o $@ $?
        strip $@
 
-install:
-       python setup.py install \
+install-lib:
+       python setup-lib.py install \
+           --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
+           --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
+           --install-scripts=$(DESTDIR)/$(bindir)
+       install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
+
+install-vs:
+       python setup-vs.py install \
            --install-purelib=$(DESTDIR)/$(datadir)/NodeManager \
            --install-platlib=$(DESTDIR)/$(datadir)/NodeManager \
            --install-scripts=$(DESTDIR)/$(bindir)
        install -m 444 README $(DESTDIR)/$(datadir)/NodeManager
 
 clean:
-       python setup.py clean
+       python setup-lib.py clean
+       python setup-vs.py clean
        rm -f forward_api_calls *.pyc build
 
 .PHONY: all install clean
diff --git a/README b/README
index c6233eb..d5188bc 100644 (file)
--- a/README
+++ b/README
@@ -1,6 +1,3 @@
-# $Id$
-# $HeadURL$
-
 The PlanetLab NodeManager manages all aspects of PlanetLab node and slice management once the node has been initialized and configured by the Boot Manager. It periodically contacts its management authority for configuration updates. It provides an XML-RPC API for performing local operations on slices.
 
 Copyright 2008 Princeton University
index affa092..26bf9e3 100644 (file)
--- a/bwmon.py
+++ b/bwmon.py
@@ -496,6 +496,9 @@ def sync(nmdbcopy):
     if default_MaxRate == -1:
         default_MaxRate = 1000000
 
+    # xxx $Id$ 
+    # with svn we used to have a trick to detect upgrades of this file
+    # this has gone with the move to git, without any noticeable effect on operations though
     try:
         f = open(DB_FILE, "r+")
         logger.verbose("bwmon: Loading %s" % DB_FILE)
similarity index 97%
rename from NodeManager.spec
rename to nodemanager-lib.spec
index a9fe8e8..e20acd6 100644 (file)
@@ -1,12 +1,12 @@
 %define slicefamily %{pldistro}-%{distroname}-%{_arch}
 
-%define name NodeManager
+%define name nodemanager-lib
 %define version 2.0
 %define taglevel 37
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 
-Summary: PlanetLab Node Manager
+Summary: PlanetLab Node Manager Library
 Name: %{name}
 Version: %{version}
 Release: %{release}
@@ -23,24 +23,16 @@ URL: %{SCMURL}
 # not possible because of forward_api_calls
 #BuildArch: noarch
 
-# old name
-#Obsoletes: sidewinder, sidewinder-common
-
 # Uses function decorators
 Requires: python >= 2.4
 # connecting PLC
 Requires: python-pycurl
 # Signed tickets
 Requires: gnupg
-# vserver-sliceimage or lxc-sliceimage to be added explicitly in nodeimage.pkgs
-# we do need the slice images in any case
-Requires: sliceimage-%{slicefamily}
-# our interface to the vserver patch
-Requires: util-vserver >= 0.30.208-17
-# vserver.py
-Requires: util-vserver-python > 0.3-16
 # sioc/plnet
 Requires: pyplnet >= 4.3
+# we do need the slice images in any case
+Requires: sliceimage-%{slicefamily}
 
 %description
 The PlanetLab Node Manager manages all aspects of PlanetLab node and
@@ -48,18 +40,20 @@ slice management once the node has been initialized and configured by
 the Boot Manager. It periodically contacts its management authority
 for configuration updates. It provides an XML-RPC API for performing
 local operations on slices.
+nodemanager-lib only provides a skeleton and needs as a companion
+either nodemanager-vs or nodemanager-lxc
 
 %prep
 %setup -q
 
 %build
 # make manages the C and Python stuff
-%{__make} %{?_smp_mflags}
+%{__make} %{?_smp_mflags} lib
 
 %install
 # make manages the C and Python stuff
 rm -rf $RPM_BUILD_ROOT
-%{__make} %{?_smp_mflags} install DESTDIR="$RPM_BUILD_ROOT"
+%{__make} %{?_smp_mflags} install-lib DESTDIR="$RPM_BUILD_ROOT"
 
 # install the sliver initscript (that triggers the slice initscript if any)
 mkdir -p $RPM_BUILD_ROOT/usr/share/NodeManager/sliver-initscripts/
diff --git a/nodemanager-vs.spec b/nodemanager-vs.spec
new file mode 100644 (file)
index 0000000..514349b
--- /dev/null
@@ -0,0 +1,60 @@
+# we define this in a separate specfile because we cannot produce all the 3 packages
+# nodemanager-lib nodemanager-vs nodemanager-vs in a single build
+
+%define slicefamily %{pldistro}-%{distroname}-%{_arch}
+
+%define name nodemanager-vs
+%define version 2.0
+%define taglevel 37
+
+%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+
+Summary: PlanetLab Node Manager Plugin for vserver nodes
+Name: %{name}
+Version: %{version}
+Release: %{release}
+License: PlanetLab
+Group: System Environment/Daemons
+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}
+
+# old name, when all came as a single package with vserver wired in
+Obsoletes: NodeManager
+
+# Uses function decorators
+Requires: nodemanager-lib
+# vserver-sliceimage or lxc-sliceimage to be added explicitly in nodeimage.pkgs
+Requires: vserver-sliceimage
+# our interface to the vserver patch
+Requires: util-vserver >= 0.30.208-17
+# vserver.py
+Requires: util-vserver-python > 0.3-16
+
+%description
+nodemanager-vs provides the vserver code for the PlanetLab Node Manager.
+
+%prep
+%setup -q
+
+%build
+# make manages the C and Python stuff
+%{__make} %{?_smp_mflags} vs
+
+%install
+# make manages the C and Python stuff
+rm -rf $RPM_BUILD_ROOT
+%{__make} %{?_smp_mflags} install-vs DESTDIR="$RPM_BUILD_ROOT"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{_datadir}/NodeManager/
+
+%changelog
similarity index 97%
rename from setup.py
rename to setup-lib.py
index a3e93f6..fb7790d 100644 (file)
--- a/setup.py
@@ -27,7 +27,6 @@ setup(
         'nodemanager',
         'plcapi',
         'safexmlrpc',
-        'sliver_vs',
         'slivermanager',
         'ticket',
         'tools',
diff --git a/setup-vs.py b/setup-vs.py
new file mode 100644 (file)
index 0000000..a2032dc
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Setup script for the Node Manager application
+#
+# Mark Huang <mlhuang@cs.princeton.edu>
+# Copyright (C) 2006 The Trustees of Princeton University
+#
+
+from distutils.core import setup, Extension
+
+setup(
+    py_modules=[
+        'sliver_vs',
+        ],
+    scripts = [
+        ],
+    packages =[
+        ],
+    )