From 72e4119b22db868148d4cae3995b4159af35e0dd Mon Sep 17 00:00:00 2001
From: Victor Seva <vseva@sipwise.com>
Date: Thu, 22 Jan 2015 17:04:59 +0100
Subject: [PATCH] MT#10277 Create ngcp-netscript package + b28adb76 + e03bea2

Change-Id: I6ea888dc3c9b2556bcffe3d289a2734106cd44af
---
 Makefile              |  9 ++++++---
 debian/changelog      |  5 +++++
 debian/compat         |  1 +
 debian/control        | 15 +++++++++++++++
 debian/copyright      |  7 +++++++
 debian/dirs           |  1 +
 debian/install        |  1 +
 debian/rules          | 19 +++++++++++++++++++
 debian/source/format  |  1 +
 debian/source/options |  1 +
 10 files changed, 57 insertions(+), 3 deletions(-)
 create mode 100644 debian/changelog
 create mode 100644 debian/compat
 create mode 100644 debian/control
 create mode 100644 debian/copyright
 create mode 100644 debian/dirs
 create mode 100644 debian/install
 create mode 100755 debian/rules
 create mode 100644 debian/source/format
 create mode 100644 debian/source/options

diff --git a/Makefile b/Makefile
index da2f945..65aa509 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 # for syntax checks
 BASH_SCRIPTS = deployment.sh
-VERSION=$(shell git log --pretty=format:"%h" -1 deployment.sh)
+NGCP_VERSION ?= $(shell git log --pretty=format:"%h" -1)
+NGCP_VERSION := $(strip $(NGCP_VERSION))
 
 syntaxcheck: shellcheck
 
@@ -14,7 +15,9 @@ shellcheck:
 	echo " done."; \
 
 script_version:
-	echo "Adjust version information string in deployment.sh to ${VERSION}"
-	sed -i "s/SCRIPT_VERSION=\"%SCRIPT_VERSION%\"/SCRIPT_VERSION=${VERSION}/" deployment.sh
+	echo "Adjust version information string in deployment.sh to ${NGCP_VERSION}"
+	sed -i "s/SCRIPT_VERSION=\"%SCRIPT_VERSION%\"/SCRIPT_VERSION=${NGCP_VERSION}/" deployment.sh
 
+
+.PHONY: clean install build syntaxcheck shellcheck script_version
 # EOF
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..eb65c5d
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+ngcp-netscript (3.5.1.1+0~mr3.5.1.1) unstable; urgency=medium
+
+  * Initial release
+
+ -- Victor Seva <vseva@sipwise.com>  Thu, 22 Jan 2015 16:58:59 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..3156244
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,15 @@
+Source: ngcp-netscript
+Section: admin
+Priority: extra
+Maintainer: Sipwise Development Team <support@sipwise.com>
+Build-Depends: debhelper (>= 9),
+               git
+Standards-Version: 3.9.6
+Homepage: http://sipwise.com/
+
+Package: ngcp-netscript
+Architecture: any
+Depends: ${misc:Depends},
+         ${shlibs:Depends}
+Description: NGCP deployment scripts
+ scripts needed to install Sipwise NGCP system.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..7cf5e1e
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,7 @@
+Upstream Author: The Sipwise Team - http://sipwise.com/
+Copyright:       Copyright (c) 2015 Sipwise GmbH, Austria
+License:         All software included in this package is
+                 Copyright (c) Sipwise GmbH, Austria.
+                 All rights reserved. You may not copy, distribute
+                 or modify without prior written permission from
+                 Sipwise GmbH, Austria.
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..7b62f8b
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+/usr/share/ngcp-netscript
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..3873687
--- /dev/null
+++ b/debian/install
@@ -0,0 +1 @@
+deployment.sh usr/share/ngcp-netscript/
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d67e9bb
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,19 @@
+#!/usr/bin/make -f
+# Uncomment this to turn on verbose mode.
+# export DH_VERBOSE=1
+
+DEBVERSION:=$(shell head -n 1 debian/changelog \
+                    | sed -e 's/^[^(]*(\([^)]*\)).*/\1/')
+
+ifneq ($(GIT_COMMIT),)
+export NGCP_VERSION := $(GIT_COMMIT)
+else
+export NGCP_VERSION:=$(DEBVERSION)
+endif
+
+%:
+	dh $@
+
+override_dh_auto_configure:
+	echo "NGCP_VERSION=$(NGCP_VERSION)"
+	make script_version
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..bcdff00
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1 @@
+extend-diff-ignore=.gitreview