2010-02-06 02:25:50 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-01-28 09:29:23 -05:00
|
|
|
###################### PARAMETERS ####################
|
2015-08-01 17:13:44 -04:00
|
|
|
gitpath="https://github.com/RetroShare/RetroShare.git"
|
2018-05-11 10:33:19 -04:00
|
|
|
#branch="master"
|
2018-05-11 14:28:53 -04:00
|
|
|
branch="v0.6.4-official_release"
|
2018-05-09 04:15:32 -04:00
|
|
|
#bubba3="Y" # comment out to compile for bubba3
|
2013-01-28 09:29:23 -05:00
|
|
|
######################################################
|
|
|
|
|
2018-02-19 15:49:06 -05:00
|
|
|
RS_MAJOR_VERSION=`fgrep RS_MAJOR_VERSION ../../libretroshare/src/retroshare/rsversion.h | cut -d\\ -f3- | sed -e s\/\ \/\/g | cut -c1`
|
|
|
|
RS_MINOR_VERSION=`fgrep RS_MINOR_VERSION ../../libretroshare/src/retroshare/rsversion.h | cut -d\\ -f3- | sed -e s\/\ \/\/g | cut -c1`
|
|
|
|
RS_BUILD_NUMBER=`fgrep RS_BUILD_NUMBER ../../libretroshare/src/retroshare/rsversion.h | grep -v BUILD_NUMBER_ADD | cut -d\\ -f3- | sed -e s\/\ \/\/g | cut -c1`
|
|
|
|
|
|
|
|
# echo "RS_MAJOR_VERSION="${RS_MAJOR_VERSION}
|
|
|
|
# echo "RS_MINOR_VERSION="${RS_MINOR_VERSION}
|
|
|
|
# echo "RS_BUILD_NUMBER="${RS_BUILD_NUMBER}
|
|
|
|
|
|
|
|
version_number="${RS_MAJOR_VERSION}"'.'"${RS_MINOR_VERSION}"'.'"${RS_BUILD_NUMBER}"
|
|
|
|
workdir=retroshare-${version_number}
|
|
|
|
|
2015-08-01 17:13:44 -04:00
|
|
|
echo This script is going to build the debian source package for RetroShare, from the Git repository.
|
2010-08-02 06:27:40 -04:00
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
if test -d "${workdir}" ; then
|
|
|
|
echo Removing the ${workdir} directory...
|
|
|
|
rm -rf ${workdir}
|
2010-02-06 02:25:50 -05:00
|
|
|
fi
|
|
|
|
|
2014-12-27 12:15:50 -05:00
|
|
|
# Parse options
|
2015-08-01 17:13:44 -04:00
|
|
|
rev=""
|
2014-12-27 12:15:50 -05:00
|
|
|
dist=""
|
|
|
|
# This is the key for "Cyril Soler <csoler@sourceforge.net>"
|
2015-08-01 17:13:44 -04:00
|
|
|
gpgkey="0932399B"
|
|
|
|
|
2016-09-12 04:15:13 -04:00
|
|
|
date=`git log --pretty=format:"%ai" | head -1 | cut -d\ -f1 | sed -e s/-//g`
|
|
|
|
time=`git log --pretty=format:"%aD" | head -1 | cut -d\ -f5 | sed -e s/://g`
|
|
|
|
hhsh=`git log --pretty=format:"%H" | head -1 | cut -c1-8`
|
|
|
|
|
|
|
|
rev=${date}.${hhsh}
|
2017-12-31 10:22:19 -05:00
|
|
|
useretrotor="false"
|
2016-09-12 04:15:13 -04:00
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
while [ ${#} -gt 0 ]; do
|
|
|
|
case ${1} in
|
|
|
|
"-rev") shift
|
2015-08-01 17:13:44 -04:00
|
|
|
rev=${1}
|
2015-04-04 11:37:54 -04:00
|
|
|
shift
|
|
|
|
;;
|
2017-12-31 10:22:19 -05:00
|
|
|
"-retrotor") shift
|
2018-05-09 04:15:32 -04:00
|
|
|
useretrotor="true"
|
2017-12-31 10:22:19 -05:00
|
|
|
;;
|
2015-04-04 11:37:54 -04:00
|
|
|
"-distribution") shift
|
|
|
|
dist=${1}
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
"-key") shift
|
|
|
|
gpgkey=${1}
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
"-h") shift
|
|
|
|
echo Package building script for debian/ubuntu distributions
|
|
|
|
echo Usage:
|
|
|
|
echo " "${0} '-key [PGP key id] -rev [svn revision number] -distribution [distrib name list with quotes, in (wheezy, sid, precise, saucy, etc)]'
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
"*") echo "Unknown option"
|
|
|
|
exit 1
|
|
|
|
;;
|
2014-12-27 12:15:50 -05:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2017-12-31 12:15:19 -05:00
|
|
|
if test "${useretrotor}" = "true"; then
|
2018-05-09 04:15:32 -04:00
|
|
|
if ! test "${dist}" = "trusty"; then
|
|
|
|
echo ERROR: retro-tor can only be packaged for trusty for now.
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
#gitpath="https://github.com/csoler/RetroShare.git"
|
|
|
|
#branch="v0.6-TorOnly"
|
2017-12-31 12:15:19 -05:00
|
|
|
fi
|
|
|
|
|
2015-04-04 11:52:02 -04:00
|
|
|
if test "${dist}" = "" ; then
|
2018-05-09 04:15:32 -04:00
|
|
|
dist="trusty xenial artful bionic"
|
2015-04-04 11:52:02 -04:00
|
|
|
fi
|
|
|
|
|
2015-08-01 17:13:44 -04:00
|
|
|
echo Attempting to get revision number...
|
|
|
|
ccount=`git rev-list --count --all`
|
|
|
|
ccount=`expr $ccount + 8613 - 8267`
|
2015-01-10 07:47:58 -05:00
|
|
|
|
2018-02-19 15:49:06 -05:00
|
|
|
echo " Workdir :"${workdir}
|
|
|
|
echo " Version :"${version_number}
|
|
|
|
echo " Using revision :"${rev}
|
|
|
|
echo " Commit count :"${ccount}
|
|
|
|
echo " Hash :"${hhsh}
|
|
|
|
echo " Date :"${date}
|
|
|
|
echo " Time :"${time}
|
|
|
|
echo " Using branch :"${branch}
|
|
|
|
echo " Using distributions:"${dist}
|
|
|
|
echo " Using PGP key id :"${gpgkey}
|
2011-02-23 05:49:53 -05:00
|
|
|
|
2017-12-31 10:22:19 -05:00
|
|
|
if test ${useretrotor} = "true"; then
|
2018-05-09 04:15:32 -04:00
|
|
|
echo " "Specific flags : retrotor
|
2017-12-31 10:22:19 -05:00
|
|
|
fi
|
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
echo Done.
|
2018-02-19 15:49:06 -05:00
|
|
|
version="${version_number}"."${rev}"
|
|
|
|
echo Got version number ${version}
|
|
|
|
echo
|
2011-02-23 05:49:53 -05:00
|
|
|
echo Please check that the changelog is up to date.
|
2014-12-27 12:15:50 -05:00
|
|
|
echo Hit ENTER if this is correct. Otherwise hit Ctrl+C
|
2010-08-02 06:27:40 -04:00
|
|
|
read tmp
|
|
|
|
|
|
|
|
echo Extracting base archive...
|
2013-01-28 09:29:23 -05:00
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
mkdir -p ${workdir}/src
|
|
|
|
echo Checking out latest snapshot...
|
|
|
|
cd ${workdir}/src
|
2017-12-31 12:15:19 -05:00
|
|
|
git clone --depth 1 ${gitpath} --single-branch --branch $branch .
|
2017-08-11 13:27:49 -04:00
|
|
|
|
2017-08-11 13:33:23 -04:00
|
|
|
# if ! test "$hhsh" = "" ; then
|
2018-05-09 04:15:32 -04:00
|
|
|
# echo Checking out revision $hhsh
|
|
|
|
# git checkout $hhsh
|
2017-08-11 13:33:23 -04:00
|
|
|
# fi
|
2017-08-11 13:27:49 -04:00
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
cd -
|
2013-01-28 09:29:23 -05:00
|
|
|
|
2015-08-02 12:35:27 -04:00
|
|
|
if ! test -d ${workdir}/src/libretroshare/; then
|
2018-05-09 04:15:32 -04:00
|
|
|
echo Git clone failed.
|
|
|
|
exit
|
2015-08-02 12:35:27 -04:00
|
|
|
fi
|
|
|
|
|
2015-08-01 17:13:44 -04:00
|
|
|
cp -r debian ${workdir}/debian
|
|
|
|
|
2013-01-28 09:29:23 -05:00
|
|
|
# VOIP tweak
|
2015-04-04 11:37:54 -04:00
|
|
|
cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui
|
2013-01-28 09:29:23 -05:00
|
|
|
|
2018-05-11 10:33:19 -04:00
|
|
|
# remove unised qml code, only needed on Android
|
|
|
|
|
|
|
|
rm -rf ${workdir}/src/retroshare-qml-app/
|
2018-05-11 10:39:49 -04:00
|
|
|
rm -rf ${workdir}/src/build_scripts/
|
2018-05-11 11:02:58 -04:00
|
|
|
rm ${workdir}/debian/*~
|
2018-05-11 10:33:19 -04:00
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
# Cloning sqlcipher
|
2014-09-21 10:25:58 -04:00
|
|
|
# git clone https://github.com/sqlcipher/sqlcipher.git
|
2013-06-25 18:02:38 -04:00
|
|
|
|
2015-04-30 16:03:38 -04:00
|
|
|
cd ${workdir}
|
2010-08-02 06:27:40 -04:00
|
|
|
echo Setting version numbers...
|
|
|
|
|
|
|
|
# setup version numbers
|
2015-08-02 12:35:27 -04:00
|
|
|
sed -e "s%RS_REVISION_NUMBER.*%RS_REVISION_NUMBER 0x${hhsh}%" src/libretroshare/src/retroshare/rsversion.in > src/libretroshare/src/retroshare/rsversion.h
|
2010-02-06 02:25:50 -05:00
|
|
|
|
2010-02-06 17:26:30 -05:00
|
|
|
# Various cleaning
|
2010-08-02 06:27:40 -04:00
|
|
|
echo Cleaning...
|
2015-08-02 12:35:27 -04:00
|
|
|
|
|
|
|
\rm -rf src/.git
|
2015-04-04 11:37:54 -04:00
|
|
|
|
|
|
|
echo Calling debuild...
|
|
|
|
for i in ${dist}; do
|
2018-05-09 04:15:32 -04:00
|
|
|
|
|
|
|
if ! test "${i}" = "debian"; then
|
|
|
|
echo copying changelog for ${i}
|
|
|
|
sed -e s/XXXXXX/"${rev}"/g -e s/YYYYYY/"${i}"/g -e s/ZZZZZZ/"${version_number}"/g ../changelog > debian/changelog
|
|
|
|
|
|
|
|
if test ${useretrotor} = "true"; then
|
|
|
|
cp ../rules.retrotor debian/rules
|
|
|
|
cp ../control.trusty_retrotor debian/control
|
|
|
|
elif test -f ../control."${i}" ; then
|
|
|
|
echo \/\!\\ Using specific control file for distribution "${i}"
|
|
|
|
cp ../control."${i}" debian/control
|
|
|
|
else
|
|
|
|
echo Using standard control file control."${i}" for distribution "${i}"
|
|
|
|
cp ../debian/control debian/control
|
|
|
|
fi
|
2015-04-04 11:37:54 -04:00
|
|
|
else
|
2018-05-09 04:15:32 -04:00
|
|
|
echo creating official debian release. Using built-in changelog and control files
|
|
|
|
fi
|
2015-04-04 11:37:54 -04:00
|
|
|
|
2018-05-09 04:15:32 -04:00
|
|
|
debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL
|
2013-03-01 12:46:52 -05:00
|
|
|
done
|
2015-04-04 11:37:54 -04:00
|
|
|
cd -
|
|
|
|
|
|
|
|
exit 0
|