Modifies deb pkg building to include postinst script

stage-build now uses make instead of tox, to allow adding
postinst script.
Postinst script adds installation of dependencies through pip.
Adds missing MANIFEST and stdeb.cfg.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: I42849e0a3457745ad00a169128554cf3574bcb23
diff --git a/python3-osm-common.postinst b/MANIFEST.in
old mode 100755
new mode 100644
similarity index 70%
copy from python3-osm-common.postinst
copy to MANIFEST.in
index 62b04ec..cbc5d1e
--- a/python3-osm-common.postinst
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
-#!/bin/bash
-
-##
+# Copyright 2018 Whitestack, LLC
+#
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
 # not use this file except in compliance with the License. You may obtain
 # a copy of the License at
@@ -14,16 +13,9 @@
 # under the License.
 #
 # For those usages not covered by the Apache License, Version 2.0 please
-# contact with: OSM_TECH@list.etsi.org
+# contact: bdiaz@whitestack.com or glavado@whitestack.com
 ##
 
-echo "POST INSTALL OSM-COMMON"
-echo "Install aiokafka with pip"
-
-pip3 install pip==9.0.3
-pip3 install --upgrade aiokafka
-# pip install --upgrade pyang pyangbind
-
-#Creation of log folder
-mkdir -p /var/log/osm
-
+include README.rst
+recursive-include osm_common *.py *.xml *.sh
+recursive-include devops-stages *
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 410db79..e3e9dac 100644
--- a/Makefile
+++ b/Makefile
@@ -16,13 +16,9 @@
 all: clean package
 
 clean:
-	rm -rf dist deb_dist .build osm_common-*.tar.gz osm_common.egg-info eggs
+	rm -rf dist deb_dist osm_common-*.tar.gz osm_common.egg-info .eggs
 
 package:
 	python3 setup.py --command-packages=stdeb.command sdist_dsc
-	cp python3-osm-common.postinst deb_dist/osm-common*/debian
-	cd deb_dist/osm-common*/debian && echo "pymongo python3-pymongo" > py3dist-overrides
-	# cd deb_dist/osm-common*/debian && echo "pip3 python3-pip"       >> py3dist-overrides
+	cp debian/python3-osm-common.postinst deb_dist/osm-common*/debian
 	cd deb_dist/osm-common*/  && dpkg-buildpackage -rfakeroot -uc -us
-	mkdir -p .build
-	cp deb_dist/python3-osm-common*.deb .build/
diff --git a/python3-osm-common.postinst b/debian/python3-osm-common.postinst
similarity index 82%
rename from python3-osm-common.postinst
rename to debian/python3-osm-common.postinst
index 62b04ec..a877e58 100755
--- a/python3-osm-common.postinst
+++ b/debian/python3-osm-common.postinst
@@ -18,11 +18,12 @@
 ##
 
 echo "POST INSTALL OSM-COMMON"
-echo "Install aiokafka with pip"
+echo "Installing python dependencies via pip..."
 
 pip3 install pip==9.0.3
-pip3 install --upgrade aiokafka
-# pip install --upgrade pyang pyangbind
+pip3 install --upgrade aiokafka==0.4.*
+pip3 install --upgrade pymongo==3.7.*
+pip3 install --upgrade pyyaml==3.*
 
 #Creation of log folder
 mkdir -p /var/log/osm
diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh
index 538f24f..dfb7978 100755
--- a/devops-stages/stage-build.sh
+++ b/devops-stages/stage-build.sh
@@ -16,7 +16,4 @@
 # moved to a Makefile in order to add post install. Needed for "pip3 install aiokafka", 
 # that is not available with a package
 
-#make clean package
-
-rm -rf deb_dist
-tox -e build
+make clean package
diff --git a/stdeb.cfg b/stdeb.cfg
new file mode 100644
index 0000000..2bc94c2
--- /dev/null
+++ b/stdeb.cfg
@@ -0,0 +1,3 @@
+[DEFAULT]
+X-Python3-Version : >= 3.5
+Depends3 : python3-pip
\ No newline at end of file