diff --git a/src/com/mirantis/mk/Debian.groovy b/src/com/mirantis/mk/Debian.groovy
new file mode 100644
index 0000000..acd225a
--- /dev/null
+++ b/src/com/mirantis/mk/Debian.groovy
@@ -0,0 +1,154 @@
+package com.mirantis.mk
+
+/**
+ *
+ * Debian functions
+ *
+ */
+
+def cleanup(image="debian:sid") {
+    def common = new com.mirantis.mk.Common()
+    def img = docker.image(image)
+
+    workspace = common.getWorkspace()
+    sh("docker run -e DEBIAN_FRONTEND=noninteractive -v ${workspace}:${workspace} -w ${workspace} --rm=true --privileged ${image} /bin/bash -c 'rm -rf build-area || true'")
+}
+
+/*
+ * Build binary Debian package from existing dsc
+ *
+ * @param file  dsc file to build
+ * @param image Image name to use for build (default debian:sid)
+ */
+def buildBinary(file, image="debian:sid", extraRepoUrl=null, extraRepoKeyUrl=null) {
+    def common = new com.mirantis.mk.Common()
+    def pkg = file.split('/')[-1].split('_')[0]
+    def img = docker.image(image)
+
+    workspace = common.getWorkspace()
+    sh("""docker run -e DEBIAN_FRONTEND=noninteractive -v ${workspace}:${workspace} -w ${workspace} --rm=true --privileged ${image} /bin/bash -c '
+            which eatmydata || (apt-get update && apt-get install -y eatmydata) &&
+            export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH:+"\$LD_LIBRARY_PATH:"}/usr/lib/libeatmydata &&
+            export LD_PRELOAD=\${LD_PRELOAD:+"\$LD_PRELOAD "}libeatmydata.so &&
+            [[ -z "${extraRepoUrl}" && "${extraRepoUrl}" != "null" ]] || echo "${extraRepoUrl}" >/etc/apt/sources.list.d/extra.list &&
+            [[ -z "${extraRepoKeyUrl}" && "${extraRepoKeyUrl}" != "null" ]] || (
+                which curl || (apt-get update && apt-get install -y curl) &&
+                curl --insecure -ss -f "${extraRepoKeyUrl}" | apt-key add -
+            ) &&
+            apt-get update && apt-get install -y build-essential devscripts equivs &&
+            dpkg-source -x ${file} build-area/${pkg} && cd build-area/${pkg} &&
+            mk-build-deps -t "apt-get -o Debug::pkgProblemResolver=yes -y" -i debian/control
+            debuild --no-lintian -uc -us -b'""")
+}
+
+/*
+ * Build source package from directory
+ *
+ * @param dir   Tree to build
+ * @param image Image name to use for build (default debian:sid)
+ * @param snapshot Generate snapshot version (default false)
+ */
+def buildSource(dir, image="debian:sid", snapshot=false, gitEmail='jenkins@dummy.org', gitName='Jenkins', revisionPostfix="") {
+    def isGit
+    try {
+        sh("test -d ${dir}/.git")
+        isGit = true
+    } catch (Exception e) {
+        isGit = false
+    }
+
+    if (isGit == true) {
+        buildSourceGbp(dir, image, snapshot, gitEmail, gitName, revisionPostfix)
+    } else {
+        buildSourceUscan(dir, image)
+    }
+}
+
+/*
+ * Build source package, fetching upstream code using uscan
+ *
+ * @param dir   Tree to build
+ * @param image Image name to use for build (default debian:sid)
+ */
+def buildSourceUscan(dir, image="debian:sid") {
+    def common = new com.mirantis.mk.Common()
+    def img = docker.image(image)
+    workspace = common.getWorkspace()
+    sh("""docker run -e DEBIAN_FRONTEND=noninteractive -v ${workspace}:${workspace} -w ${workspace} --rm=true --privileged ${image} /bin/bash -c '
+            apt-get update && apt-get install -y build-essential devscripts &&
+            cd ${dir} && uscan --download-current-version &&
+            dpkg-buildpackage -S -nc -uc -us'""")
+}
+
+/*
+ * Build source package using git-buildpackage
+ *
+ * @param dir   Tree to build
+ * @param image Image name to use for build (default debian:sid)
+ * @param snapshot Generate snapshot version (default false)
+ */
+def buildSourceGbp(dir, image="debian:sid", snapshot=false, gitEmail='jenkins@dummy.org', gitName='Jenkins', revisionPostfix="") {
+    def common = new com.mirantis.mk.Common()
+    def jenkinsUID = sh (
+        script: 'id -u',
+        returnStdout: true
+    ).trim()
+    def jenkinsGID = sh (
+        script: 'id -g',
+        returnStdout: true
+    ).trim()
+
+    if (! revisionPostfix) {
+        revisionPostfix = ""
+    }
+
+    def img = docker.image(image)
+    workspace = common.getWorkspace()
+    sh("""docker run -e DEBIAN_FRONTEND=noninteractive -e DEBFULLNAME='${gitName}' -e DEBEMAIL='${gitEmail}' -v ${workspace}:${workspace} -w ${workspace} --rm=true --privileged ${image} /bin/bash -exc '
+            which eatmydata || (apt-get update && apt-get install -y eatmydata) &&
+            export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH:+"\$LD_LIBRARY_PATH:"}/usr/lib/libeatmydata &&
+            export LD_PRELOAD=\${LD_PRELOAD:+"\$LD_PRELOAD "}libeatmydata.so &&
+            apt-get update && apt-get install -y build-essential git-buildpackage sudo &&
+            groupadd -g ${jenkinsGID} jenkins &&
+            useradd -s /bin/bash --uid ${jenkinsUID} --gid ${jenkinsGID} -m jenkins &&
+            cd ${dir} &&
+            sudo -H -u jenkins git config --global user.name "${gitName}" &&
+            sudo -H -u jenkins git config --global user.email "${gitEmail}" &&
+            [[ "${snapshot}" == "false" ]] || (
+                VERSION=`dpkg-parsechangelog --count 1 | grep Version: | sed "s,Version: ,,g"` &&
+                UPSTREAM_VERSION=`echo \$VERSION | cut -d "-" -f 1` &&
+                REVISION=`echo \$VERSION | cut -d "-" -f 2` &&
+                TIMESTAMP=`date +%Y%m%d%H%M` &&
+                if [[ "`cat debian/source/format`" = *quilt* ]]; then
+                    UPSTREAM_BRANCH=`(grep upstream-branch debian/gbp.conf || echo master) | cut -d = -f 2 | tr -d " "` &&
+                    UPSTREAM_REV=`git rev-parse --short origin/\$UPSTREAM_BRANCH` &&
+                    NEW_UPSTREAM_VERSION="\$UPSTREAM_VERSION+\$TIMESTAMP.\$UPSTREAM_REV" &&
+                    NEW_VERSION=\$NEW_UPSTREAM_VERSION-\$REVISION$revisionPostfix &&
+                    echo "Generating new upstream version \$NEW_UPSTREAM_VERSION" &&
+                    sudo -H -u jenkins git tag \$NEW_UPSTREAM_VERSION origin/\$UPSTREAM_BRANCH &&
+                    sudo -H -u jenkins git merge -X theirs \$NEW_UPSTREAM_VERSION
+                else
+                    NEW_VERSION=\$VERSION+\$TIMESTAMP.`git rev-parse --short HEAD`$revisionPostfix
+                fi &&
+                sudo -H -u jenkins gbp dch --auto --multimaint-merge --ignore-branch --new-version=\$NEW_VERSION --distribution `lsb_release -c -s` --force-distribution &&
+                sudo -H -u jenkins git add -u debian/changelog &&
+                sudo -H -u jenkins git commit -m "New snapshot version \$NEW_VERSION"
+            ) &&
+            gbp buildpackage -nc --git-force-create --git-notify=false --git-ignore-branch --git-ignore-new --git-verbose --git-export-dir=../build-area -S -uc -us'""")
+}
+
+/*
+ * Run lintian checks
+ *
+ * @param changes   Changes file to test against
+ * @param profile   Lintian profile to use (default debian)
+ * @param image     Image name to use for build (default debian:sid)
+ */
+def runLintian(changes, profile="debian", image="debian:sid") {
+    def common = new com.mirantis.mk.Common()
+    def img = docker.image(image)
+    workspace = common.getWorkspace()
+    sh("""docker run -e DEBIAN_FRONTEND=noninteractive -v ${workspace}:${workspace} -w ${workspace} --rm=true --privileged ${image} /bin/bash -c '
+            apt-get update && apt-get install -y lintian &&
+            lintian -Ii -E --pedantic --profile=${profile} ${changes}'""")
+}
