Repackaged pythonic way
authorEd Bartosh <eduard.bartosh@intel.com>
Wed, 31 Oct 2012 14:19:50 +0000 (16:19 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 1 Nov 2012 07:18:44 +0000 (09:18 +0200)
As this package has been splitted to script and API it makes sense to
utilize proper Python packaging( so called Python Egg) using setuptools
functionality. This change does exactly that. All building and installation
is done using setup.py.

Debian and RPM packaging has been updated accordingly.

Artem: tweak package description and my e-mail address.

Change-Id: I46a6ad4e9c5b869190e4a001dc6fa274cae2ca7e
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
debian/control
packaging/bmap-tools.dsc
packaging/bmap-tools.spec
setup.py [new file with mode: 0644]

index 166cb01..f3f3026 100644 (file)
@@ -2,7 +2,7 @@ Source: bmap-tools
 Maintainer: Ed Bartosh <eduard.bartosh@intel.com>
 Section: python
 Priority: optional
-Build-Depends: debhelper (>= 7)
+Build-Depends: debhelper (>= 7), python-all, python-distribute
 Standards-Version: 3.8.4
 XS-Python-Version: current
 
@@ -11,4 +11,4 @@ Architecture: all
 Depends: ${misc:Depends}, ${python:Depends}
 XB-Python-Version: ${python:Versions}
 Description: Bmap tools
- Bmap-flasher - Flash an image file to a block device using the block map (bmap) 
+ Bmap-flasher - Flash an image file to a block device using the block map (bmap)
index a2f63b8..2cafdf3 100644 (file)
@@ -5,6 +5,6 @@ Architecture: all
 Version: 0.1.0
 Maintainer: Ed Bartosh <eduard.bartosh@intel.com>
 Standards-Version: 3.8.4
-Build-Depends: debhelper (>= 7.0)
-Files: 
1c730ad6a7474a9aef288e1beea38ab9 5865 bmap-tools_0.1.0.tar.gz
+Build-Depends: debhelper (>= 7), python-all, python-distribute
+Files:
002b1492e8ebee0d01d58620a91c87cc 8145 bmap-tools_0.1.0.tar.gz
index 2027a5a..4b79aca 100644 (file)
@@ -8,7 +8,7 @@ BuildArch:  noarch
 URL:        http://otctools.jf.intel.com
 Source0:    %{name}_%{version}.tar.gz
 
-Requires:   python-distribute
+BuildRequires:  python-distribute
 
 %description
 Bmap-flasher - Flash an image file to a block device using the block map (bmap).
@@ -21,11 +21,13 @@ Bmap-flasher - Flash an image file to a block device using the block map (bmap).
 %install
 rm -rf $RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT/%{_bindir}
-install -m 755 bmap-flasher $RPM_BUILD_ROOT/%{_bindir}
+python setup.py install --prefix=%{_prefix} --root=%{buildroot}
 
 %files
 %defattr(-,root,root,-)
+%dir /usr/lib/python*/site-packages/bmaptools
+/usr/lib/python*/site-packages/bmap_tools*
+/usr/lib/python*/site-packages/bmaptools/*
 %{_bindir}/*
 
 %changelog
diff --git a/setup.py b/setup.py
new file mode 100644 (file)
index 0000000..b698fef
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+
+from setuptools import setup, find_packages
+
+setup(
+    name = "bmap-tools",
+    description = "Bmap tools",
+    author = "Artem Bityutskiy",
+    author_email = "artem.bityutskiy@linux.intel.com",
+    version = "0.1.0",
+    scripts = ['bmap-flasher'],
+    packages = find_packages(),
+    license='GPLv2',
+    long_description="Tools to generate block map (AKA bmap) and flash " \
+                     "images using bmap",
+)