fix for revision number in ubuntu/debian (patch from heini, untested)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8118 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-04-04 15:37:54 +00:00
parent 81bbb9933d
commit a4f6500772
5 changed files with 83 additions and 125 deletions

View file

@ -3,15 +3,15 @@
###################### PARAMETERS #################### ###################### PARAMETERS ####################
version="0.6.0" version="0.6.0"
svnpath="svn://csoler@svn.code.sf.net/p/retroshare/code/" svnpath="svn://csoler@svn.code.sf.net/p/retroshare/code/"
workdir=retroshare06-$version workdir=retroshare06-${version}
#bubba3="Y" # comment out to compile for bubba3 #bubba3="Y" # comment out to compile for bubba3
###################################################### ######################################################
echo This script is going to build the debian source package for RetroShare, from the svn. echo This script is going to build the debian source package for RetroShare, from the SVN repository.
if test -d "$workdir" ; then if test -d "${workdir}" ; then
echo Removing the $workdir directory... echo Removing the ${workdir} directory...
rm -rf $workdir rm -rf ${workdir}
fi fi
# Parse options # Parse options
@ -19,128 +19,111 @@ svnrev=""
dist="" dist=""
# This is the key for "Cyril Soler <csoler@sourceforge.net>" # This is the key for "Cyril Soler <csoler@sourceforge.net>"
gpgkey="C737CA98" gpgkey="C737CA98"
while [ $# -gt 0 ]; do while [ ${#} -gt 0 ]; do
case $1 in case ${1} in
"-rev") shift "-rev") shift
svnrev=$1 svnrev=${1}
shift shift
;; ;;
"-distribution") shift "-distribution") shift
dist=$1 dist=${1}
shift shift
;; ;;
"-key") shift "-key") shift
gpgkey=$1 gpgkey=${1}
shift shift
;; ;;
"-h") shift "-h") shift
echo Package building script for debian/ubuntu distributions echo Package building script for debian/ubuntu distributions
echo Usage: echo Usage:
echo " "$0 '-key [PGP key id] -rev [svn revision number] -distribution [distrib name list with quotes, in (wheezy, sid, precise, saucy, etc)]' echo " "${0} '-key [PGP key id] -rev [svn revision number] -distribution [distrib name list with quotes, in (wheezy, sid, precise, saucy, etc)]'
exit 1 exit 1
;; ;;
"*") echo "Unknown option" "*") echo "Unknown option"
exit 1 exit 1
;; ;;
esac esac
done done
echo " "Using PGP key id : $gpgkey echo " "Using PGP key id : ${gpgkey}
echo " "Using distributions: $dist echo " "Using distributions: ${dist}
echo " "Using svn : $rev echo " "Using svn : ${rev}
echo Updating svn... echo Updating SVN...
svn update svn update
if test "$svnrev" = "" ; then if test "${svnrev}" = "" ; then
echo attempting to get svn revision number... echo Attempting to get SVN revision number...
svnrev=`svn info | grep 'Revision:' | cut -d\ -f2` svnrev=`svn info|awk '/^Revision:/ {print $NF}'`
else else
echo svn number has been provided. Forcing update. echo SVN number has been provided. Forcing update.
fi fi
echo done. echo Done.
version="$version"."$svnrev" version="${version}"."${svnrev}"
echo got version number $version. echo Got version number ${version}.
echo Please check that the changelog is up to date. echo Please check that the changelog is up to date.
echo Hit ENTER if this is correct. Otherwise hit Ctrl+C echo Hit ENTER if this is correct. Otherwise hit Ctrl+C
read tmp read tmp
packages="." packages="."
echo SVN number is $svnrev echo SVN number is ${svnrev}
echo version is $version echo Version is ${version}
echo Extracting base archive... echo Extracting base archive...
mkdir -p $workdir/src mkdir -p ${workdir}/src
cp -r data $workdir/src/ cp -r data ${workdir}/src/
cp -r debian $workdir/debian cp -r debian ${workdir}/debian
echo Checking out latest snapshot in libbitdht... echo Checking out latest snapshot...
cd $workdir/src/ cd ${workdir}/src
svn co -r$svnrev $svnpath/trunk/ . svn co -r${svnrev} ${svnpath}/trunk/ .
cd ../.. cd -
# VOIP tweak # VOIP tweak
cp $workdir/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui $workdir/src/plugins/VOIP/gui/PopupChatDialog.ui cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui
# handling of libssh # handling of libssh
#LIBSSH_VERSION=0.5.4
#LIBSSH_DIR=41
#LIBSSH_LOCATION=https://red.libssh.org/attachments/download/${LIBSSH_DIR}/libssh-${LIBSSH_VERSION}.tar.gz
LIBSSH_VERSION=0.6.4 LIBSSH_VERSION=0.6.4
LIBSSH_DIR=107
LIBSSH_LOCATION=https://git.libssh.org/projects/libssh.git/snapshot/libssh-${LIBSSH_VERSION}.tar.gz LIBSSH_LOCATION=https://git.libssh.org/projects/libssh.git/snapshot/libssh-${LIBSSH_VERSION}.tar.gz
[ -f libssh-${LIBSSH_VERSION}.tar.gz ] || wget --no-check-certificate -O libssh-${LIBSSH_VERSION}.tar.gz $LIBSSH_LOCATION [ -f libssh-${LIBSSH_VERSION}.tar.gz ] || wget --no-check-certificate -O libssh-${LIBSSH_VERSION}.tar.gz $LIBSSH_LOCATION
cd $workdir cd ${workdir}
tar zxvf ../libssh-${LIBSSH_VERSION}.tar.gz tar zxvf ../libssh-${LIBSSH_VERSION}.tar.gz
cd ..
# cd $workdir # Cloning sqlcipher
# git clone https://github.com/sqlcipher/sqlcipher.git # git clone https://github.com/sqlcipher/sqlcipher.git
# cd ..
# cleaning up protobof generated files # cleaning up protobof generated files
\rm -f $workdir/src/retroshare-nogui/src/rpc/proto/gencc/*.pb.h rm -f src/retroshare-nogui/src/rpc/proto/gencc/*.pb.h
\rm -f $workdir/src/retroshare-nogui/src/rpc/proto/gencc/*.pb.cc rm -f src/retroshare-nogui/src/rpc/proto/gencc/*.pb.cc
echo Setting version numbers... echo Setting version numbers...
# setup version numbers # setup version numbers
cat $workdir/src/libretroshare/src/retroshare/rsversion.h | grep -v RS_REVISION | grep -v RS_REVISION_NUMBER > /tmp/toto2342 sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER ${svnrev}%" src/libretroshare/src/retroshare/rsversion.in >src/libretroshare/src/retroshare/rsversion.h
echo \#define RS_REVISION \"Revision: "$version" date : `date`\" >> /tmp/toto2342
echo \#define RS_REVISION_NUMBER $svnrev >> /tmp/toto2342
cp /tmp/toto2342 $workdir/src/libretroshare/src/retroshare/rsversion.h
cat $workdir/src/retroshare-gui/src/util/rsguiversion.h | grep -v GUI_REVISION | grep -v GUI_VERSION > /tmp/toto4463
echo \#define GUI_REVISION \"Revision: "$version" date : `date`\" >> /tmp/toto4463
echo \#define GUI_VERSION \"Revision: "$svnrev"\" >> /tmp/toto4463
cp /tmp/toto4463 $workdir/src/retroshare-gui/src/util/rsguiversion.h
# Various cleaning # Various cleaning
echo Cleaning... echo Cleaning...
find $workdir -name ".svn" -exec rm -rf {} \; # remove all svn repositories find . -depth -name ".svn" -a -type d -exec rm -rf {} \; # remove all svn repositories
#echo Calling debuild... echo Calling debuild...
#cat $workdir/debian/control | sed -e s/XXXXXX/"$version"/g > $workdir/debian/control.tmp for i in ${dist}; do
#mv -f $workdir/debian/control.tmp $workdir/debian/control echo copying changelog for ${i}
sed -e s/XXXXXX/"${svnrev}"/g -e s/YYYYYY/"${i}"/g ../changelog > debian/changelog
cd $workdir if test "${i}" = "lucid" ; then
cp ../control.ubuntu_lucid debian/control
elif test "${i}" = "squeeze" ; then
cp ../control.squeeze_bubba3 debian/control
else
cp ../debian/control debian/control
fi
for i in $dist; do debuild -S -k${gpgkey}
echo copying changelog for $i
sed -e s/XXXXXX/"$svnrev"/g -e s/YYYYYY/"$i"/g ../changelog > debian/changelog
if test "$i" = "lucid" ; then
cp ../control.ubuntu_lucid debian/control
elif test "$i" = "squeeze" ; then
cp ../control.squeeze_bubba3 debian/control
else
cp ../debian/control debian/control
fi
debuild -S -k$gpgkey
done done
cd -
exit 0

View file

@ -2,4 +2,4 @@
#define RS_MINOR_VERSION 6 #define RS_MINOR_VERSION 6
#define RS_BUILD_NUMBER 0 #define RS_BUILD_NUMBER 0
#define RS_BUILD_NUMBER_ADD "x" // <-- do we need this? #define RS_BUILD_NUMBER_ADD "x" // <-- do we need this?
#define RS_REVISION_NUMBER 7843 #define RS_REVISION_NUMBER 0000

View file

@ -3,7 +3,6 @@
#don't exit even if a command fails #don't exit even if a command fails
set +e set +e
if ( git log -n 1 &> /dev/null); then if ( git log -n 1 &> /dev/null); then
#retrieve git information #retrieve git information
version="git : $(git status | grep branch | cut -c 13-) $(git log -n 1 | grep commit | cut -c 8-)" version="git : $(git status | grep branch | cut -c 13-) $(git log -n 1 | grep commit | cut -c 8-)"
@ -11,22 +10,19 @@ fi
if ( git log -n 1 | grep svn &> /dev/null); then if ( git log -n 1 | grep svn &> /dev/null); then
#retrieve git svn information #retrieve git svn information
version="$version svn : $(git log -n 1 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')" version="${version} svn : $(git log -n 1 | awk '/svn/ {print $2}' | head -1 | sed 's/.*@//')"
elif ( git log -n 10 | grep svn &> /dev/null); then elif ( git log -n 10 | grep svn &> /dev/null); then
#retrieve git svn information #retrieve git svn information
version="$version svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')" version="${version} svn closest version : $(git log -n 10 | awk '/svn/ {print $2}' | head -1 | sed 's/.*@//')"
fi fi
if ( svn info &> /dev/null); then if ( svn info &> /dev/null); then
version=$(svn info | grep '^Revision:') version=$(svn info | awk '/^Revision:/ {print $NF}')
fi fi
if [[ $version != '' ]]; then if [[ ${version} != '' ]]; then
version_number=`echo $version | cut -d: -f2` echo "Writing version to retroshare/rsversion.h : ${version}"
version="$version date : $(date +'%T %m.%d.%y')" sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER ${version}%" retroshare/rsversion.in >retroshare/rsversion.h
echo "Writing version to util/rsversion.h : $version "
sed -i "s/SVN_REVISION .*/SVN_REVISION \"$version\"/g" util/rsversion.h
sed -i "s/SVN_REVISION_NUMBER .*/SVN_REVISION_NUMBER $version_number/g" util/rsversion.h
fi fi
echo "script version_detail.sh finished normally" echo "script version_detail.sh finished normally"
exit 0 exit 0

View file

@ -1,3 +1,5 @@
Retroshare Gui version :
Svn version : 8013
Fr 13. Mär 16:32:53 CET 2015

View file

@ -13,41 +13,18 @@ if (ls &> /dev/null); then
fi fi
if ( /usr/bin/git log -n 1 | grep svn &> /dev/null); then if ( /usr/bin/git log -n 1 | grep svn &> /dev/null); then
#retrieve git svn information #retrieve git svn information
echo "Svn version : $(git log -n 1 | grep svn | awk '{print $2}' | head -1)" >> gui/help/version.html echo "Svn version : $(git log -n 1 | awk '/svn/ {print $2}' | head -1)" >> gui/help/version.html
elif ( /usr/bin/git log -n 10 | grep svn &> /dev/null); then elif ( /usr/bin/git log -n 10 | grep svn &> /dev/null); then
#retrieve git svn information #retrieve git svn information
echo "Svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1)" >> gui/help/version.html echo "Svn closest version : $(git log -n 10 | awk '/svn/ {print $2}' | head -1)" >> gui/help/version.html
fi fi
if ( /usr/bin/svn info &> /dev/null); then if ( /usr/bin/svn info &> /dev/null); then
echo "Svn version : $(svn info | grep '^Revision:')" >> gui/help/version.html echo "Svn version : $(svn info | awk '/^Revision:/ {print $NF}')" >> gui/help/version.html
fi fi
date >> gui/help/version.html date >> gui/help/version.html
echo "" >> gui/help/version.html echo "" >> gui/help/version.html
echo "" >> gui/help/version.html echo "" >> gui/help/version.html
fi fi
#write the rsguiversion.h file
if ( git log -n 1 &> /dev/null); then
#retrieve git information
version="git : $(git status | grep branch | cut -c 6-) $(git log -n 1 | grep commit)"
fi
if ( git log -n 1 | grep svn &> /dev/null); then
#retrieve git svn information
version="$version svn : $(git log -n 1 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')"
elif ( git log -n 10 | grep svn &> /dev/null); then
#retrieve git svn information
version="$version svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')"
fi
if ( svn info &> /dev/null); then
version=$(svn info | grep '^Revision:')
fi
if [[ $version != '' ]]; then
version="$version date : $(date +'%T %m.%d.%y')"
echo "Writing version to util/rsguiversion.h : $version "
sed -i "s/GUI_REVISION .*/GUI_REVISION \"$version\"/g" util/rsguiversion.h
fi
echo "version_detail.sh scripts finished" echo "version_detail.sh scripts finished"
exit 0 exit 0