diff options
author | Oliver Poignant <oliver@poignant.se> | 2016-03-13 23:07:50 +0100 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2016-03-13 23:07:50 +0100 |
commit | 2465cfc4a3669282523daf168e8c408880f3dd4d (patch) | |
tree | 18abeadf13559334abe17044f80dea3fa6f3ccbe /platforms/debian/scripts/create-debian-package.sh | |
parent | 5a8caf8b9c9f4f283dffac33b461b5c43ad64eed (diff) | |
parent | 86ff375bf4c4b6c04ab44ea4be7dd90730f824c1 (diff) | |
download | Git-Auto-Deploy-2465cfc4a3669282523daf168e8c408880f3dd4d.zip Git-Auto-Deploy-2465cfc4a3669282523daf168e8c408880f3dd4d.tar.gz Git-Auto-Deploy-2465cfc4a3669282523daf168e8c408880f3dd4d.tar.bz2 |
Merge pull request #77 from olipo186/developmentv0.2.0
Development
Diffstat (limited to 'platforms/debian/scripts/create-debian-package.sh')
-rwxr-xr-x | platforms/debian/scripts/create-debian-package.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/platforms/debian/scripts/create-debian-package.sh b/platforms/debian/scripts/create-debian-package.sh new file mode 100755 index 0000000..d103416 --- /dev/null +++ b/platforms/debian/scripts/create-debian-package.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# +# This script compiles a binary Debian package (.deb) +# + +# Get current path +ORIGINAL_CWD=`pwd -P` + +# Get script path (<path>/Git-Auto-Deploy/platforms/debian/scripts) +pushd `dirname $0` > /dev/null +SCRIPT_PATH=`pwd -P` +popd > /dev/null + +# Path to Git-Auto-Deploy project directory +PROJECT_PATH=`readlink -f $SCRIPT_PATH/../../../` +cd $PROJECT_PATH + +# Get package name and version +PACKAGE_NAME=`python setup.py --name` +PACKAGE_VERSION=`python setup.py --version` + +# Generate a Debian source package +echo +echo "** Generating a Debian source package **" +python setup.py --command-packages=stdeb.command sdist_dsc -x platforms/debian/stdeb.cfg + +# Path to newly generated deb_dist directory +TARGET=`readlink -f "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION"` + +# Copy configuration files +echo +echo "** Copying configuration files **" +cp -vr "$PROJECT_PATH/platforms/debian/stdeb"/* "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/" +#cp -vrp "$PROJECT_PATH/platforms/debian/etc"/* "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/" +#cp -vrp "$PROJECT_PATH/platforms/debian/etc"/* "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/source" +#mkdir "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/gitautodeploy" +#mkdir "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/git-auto-deploy" +#mkdir "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/tmp" +#cp -vrp "$PROJECT_PATH/platforms/debian/etc"/* "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/gitautodeploy" +#cp -vrp "$PROJECT_PATH/platforms/debian/etc"/* "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/debian/tmp" +#cp -vrp "$PROJECT_PATH/platforms/debian/etc"/* "$PROJECT_PATH/deb_dist/$PACKAGE_NAME-$PACKAGE_VERSION/gitautodeploy" + +# Copile a Debian binary package +echo +echo "** Compiling a Debian binary package **" +cd "$PROJECT_PATH/deb_dist/"* + +#dpkg-source --commit + +dpkg-buildpackage -rfakeroot -uc -us + +# Restore cwd +cd $ORIGINAL_CWD
\ No newline at end of file |