Skip to content

Commit

Permalink
redid the fpm preflight check section
Browse files Browse the repository at this point in the history
  • Loading branch information
BIAndrews committed Apr 14, 2015
1 parent 0aefccb commit 9aeccd5
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions contrib/fpm-createPackages.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,59 @@
#
# PREFLIGHT CHECK FOR REQUIRED TOOLS
#

# my build server is centos, could be easy to update this to support debian
if [ ! -x /bin/gcc ];then
yum install gcc
#aptitude install gcc
if [ ! command -v fpm >/dev/null 2>&1 ];then

gem install fpm

if [ ! command -v fpm >/dev/null 2>&1 ];then
echo "Unable to install or find fpm."
exit 1
fi

fi

if [ ! -f /usr/include/ruby.h ];then
yum install ruby-devel
#aptitude install ...
if [ ! command -v gcc >/dev/null 2>&1 ];then

yum install gcc
#aptitude install gcc

fi

if [ ! -x $(which fpm) ];then
gem install fpm
rpm -ql ruby-devel > /dev/null
if [ $? -ne 0 ];then

yum install ruby-devel
#aptitude install ...

fi

#
# LETS GO
#

DIR="fakeroot/"
NAME="sshfail2kml"
DESC="SSH failed login attempts logged and GeoIP info acquired for Google Map KML display in an HTML page. Complete with JSON results and SQLite indexed database for a log rotation friendly setup."
URI="https://github.com/BIAndrews/sshfail2kml"
LIC="GPLv3"
PROV="sshfail2kml"
EMAIL="[email protected]"
if [ ! -f version.sh ];then

if [ ! -f "${PWD}/version.sh" ];then
echo "Unable to find the version.sh file."
pwd
ls -lah .
exit 1
fi
. version.sh

. "${PWD}/version.sh"

if [ $? -ne 0 ];then
echo "ERROR: Failed to include ${PWD}/version.sh"
exit 1
fi

install -d $DIR/var/lib/sshfail2kml $DIR/etc/cron.d $DIR/usr/bin
cp -f ../sshfail2kml $DIR/usr/bin
Expand Down

0 comments on commit 9aeccd5

Please sign in to comment.