From c6884b76347be620a7b2aed427291a2e49b53850 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 7 Dec 2011 12:55:41 +0100 Subject: [PATCH] minor improvement to packaging xmlbuilder comes in a separate package stuff goes in /usr/share/sfa/examples --- Makefile | 7 ++++- setup.py | 23 ++++++++-------- sfa.spec | 26 ++++++++++++------- .../miniclient.py} | 0 4 files changed, 34 insertions(+), 22 deletions(-) rename sfa/{client/sfaclientsample.py => examples/miniclient.py} (100%) diff --git a/Makefile b/Makefile index 93c808b9..ef3e497d 100644 --- a/Makefile +++ b/Makefile @@ -30,10 +30,15 @@ sfa/util/version.py: sfa/util/version.py.in xmlbuilder-install: cd xmlbuilder-0.9 && python setup.py install --root=$(DESTDIR) && cd - - + rm -rf $(DESTDIR)/usr/lib*/python*/site-packages/*egg-info + +# postinstall steps - various cleanups and tweaks for a nicer rpm python-install: python setup.py install --root=$(DESTDIR) chmod 444 $(DESTDIR)/etc/sfa/default_config.xml + rm -rf $(DESTDIR)/usr/lib*/python*/site-packages/*egg-info + rm -rf $(DESTDIR)/usr/lib*/python*/site-packages/sfa/storage/sfa.sql + (cd $(DESTDIR)/usr/bin ; ln -s sfi.py sfi; ln -s sfascan.py sfascan) python-clean: version-clean python setup.py clean diff --git a/setup.py b/setup.py index cad5436c..b18f13a1 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from glob import glob import shutil from distutils.core import setup -bins = glob("sfa/clientbin/*.py") + \ +scripts = glob("sfa/clientbin/*.py") + \ [ 'config/sfa-config-tty', 'config/gen-sfa-cm-config.py', @@ -24,7 +24,7 @@ bins = glob("sfa/clientbin/*.py") + \ 'flashpolicy/sfa_flashpolicy.py', ] -package_dirs = [ +packages = [ 'sfa', 'sfa/trust', 'sfa/storage', @@ -47,7 +47,7 @@ package_dirs = [ initscripts = [ 'sfa', 'sfa-cm' ] -data_files = [('/etc/sfa/', [ 'config/aggregates.xml', +data_files = [ ('/etc/sfa/', [ 'config/aggregates.xml', 'config/registries.xml', 'config/default_config.xml', 'config/sfi_config', @@ -60,10 +60,11 @@ data_files = [('/etc/sfa/', [ 'config/aggregates.xml', 'sfa/trust/protogeni-rspec-common.xsd', 'flashpolicy/sfa_flashpolicy_config.xml', ]), - ('/etc/sfatables/matches/', glob('sfatables/matches/*.xml')), - ('/etc/sfatables/targets/', glob('sfatables/targets/*.xml')), - ('/etc/init.d/', [ "init.d/%s"%x for x in initscripts ]), - ('/usr/share/sfa/', [ 'sfa/storage/sfa.sql' ] ), + ('/etc/sfatables/matches/', glob('sfatables/matches/*.xml')), + ('/etc/sfatables/targets/', glob('sfatables/targets/*.xml')), + ('/etc/init.d/', [ "init.d/%s"%x for x in initscripts ]), + ('/usr/share/sfa/', [ 'sfa/storage/sfa.sql' ] ), + ('/usr/share/sfa/examples/', glob('sfa/examples/*' ) ), ] # add sfatables processors as data_files @@ -80,7 +81,7 @@ if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']: site_packages_path = [ os.path.join(p,'sfa') for p in python_path if p.endswith('site-packages')] site_packages_path += [ os.path.join(p,'sfatables') for p in python_path if p.endswith('site-packages')] remove_dirs = ['/etc/sfa/', '/etc/sfatables'] + site_packages_path - remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in bins ] + remove_bins = [ '/usr/bin/' + os.path.basename(bin) for bin in scripts ] remove_files = remove_bins + [ "/etc/init.d/%s"%x for x in initscripts ] # remove files @@ -100,9 +101,7 @@ if sys.argv[1] in ['uninstall', 'remove', 'delete', 'clean']: else: # avoid repeating what's in the specfile already setup(name='sfa', - packages = package_dirs, + packages = packages, data_files = data_files, - ext_modules = [], - py_modules = [], - scripts = bins) + scripts = scripts) diff --git a/sfa.spec b/sfa.spec index 9d123a13..ef0cb948 100644 --- a/sfa.spec +++ b/sfa.spec @@ -32,7 +32,7 @@ Requires: python-ZSI # for uuidgen - used in db password generation # on f8 this actually comes with e2fsprogs, go figure Requires: util-linux-ng -# xmlbuilder depends on lxml +# xmlbuilder depends on lxml Requires: python-lxml Requires: python-setuptools Requires: python-dateutil @@ -42,6 +42,7 @@ Requires: postgresql-python Requires: python-psycopg2 Requires: pyOpenSSL >= 0.7 Requires: myplc-config +Requires: python-xmlbuilder # python 2.5 has uuid module added, for python 2.4 we still need it. # we can't really check for if we can load uuid as a python module, @@ -84,6 +85,11 @@ Summary: SFA support for flash clients Group: Applications/System Requires: sfa +%package xmlbuilder +Summary: third-party xmlbuilder tool +Group: Applications/System +Provides: python-xmlbuilder + %package tests Summary: unit tests suite for SFA Group: Applications/System @@ -108,10 +114,14 @@ networks. This is the command line interface to manage sfatables %description cm This package implements the SFA interface which serves as a layer between the existing PlanetLab NodeManager interfaces and the SFA API. - + %description flashpolicy This package provides support for adobe flash client applications. - + +%description xmlbuilder +This package contains the xmlbuilder python library, packaged for +convenience as it is not supported by fedora + %description tests Provides some binary unit tests in /usr/share/sfa/tests @@ -124,11 +134,6 @@ make VERSIONTAG="%{version}-%{taglevel}" SCMURL="%{SCMURL}" %install rm -rf $RPM_BUILD_ROOT make VERSIONTAG="%{version}-%{taglevel}" SCMURL="%{SCMURL}" install DESTDIR="$RPM_BUILD_ROOT" -rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/*egg-info -# this gets duplicated -rm -rf $RPM_BUILD_ROOT/%{python_sitelib}/sfa/storage/sfa.sql -# create symlinks -(cd $RPM_BUILD_ROOT/%{_bindir}; ln -s sfi.py sfi; ln -s sfascan.py sfascan) %clean rm -rf $RPM_BUILD_ROOT @@ -136,7 +141,6 @@ rm -rf $RPM_BUILD_ROOT %files # sfa and sfatables depend on each other. %{python_sitelib}/sfa -%{python_sitelib}/xmlbuilder /etc/init.d/sfa %{_bindir}/sfa-start.py* %{_bindir}/keyconvert.py* @@ -145,6 +149,7 @@ rm -rf $RPM_BUILD_ROOT %config (noreplace) /etc/sfa/aggregates.xml %config (noreplace) /etc/sfa/registries.xml /usr/share/sfa/sfa.sql +/usr/share/sfa/examples /var/www/html/wsdl/*.wsdl %files plc @@ -186,6 +191,9 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/sfa_flashpolicy.py* /etc/sfa/sfa_flashpolicy_config.xml +%files xmlbuilder +%{python_sitelib}/xmlbuilder + %files tests %{_datadir}/sfa/tests diff --git a/sfa/client/sfaclientsample.py b/sfa/examples/miniclient.py similarity index 100% rename from sfa/client/sfaclientsample.py rename to sfa/examples/miniclient.py -- 2.43.0