diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-14 18:27:31 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-14 18:27:31 -0600 |
commit | 19bc61f5b70a4117ba7bd45f8519c642148a0fbf (patch) | |
tree | d6fcc8add9ca11b0eff8fe10033f314d3948b36f /redhat/genrpm.sh | |
parent | 9cdd60304e49a4037b326ddbaac7c038383fbdf7 (diff) | |
parent | 35bee9455536ec115fddfa30cdbd2dcade240cfb (diff) | |
download | tde-packaging-19bc61f5b70a4117ba7bd45f8519c642148a0fbf.tar.gz tde-packaging-19bc61f5b70a4117ba7bd45f8519c642148a0fbf.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tde-packaging
Diffstat (limited to 'redhat/genrpm.sh')
-rwxr-xr-x | redhat/genrpm.sh | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/redhat/genrpm.sh b/redhat/genrpm.sh index 25ea69be1..c0627d032 100755 --- a/redhat/genrpm.sh +++ b/redhat/genrpm.sh @@ -5,6 +5,7 @@ cd "$( dirname "$0" )" while [ $# -gt 0 ]; do case "$1" in "--auto") AUTO=1;; + "--version") REQVERSION="$2"; shift;; *) COMP="$1";; esac shift @@ -12,6 +13,7 @@ done clear cat <<EOF +$(< /etc/redhat-release) $(uname -m) This script generates RPM of TDE from source tarball. Please choose a TDE component to build. @@ -38,14 +40,20 @@ VERSION=$( awk '{ if ($1 == "'${COMP}'") { print $2; } }' components.txt ) # If no version is set in text file, get version number from source tarball name if [ -z "${VERSION}" ]; then - set $( cd "${COMP}"; echo ${COMP##*/}*.tar.gz) + if [ -n "${REQVERSION}" ]; then + set $( cd "${COMP}"; echo ${COMP##*/}*-${REQVERSION}.tar.gz) + else + set $( cd "${COMP}"; echo ${COMP##*/}*.tar.gz) + fi if [ $# -gt 1 ]; then select VERSION in $*; do break; done elif [ -r "${COMP}/$1" ]; then VERSION="$1" + elif [ "${COMP}" = "trinity-live" ]; then + VERSION="3.5.13" else echo "No source tarball found for '${COMP}' !" - continue + exit 0 fi VERSION="${VERSION##${COMP##*/}-}" VERSION="${VERSION%%.tar.gz}" @@ -57,7 +65,12 @@ fi # Chooses a spec file (if many) set $( cd "${COMP}"; echo *.spec ) if [ $# -gt 1 ]; then - select SPEC in $*; do break; done + if [ -n "${REQVERSION}" ]; then + set $( cd "${COMP}"; echo *-${REQVERSION}.spec ) + SPEC="$1" + else + select SPEC in $*; do break; done + fi elif [ -r "${COMP}/$1" ]; then SPEC="$1" else @@ -84,7 +97,9 @@ esac if [ "$(rpm -q --qf '%{arch}' kernel)" = "i686" ]; then ARGS="${ARGS} --target=i686" fi - + +LOGFILE=/tmp/log.${COMP##*/} + set -x ( rpmbuild -ba \ @@ -93,6 +108,18 @@ rpmbuild -ba \ --define "version ${VERSION:-3.5.13}" \ $ARGS \ ${COMP}/${SPEC} || exit 1 -) 2>&1 | tee /tmp/log +) 2>&1 | tee ${LOGFILE} +RET=$? set +x +if [ ${RET} -gt 0 ]; then + exit ${RET} +fi + +if grep -q "error: Failed build dependencies:" ${LOGFILE}; then +# DEPS=$( sed -n -e "/.* is needed by .*/ s/^[ \t]*\([a-zA-Z2-9_-]*\) .*/\1/p" ${LOGFILE} ) + set $( grep " is needed by " ${LOGFILE} | cut -d " " -f1 ) + exit 2 +fi + + |