first stab at packaging on fedora
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 14 Mar 2013 15:41:11 +0000 (16:41 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 14 Mar 2013 15:41:11 +0000 (16:41 +0100)
Makefile
myslice.spec [new file with mode: 0644]
setup.py [new file with mode: 0644]

index 7d4cbbc..9d42905 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,24 @@
-### 
-all: 
-       @echo no default target
+### first purpose, build and install from the specfile
+all: build
 
 force:
 
+DESTDIR := /
+datadir := /usr/share
+bindir := /usr/bin
+
+PWD := $(shell pwd)
+
+build:
+       python setup.py build
+
+install: 
+       python setup.py install \
+           --install-purelib=$(DESTDIR)/$(datadir)/myslice \
+           --install-scripts=$(DESTDIR)/$(datadir)/myslice \
+           --install-data=$(DESTDIR)/$(datadir)/myslice
+
+
 #################### compute emacs tags
 # list files under git but exclude third-party stuff like bootstrap and jquery
 myfiles: force
diff --git a/myslice.spec b/myslice.spec
new file mode 100644 (file)
index 0000000..5a9445a
--- /dev/null
@@ -0,0 +1,46 @@
+%define name myslice
+%define version 0.1
+%define taglevel 1
+
+%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+
+Summary: MySlice Frontend
+Name: %{name}
+Version: %{version}
+Release: %{release}
+License: GPLv3
+Source0: %{name}-%{version}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+Vendor: OpenLab
+Packager: OpenLab <thierry.parmentelat@inria.fr>
+URL: %{SCMURL}
+
+# We use set everywhere
+Requires: python >= 2.7
+Requires: Django
+BuildRequires: python-setuptools make
+
+%description 
+The MySlice frontend provides a django application that interacts with
+a manifold backend to provide a User-Interface to a federation of
+testbeds.
+
+%prep
+%setup -q
+
+%build
+%{__make} build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__make} install DESTDIR="$RPM_BUILD_ROOT" datadir="%{_datadir}" bindir="%{_bindir}"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%dir %{_datadir}/myslice
+
+%changelog
diff --git a/setup.py b/setup.py
new file mode 100644 (file)
index 0000000..cb328f5
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Setup script for myslice
+#
+# Thierry Parmentelat <thierry.parmentelat@inria.fr>
+# INRIA (c) 2013
+
+import os.path
+from glob import glob
+from distutils.core import setup
+
+# we don't have a final list os let's keep it simple for now
+packages= [ os.path.dirname(init) for init in (glob("*/__init__.py")+glob("*/*/__init__.py")) ]
+
+setup(packages = packages,
+      scripts = [],
+      data_files = [ 
+#        ( dir [ list of paths from toplevel] ) ,
+        ])