From: Steve Muir Date: Wed, 25 May 2005 17:57:19 +0000 (+0000) Subject: Build a Python modules RPM X-Git-Tag: after-util-vserver-0_30_208-revert~186 X-Git-Url: http://git.onelab.eu/?p=util-vserver.git;a=commitdiff_plain;h=29801869a74062059e4980385d3dc37dd5beec50 Build a Python modules RPM --- diff --git a/python/Makefile b/python/Makefile index e1b8252..2c8d28b 100644 --- a/python/Makefile +++ b/python/Makefile @@ -14,3 +14,8 @@ $(NATIVE_MODS): %.so: %.o %.o: %.c $(COMPILE) -c $< + +install: + python setup.py install --root=$(INSTALL_ROOT) + ln -s /usr/lib/util-vserver/util-vserver-vars \ + $(INSTALL_ROOT)/usr/lib/python2.3/site-packages/util_vserver_vars.py diff --git a/python/setup.py b/python/setup.py new file mode 100644 index 0000000..b0c232e --- /dev/null +++ b/python/setup.py @@ -0,0 +1,14 @@ +from distutils.core import setup, Extension + +# XXX - need a way to share crap with the Makefile +setup(name = "util-vserver", + version = "0.1", + description = "Python modules for vserver operations", + author = "Steve Muir", + author_email = "smuir@cs.princeton.edu", + py_modules = ["vserver"], + ext_modules = [Extension("vserverimpl", + ["vserverimpl.c"], + include_dirs = ["..", "../lib"], + library_dirs = ["../lib"], + libraries = ["vserver"])]) diff --git a/util-vserver.spec b/util-vserver.spec index 7a23bfb..95f08cf 100644 --- a/util-vserver.spec +++ b/util-vserver.spec @@ -79,6 +79,8 @@ mkdir -p $RPM_BUILD_ROOT/etc/cron.d . sysv/vcached.conf echo "*/$(($period / 60)) * * * * root %_sbindir/vcached -s -f -l $logfile" > $RPM_BUILD_ROOT/etc/cron.d/vcached +%__make -C python INSTALL_ROOT=$RPM_BUILD_ROOT install + %clean rm -rf $RPM_BUILD_ROOT @@ -145,10 +147,34 @@ fi %_sbindir/newvserver %_mandir/man8/newvserver* + + +%package py23 +Summary: Python modules for manipulating vservers +Group: Applications/System +Requires: python /usr/lib/util-vserver/util-vserver-vars util-python + +%description py23 +Python modules for manipulating vservers. Provides a superset of the +functionality of the vserver script (at least will do in the future), +but more readily accessible from Python code. + +%files py23 +%defattr(0644,root,root) +/usr/lib/python2.3/site-packages/util_vserver_vars.py +/usr/lib/python2.3/site-packages/vserver.py +/usr/lib/python2.3/site-packages/vserver.pyc +/usr/lib/python2.3/site-packages/vserverimpl.so + + + %changelog +* Wed May 25 2005 Steve Muir +- add Python modules for manipulating vservers + * Thu Apr 7 2005 Steve Muir - vuserdel changes: don't shutdown vserver, just kill all processes; - unmount and mountpoints in vserver before deleting + unmount all mountpoints in vserver before deleting * Fri Nov 19 2004 Mark Huang - vcached no longer runs as a daemon