Skip to content

Instantly share code, notes, and snippets.

@Luzifer
Last active February 3, 2017 22:41
Show Gist options
  • Save Luzifer/4a89674bf20b6cddd8e73e9c4c46dd82 to your computer and use it in GitHub Desktop.
Save Luzifer/4a89674bf20b6cddd8e73e9c4c46dd82 to your computer and use it in GitHub Desktop.
Publishing lastpass-cli in most recent version into PPA

How to use

I'm using this script to build the package inside a Docker container:

# docker run --rm -ti ubuntu

Afterwards the container needs some preparations:

# cat -s | gpg --import
<paste gpg private key here and press Ctrl+d>
# apt-get update && apt-get install -y curl ca-certificates
# export VERSION=v1.1.0
# export MAINTAINER=...
# export PPA=...

And finally execute the script below

# curl https://gist.githubusercontent.com/Luzifer/4a89674bf20b6cddd8e73e9c4c46dd82/raw/build.sh | bash -ex

At the end it prompts for your GPG password and you're done…

#!/bin/bash -ex
VERSION=${VERSION:-v1.1.0}
MAINTAINER=${MAINTAINER:-Knut Ahlers <[email protected]>}
PPA=${PPA:-ppa:luzifer/manual}
BUILD_NO=${BUILD_NO:-1}
apt-get update
apt-get install -y \
openssl libcurl4-openssl-dev libxml2 libssl-dev libxml2-dev pinentry-curses xclip cmake pkg-config \
devscripts asciidoc libxml2-utils xsltproc docbook-xsl debhelper git
# Code
if [ -e lastpass-cli ]; then
rm -rf lastpass-cli*
fi
git clone https://github.com/lastpass/lastpass-cli.git
cd lastpass-cli/
git checkout ${VERSION}
# Add changelog entry with email we do have a GPG key for
cat -s <<EOF > debian/changelog.new
lastpass-cli (${VERSION/v/}-${BUILD_NO}) $(lsb_release -cs); urgency=medium
* Manual package build for ${VERSION}
-- ${MAINTAINER} $(date -R)
EOF
cat debian/changelog >> debian/changelog.new
mv debian/changelog.new debian/changelog
# Import signing key for email in changelog
#cat -s | gpg --import
# Do a source build
debuild --no-tgz-check -S -sa
cd ..
# Push source build into PPA
dput ${PPA} lastpass-cli_${VERSION/v/}-${BUILD_NO}_source.changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment