vpp-python-api deb packaging - use easy_install to install the python api 69/4269/4
authorroot <root@intel-rd.labo>
Tue, 13 Dec 2016 16:00:02 +0000 (17:00 +0100)
committerOle Trøan <otroan@employees.org>
Tue, 3 Jan 2017 12:57:53 +0000 (12:57 +0000)
Change-Id: I67963d5a6ec324b13c50f8f6c51ed3c715b4c145
Signed-off-by: Gabriel Ganne <gabriel.ganne@qosmos.com>
build-root/deb/debian/vpp-python-api.postinst [new file with mode: 0644]
build-root/deb/debian/vpp-python-api.prerm [new file with mode: 0644]
src/vpp-api/python/setup.py

diff --git a/build-root/deb/debian/vpp-python-api.postinst b/build-root/deb/debian/vpp-python-api.postinst
new file mode 100644 (file)
index 0000000..ca1c856
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+# after installing python-api files
+python2_sitedir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+easy_install --install-dir=$python2_sitedir  -z $python2_sitedir/vpp_papi/vpp_papi-*.egg
diff --git a/build-root/deb/debian/vpp-python-api.prerm b/build-root/deb/debian/vpp-python-api.prerm
new file mode 100644 (file)
index 0000000..e6d92df
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+# before removing python-api files
+python2_sitedir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+easy_install --install-dir=$python2_sitedir -mxNq vpp_papi
+
+# the egg has been copied during install
+rm $python2_sitedir/vpp_papi-*.egg
index 99a0147..8a34d50 100644 (file)
@@ -31,4 +31,5 @@ setup (name = 'vpp_papi',
                libraries = ['pneum'],
            )],
        long_description = '''VPP Python language binding.''',
+       zip_safe = True,
 )