From 5a09036825d1890de546582e6361f16cf44188d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Wed, 20 May 2009 10:32:59 +0000 Subject: [PATCH] initial package for geniwrapper. --- Makefile | 11 ++++---- geniwrapper.spec | 66 +++++++++++++++++++++++++++++++++++++++++++++ keyconvert/Makefile | 4 +-- setup.py | 21 ++++++++------- 4 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 geniwrapper.spec diff --git a/Makefile b/Makefile index 32fc46f6..30528702 100644 --- a/Makefile +++ b/Makefile @@ -6,11 +6,11 @@ init := geni/__init__.py geni/util/__init__.py geni/methods/__init__.py subdirs := keyconvert #pyOpenSSL-0.9 - -all: install $(init) $(subdirs) -install: - python setup.py install +all: $(init) $(subdirs) + +install: all + python setup.py install --root=$(DESTDIR) $(subdirs): $(init) @@ -18,9 +18,8 @@ $(subdirs): %: $(MAKE) -C $@ clean: - python setup.py uninstall + python setup.py clean cd keyconvert && make clean - # XX remove keyconvert index: $(init) diff --git a/geniwrapper.spec b/geniwrapper.spec new file mode 100644 index 00000000..d8481a0f --- /dev/null +++ b/geniwrapper.spec @@ -0,0 +1,66 @@ + +%define url $URL: svn+ssh://svn.planet-lab.org/svn/geniwrapper/trunk/geniwrapper.spec $ + +%define name geniwrapper +%define version 0.2 +%define taglevel 1 + +%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} +%global python_sitearch %( python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)" ) + +Name: %{name} +Version: %{version} +Release: %{release} +Source0: %{name}-%{version}.tar.bz2 +License: GPL +Group: Applications/System +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot + +Vendor: PlanetLab +Packager: PlanetLab Central +Distribution: PlanetLab %{plrelease} +URL: %(echo %{url} | cut -d ' ' -f 2) + +BuildRequires: make +Requires: python +Requires: pyOpenSSL >= 0.7 +Requires: m2crypto + + +Summary: Geniwrapper +Group: Applications/System + +%description +Geniwrapper description... + +%prep +%setup -q + +%build +make + +%install +rm -rf $RPM_BUILD_ROOT +make install DESTDIR="$RPM_BUILD_ROOT" + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +/etc/init.d/geniwrapper +/etc/geni +/usr/bin/geni-config-tty +/usr/bin/gimport.py* +/usr/bin/plc.py* +/usr/bin/sfi.py* +/usr/lib/python2.5/site-packages/geni +/usr/share/keyconvert + +%post +chmod 0744 /etc/init.d/geniwrapper + +%changelog +* Fri May 18 2009 Baris Metin +- initial package + diff --git a/keyconvert/Makefile b/keyconvert/Makefile index 47240dfd..0c755244 100644 --- a/keyconvert/Makefile +++ b/keyconvert/Makefile @@ -5,8 +5,8 @@ keyconvert: gcc -o keyconvert -lcrypto -ldl keyconvert.c keyconvertmain.c b64decode.c install: keyconvert - install -cD -m 0755 keyconvert /usr/share/keyconvert/keyconvert + install -cD -m 0755 keyconvert $(DESTDIR)/usr/share/keyconvert/keyconvert clean: rm -rf keyconvert - rm -rf /usr/share/keyconvert/ + rm -rf $(DESTDIR)/usr/share/keyconvert/ diff --git a/setup.py b/setup.py index 0b1a35cb..75225db9 100755 --- a/setup.py +++ b/setup.py @@ -12,8 +12,7 @@ version = '0.2' scripts = ['geni/gimport.py', 'geni/plc.py', 'cmdline/sfi.py', 'geni-config-tty'] package_dirs = ['geni', 'geni/util', 'geni/methods'] data_files = [('/etc/geni/', ['geni/aggregates.xml', 'geni/registries.xml', 'geni/util/geni_config', 'cmdline/configSfi.sh']), - ('/etc/init.d/', ['geni/geniwrapper']) - ] + ('/etc/init.d/', ['geni/geniwrapper'])] symlinks = ['/usr/share/geniwrapper'] initscripts = ['/etc/init.d/geniwrapper'] @@ -67,10 +66,14 @@ and the Geni API. site_packages_path = map(add_geni_path, site_packages_path) # python path usualy has /urs/local/lib/ path , filter this out site_packages_path = filter(lambda x: 'local' not in x, site_packages_path) - for src in site_packages_path: - for dst in symlinks: - try: - os.symlink(src, dst) - except: pass - for initscript in initscripts: - os.chmod(initscript, 00744) + + # we can not do this here as installation root might change paths + # - baris + # + # for src in site_packages_path: + # for dst in symlinks: + # try: + # os.symlink(src, dst) + # except: pass + # for initscript in initscripts: + # os.chmod(initscript, 00744) -- 2.43.0