From a38b2bcc2293ca79aa76162684c5405bda9770e2 Mon Sep 17 00:00:00 2001 From: mboelen Date: Sun, 14 Sep 2014 20:54:17 +0200 Subject: [PATCH] Updated build script --- dev/build-lynis.sh | 55 +++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/dev/build-lynis.sh b/dev/build-lynis.sh index d18baeb9..b6837326 100755 --- a/dev/build-lynis.sh +++ b/dev/build-lynis.sh @@ -126,12 +126,12 @@ # Check binaries - BZRBINARY=`which bzr` - if [ ! "${BZRBINARY}" = "" ]; then - echo "[=] bzr = ${BZRBINARY}" + GITBUILDPACKAGEBINARY=`which git-buildpackage` + if [ ! "${GITBUILDPACKAGEBINARY}" = "" ]; then + echo "[=] git-buildpackage = ${GITBUILDPACKAGEBINARY}" else - echo "[X] Can not find bzr binary" - echo " Hint: install bzr" + echo "[X] Can not find git-buildpackage binary" + echo " Hint: install git-buildpackage" ExitFatal fi @@ -235,29 +235,44 @@ echo "[*] Starting with DEB building process" - BZRSTATUS=`${BZRBINARY} status . 2>&1 > /dev/null; echo $?` - if [ "${BZRSTATUS}" = "0" ]; then - echo "[V] bzr has proper directory tree" - DEBCHANGELOGFULLVERSION=`head -1 debian/changelog | awk '{ print $2 }' | sed 's/(//' | sed 's/)//'` + DEBCHANGELOGFULLVERSION=`head -1 ../debian/changelog | awk '{ print $2 }' | sed 's/(//' | sed 's/)//'` DEBCHANGELOGVERSION=`echo ${DEBCHANGELOGFULLVERSION} | awk -F- '{ print $1 }'` DEBCHANGELOGVERSIONREV=`echo ${DEBCHANGELOGFULLVERSION} | awk -F- '{ print $2 }'` - echo "[=] Version in Debian changelog: ${DEBCHANGELOGVERSION} (revision: ${DEBCHANGELOGVERSIONREV})" if [ "${LYNIS_VERSION}" = "${DEBCHANGELOGVERSION}" ]; then echo "[V] Debian/changelog up-to-date" else echo "[X] Debian/changelog outdated" ExitFatal fi - # execute command - # bzr builddeb . --build-dir ${DEBWORKDIR}/build-area/ --result-dir ${DEBWORKDIR} - elif [ "${BZRSTATUS}" = "3" ]; then - echo "[X] Tree is not initialized for BZR" - echo " Hint: run bzr init while being in lynis directory (or bzr init ..)" - ExitFatal - else - echo "[X] Unknown error" - echo "Output: ${BZRSTATUS}" - fi + +# BZRSTATUS=`${BZRBINARY} status . 2>&1 > /dev/null; echo $?` +# if [ "${BZRSTATUS}" = "0" ]; then +# echo "[V] bzr has proper directory tree" +# DEBCHANGELOGFULLVERSION=`head -1 debian/changelog | awk '{ print $2 }' | sed 's/(//' | sed 's/)//'` +# DEBCHANGELOGVERSION=`echo ${DEBCHANGELOGFULLVERSION} | awk -F- '{ print $1 }'` +# DEBCHANGELOGVERSIONREV=`echo ${DEBCHANGELOGFULLVERSION} | awk -F- '{ print $2 }'` +# echo "[=] Version in Debian changelog: ${DEBCHANGELOGVERSION} (revision: ${DEBCHANGELOGVERSIONREV})" +# if [ "${LYNIS_VERSION}" = "${DEBCHANGELOGVERSION}" ]; then +# echo "[V] Debian/changelog up-to-date" +# else +# echo "[X] Debian/changelog outdated" +## ExitFatal +# fi +# # execute command +# # bzr builddeb . --build-dir ${DEBWORKDIR}/build-area/ --result-dir ${DEBWORKDIR} +# elif [ "${BZRSTATUS}" = "3" ]; then +# echo "[X] Tree is not initialized for BZR" +# echo " Hint: run bzr init while being in lynis directory (or bzr init ..)" +# ExitFatal +# else +# echo "[X] Unknown error" +# echo "Output: ${BZRSTATUS}" +# fi + + cd .. + git-buildpackage --git-tarball-dir=${MYBUILDIDR} --git-export-dir=${DEBWORKDIR} + cd ${MYWORKDIR} + echo "[V] Done"