From 76a6056e2ec3bc5d7d7ead6423d721b0e4bd7475 Mon Sep 17 00:00:00 2001 From: Benjamin Diaz Date: Thu, 18 Oct 2018 17:31:05 -0300 Subject: [PATCH] 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 Change-Id: I42849e0a3457745ad00a169128554cf3574bcb23 --- MANIFEST.in | 21 +++++++++++++++++++ Makefile | 8 ++----- .../python3-osm-common.postinst | 7 ++++--- devops-stages/stage-build.sh | 5 +---- stdeb.cfg | 3 +++ 5 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 MANIFEST.in rename python3-osm-common.postinst => debian/python3-osm-common.postinst (82%) create mode 100644 stdeb.cfg diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..cbc5d1e --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,21 @@ +# 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 +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# For those usages not covered by the Apache License, Version 2.0 please +# contact: bdiaz@whitestack.com or glavado@whitestack.com +## + +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 -- 2.25.1