Skip to content

Instantly share code, notes, and snippets.

@llasram
Created August 6, 2013 20:49
Show Gist options
  • Select an option

  • Save llasram/6168499 to your computer and use it in GitHub Desktop.

Select an option

Save llasram/6168499 to your computer and use it in GitHub Desktop.
Package Leiningen via fpm
#! /bin/bash -e
PACKAGE=leiningen
VERSION=2.1.2
ITERATION=1
DEBVERSION=${VERSION}+dbla.${ITERATION}
BINDIR=/opt/damballa/bin
LIBDIR=/opt/damballa/lib/leiningen
rm -rf ./root/
mkdir -p ./root/$BINDIR
(
cd ./root/$BINDIR
curl -O https://raw.github.com/technomancy/leiningen/$VERSION/bin/lein
sed -ri \
-e "s,^(LEIN_JAR=\")\\\$LEIN_HOME/self-installs,\\1${LIBDIR}," \
-e 's,\[ "\$1" = "(self-install|upgrade)" \],false,' \
lein
chmod a+x lein
ln -s lein lein2
)
mkdir -p ./root/$LIBDIR
(
cd ./root/$LIBDIR
prefix=https://leiningen.s3.amazonaws.com/downloads
curl -O $prefix/leiningen-$VERSION-standalone.jar
)
rm -f ./${PACKAGE}_*.deb
fakeroot fpm -s dir -t deb \
-n $PACKAGE -v $DEBVERSION \
-d java-runtime \
-C root .
rm -rf ./root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment