--- /dev/null
+#!/bin/bash
+DISTRIBUTION=$1
+VERSION=$2
+COMMENT=$3
+SCRIPTNAME=${0##*/}
+
+function cleanup {
+ echo cleaning up ...
+
+ # revert changelog changes
+ git checkout -- debian/changelog
+
+ # remove files created by debian build
+ git clean -fd debian
+
+ echo cleaup done
+}
+
+function failIfFailed
+{
+ echo executing: \'$@\' ...
+ $@
+ RET_CODE=$?
+ if [[ "${RET_CODE}" != "0" ]]
+ then
+ echo command \'$@\' failed
+ cleanup
+ exit 4
+
+ fi
+ echo done
+}
+
+function usage
+{
+ echo 'Usage:' ${SCRIPTNAME} '<DISTRIBUTION> <VERSION> <COMMENT>'
+ exit $1
+}
+
+function validateInput
+{
+ if [[ -z "${DISTRIBUTION}" ]]
+ then
+ echo "Need to specify distribution"
+ usage 1
+ fi
+
+ if [[ -z "${VERSION}" ]]
+ then
+ echo "Need to specify version"
+ usage 2
+ fi
+
+ if [[ -z "${COMMENT}" ]]
+ then
+ echo "Need to specify Comment"
+ usage 3
+ fi
+
+}
+
+function goUp
+{
+ cd ..
+}
+
+goUp
+
+validateInput
+
+# change version in changelog
+failIfFailed dch -D${DISTRIBUTION} -v ${VERSION} ${COMMENT}
+
+
+#build debian package
+failIfFailed dpkg-buildpackage -us -uc
+
+# upload to reprepro
+# TODO: implement
+
+cleanup
+