Skip to content

Instantly share code, notes, and snippets.

@ryanobjc
Created July 16, 2012 21:22
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 ryanobjc/3125143 to your computer and use it in GitHub Desktop.
Save ryanobjc/3125143 to your computer and use it in GitHub Desktop.
#!/bin/bash
JAVAPATH=$1
BN=`basename $JAVAPATH`
if [ ${BN:0:3} != 'jdk' ] ; then
echo "Error, path $JAVAPATH doesnt seem to be a JDK path, which normally starts with 'jdk'"
exit 1
fi
. ./generate-java-post.sh $BN
. ./generate-java-remove.sh $BN
VERSION=${BN:3}
rm -f dts-java_$VERSION*.rpm
rm -f dts-java_$VERSION*.deb
for pkgtype in deb rpm ; do
fpm -s dir -t $pkgtype --prefix /usr/lib/jvm -p dts-java_${VERSION}_amd64.$pkgtype -n dts-java -v $VERSION --after-install java-post.sh --after-remove java-remove.sh -C `dirname $JAVAPATH` $BN
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment