add script to tag release and build deb

This commit is contained in:
Jeffrey Forman 2014-01-20 21:01:09 -05:00
parent e48f4ad5b0
commit e78b215327
1 changed files with 37 additions and 0 deletions

37
tagrelease-builddpkg.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# Usage: ./build-dpkg.sh $version $prefix
# Example: ./build-dpkg.sh 3.14 /usr/local
if [[ "$#" -lt 2 ]]; then
echo "You did not provide enough command line parameters. Example: tagrelease-builddpkg \$version \$prefix"
exit 1
fi
if [ -x "`which fpm`" ]; then
echo "FPM found, attempting to build package."
else
echo "Unable to find 'fpm', which is required to build package tarball. See https://github.com/jordansissel/fpm."
exit 1
fi
version="$1"
package_name="binder-$version.deb"
prefix="$2"
git tag -a "v$version" -m "binder v$"
fpm -s dir -t deb -n binder \
-v $version \
--package $package_name \
-x ".git" \
--prefix "$prefix/binder" \
`dirname $0`
if [ $? -ne 0 ]; then
echo "fpm executed exited with an error. Package was not built correctly."
exit
fi
echo "Package built as $package_name."
echo "Don't forget to run 'git push --tags"