Skip to content

Instantly share code, notes, and snippets.

@rcrowley
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcrowley/9338082 to your computer and use it in GitHub Desktop.
Save rcrowley/9338082 to your computer and use it in GitHub Desktop.
BUILD="betable3"
set -e -x
cd "$(mktemp -d)"
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM
git clone "git://github.com/s3tools/s3cmd.git"
mkdir -p "usr/bin" "usr/lib/python2.7/dist-packages" "usr/share/man/man1"
export PYTHONPATH="usr/lib/python2.7/dist-packages"
cp "s3cmd/s3cmd" "usr/bin"
cp -R "s3cmd/S3" "usr/lib/python2.7/dist-packages"
python -m"compileall" "usr/lib/python2.7/dist-packages"
cp -R "s3cmd/s3cmd.1" "usr/share/man/man1"
gzip "usr/share/man/man1/s3cmd.1"
VERSION="$(python -c"import S3.PkgInfo; print(S3.PkgInfo.version)")"
VERSION="${VERSION%%-*}"
fakeroot fpm -a "all" \
-d "python" \
-m "Richard Crowley <richard@betable.com>" \
-n "s3cmd" -v "$VERSION-$BUILD" \
-p "$OLDPWD/s3cmd_${VERSION}-${BUILD}_all.deb" \
-s "dir" -t "deb" "usr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment