Fixing packaging support 09/8509/3
authorMauro Sardara <[email protected]>
Fri, 22 Sep 2017 19:53:55 +0000 (21:53 +0200)
committerMauro Sardara <[email protected]>
Fri, 22 Sep 2017 20:13:20 +0000 (20:13 +0000)
Change-Id: I322e678a8fe455afc3325204062fb47fa45f5245
Signed-off-by: Mauro Sardara <[email protected]>
debian/changelog
debian/control
debian/netmon.postinst
debian/python3-netmodel.postinst [new file with mode: 0644]
debian/rules
debian/vicn.postinst [new file with mode: 0644]
scripts/build-package.sh [moved from scripts/build_package.sh with 79% similarity]
scripts/version
vicn/core/collection.py [new file with mode: 0644]

index 90590ff..cc91eb4 100644 (file)
@@ -1,5 +1,5 @@
-vicn (1.0-25~g009e5b9~b1) UNRELEASED; urgency=medium
+vicn (0.1-1) UNRELEASED; urgency=medium
 
-  * Initial release (Closes: #nnnn)
+  * Initial release. (Closes: #XXXXXX)
 
- -- Mauro Sardara <[email protected]>  Tue, 18 Oct 2016 12:10:07 +0200
+ --  <[email protected]>  Mon, 10 Jul 2017 11:07:54 +0200
index 1dad268..99e51ee 100644 (file)
@@ -1,5 +1,4 @@
 Source: vicn
-Version: 3.23
 Section: python
 Priority: optional
 Maintainer: Jordan AugĂ© <[email protected]>
@@ -11,7 +10,6 @@ Vcs-Browser: https://gerrit.fd.io/r/gitweb?p=cicn.git
 X-Python3-Version: >= 3.5
 
 Package: python3-netmodel
-Version: 3.23
 Architecture: all
 Depends: ${python3:Depends}, ${misc:Depends}, python3-daemon, python3-lockfile, python3-setuptools, python3-pip
 Suggests: python-netmodel-doc
@@ -19,15 +17,13 @@ Description: Netmodel
  Netmodel
 
 Package: netmon
-Version: 3.23
 Architecture: all
-Depends: ${python3:Depends}, ${misc:Depends}, python3-netmodel
+Depends: ${python3:Depends}, ${misc:Depends}, python3-netmodel, bwm-ng
 Suggests: netmon-doc
 Description: Monitoring
  Monitoring daemon
 
 Package: vicn
-Version: 3.23
 Architecture: all
 Depends: ${python3:Depends}, ${misc:Depends}, python3-netmodel
 Suggests: vicn-doc
@@ -51,9 +47,3 @@ Description: vICN experiment controller
  The master, vICN, controls the whole cluster of servers, by means of HTTPS REST
  APIs and remote SSH.
 
-#Package: vicn-resource-hicn
-#Architecture: all
-#Depends: vicn
-#Description: TODO
-# TODO
-
index fdbfb95..41df34c 100644 (file)
@@ -1,3 +1,3 @@
 #!/bin/bash
 
-pip3 install --upgrade autobahn
+pip3 install --upgrade pylxd
diff --git a/debian/python3-netmodel.postinst b/debian/python3-netmodel.postinst
new file mode 100644 (file)
index 0000000..587f14b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+pip3 install --upgrade autobahn pyopenssl pylxd
index 86a95b0..14bba46 100755 (executable)
@@ -8,8 +8,6 @@
 %:
        dh $@ --with python3,sphinxdoc --buildsystem=pybuild
 
-override_dh_auto_test:
-
 #override_dh_auto_build: export http_proxy=127.0.0.1:9
 #override_dh_auto_build: export https_proxy=127.0.0.1:9
 #override_dh_auto_build: dh_auto_build
diff --git a/debian/vicn.postinst b/debian/vicn.postinst
new file mode 100644 (file)
index 0000000..41df34c
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+pip3 install --upgrade pylxd
similarity index 79%
rename from scripts/build_package.sh
rename to scripts/build-package.sh
index 8189efd..264b6ab 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+k#!/bin/bash
 set -euxo pipefail
 IFS=$'\n\t'
 
@@ -7,7 +7,8 @@ APT_PATH=`which apt-get` || true
 apt_get=${APT_PATH:-"/usr/local/bin/apt-get"}
 
 BUILD_TOOLS_UBUNTU="build-essential doxygen"
-DEPS_UBUNTU="devscripts debhelper python3-all python3-setuptools python3-docutils python3-sphinx python3-networkx python3-openssl python3-pyparsing python3-pip"
+DEPS_UBUNTU="devscripts debhelper python3-all python3-setuptools python3-docutils python3-sphinx python3-networkx python3-pyparsing python3-pip"
+DEPS_PYTHON="autobahn pyopenssl"
 
 setup() {
 
@@ -47,6 +48,7 @@ build_package() {
     # Install package dependencies
     if [ $DISTRIB_ID == "Ubuntu" ]; then
         echo $BUILD_TOOLS_UBUNTU $DEPS_UBUNTU | xargs sudo ${apt_get} install -y --allow-unauthenticated
+        echo $DEPS_PYTHON | xargs sudo pip3 install --upgrade
     fi
 
     # do nothing but print the current slave hostname
@@ -63,9 +65,15 @@ vicn ($VERSION) UNRELEASED; urgency=medium
  -- Mauro Sardara <[email protected]>  Tue, 18 Oct 2016 12:10:07 +0200
 EOF
 
-    pushd $SCRIPT_PATH/..
+    mkdir -p $SCRIPT_PATH/../vicn_build_root
+    ls -1 | while read line; do if [ "$line" != "$(basename $SCRIPT_PATH)" ]; then mv $line $SCRIPT_PATH/../vicn_build_root; fi done || true
+    cd $SCRIPT_PATH/../vicn_build_root
+
     debuild --no-lintian --no-tgz-check -i -us -uc -b
-    popd
+
+    cd $SCRIPT_PATH/..
+    mkdir build
+    mv *.deb build
 
     echo "*******************************************************************"
     echo "* $PACKAGE_NAME BUILD SUCCESSFULLY COMPLETED"
@@ -78,4 +86,3 @@ PACKAGE_NAME="VICN"
 pushd $SCRIPT_PATH/..
 build_package $PACKAGE_NAME
 popd
-
index dcf93d8..2f4c1d4 100644 (file)
@@ -7,7 +7,7 @@ cd "$path"
 
 git rev-parse 2> /dev/null
 if [ $? == 0 ]; then
-    vstring=$(git describe --dirty --match "$version_prefix*" | sed "s/$version_prefix//")
+    vstring=$(git describe --match "$version_prefix*" | sed "s/$version_prefix//")
 elif [ -f .version ]; then
     vstring=$(cat .version)
 else
@@ -23,7 +23,7 @@ ADD=$(echo ${vstring} | cut -s -d- -f2)
 
 git rev-parse 2> /dev/null
 if [ $? == 0 ]; then
-    CMT=$(git describe --dirty --match "$version_prefix*" | sed "s/$version_prefix//" | cut -s -d- -f3,4)
+    CMT=$(git describe --match "$version_prefix*" | sed "s/$version_prefix//" | cut -s -d- -f3,4)
 else
     CMT=$(echo ${vstring} | cut -s -d- -f3,4)
 fi
@@ -54,4 +54,4 @@ fi
     fi
   else
     echo ${TAG}-release
-fi
\ No newline at end of file
+fi
diff --git a/vicn/core/collection.py b/vicn/core/collection.py
new file mode 100644 (file)
index 0000000..fb22289
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2017 Cisco and/or its affiliates.
+#
+# 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.
+#
+
+from vicn.core.sa_collections       import InstrumentedList
+from netmodel.model.collection      import Collection
+
+class Collection(InstrumentedList, Collection):
+    pass