2010-02-06 07:25:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-01-28 14:29:23 +00:00
|
|
|
###################### PARAMETERS ####################
|
2015-08-01 23:13:44 +02:00
|
|
|
gitpath="https://github.com/RetroShare/RetroShare.git"
|
2018-06-01 22:27:59 +02:00
|
|
|
branch="master"
|
|
|
|
#branch="v0.6.4-official_release"
|
2018-05-09 10:15:32 +02:00
|
|
|
#bubba3="Y" # comment out to compile for bubba3
|
2013-01-28 14:29:23 +00:00
|
|
|
######################################################
|
|
|
|
|
2018-12-18 20:40:38 +01:00
|
|
|
RS_MAJOR_VERSION=0
|
|
|
|
RS_MINOR_VERSION=6
|
|
|
|
RS_BUILD_NUMBER=4
|
2018-02-19 21:49:06 +01:00
|
|
|
|
|
|
|
# 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 23:13:44 +02:00
|
|
|
echo This script is going to build the debian source package for RetroShare, from the Git repository.
|
2010-08-02 10:27:40 +00:00
|
|
|
|
2015-04-04 15:37:54 +00:00
|
|
|
if test -d "${workdir}" ; then
|
|
|
|
echo Removing the ${workdir} directory...
|
|
|
|
rm -rf ${workdir}
|
2010-02-06 07:25:50 +00:00
|
|
|
fi
|
|
|
|
|
2014-12-27 17:15:50 +00:00
|
|
|
# Parse options
|
2015-08-01 23:13:44 +02:00
|
|
|
rev=""
|
2014-12-27 17:15:50 +00:00
|
|
|
dist=""
|
|
|
|
# This is the key for "Cyril Soler <csoler@sourceforge.net>"
|
2015-08-01 23:13:44 +02:00
|
|
|
gpgkey="0932399B"
|
|
|
|
|
2016-09-12 10:15:13 +02: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`
|
2018-06-01 22:27:59 +02:00
|
|
|
hhsh=`git log --pretty=format:"%H" | head -1 | cut -c1-8`
|
2016-09-12 10:15:13 +02:00
|
|
|
|
|
|
|
rev=${date}.${hhsh}
|
2017-12-31 16:22:19 +01:00
|
|
|
useretrotor="false"
|
2016-09-12 10:15:13 +02:00
|
|
|
|
2015-04-04 15:37:54 +00:00
|
|
|
while [ ${#} -gt 0 ]; do
|
|
|
|
case ${1} in
|
|
|
|
"-rev") shift
|
2015-08-01 23:13:44 +02:00
|
|
|
rev=${1}
|
2015-04-04 15:37:54 +00:00
|
|
|
shift
|
|
|
|
;;
|
2017-12-31 16:22:19 +01:00
|
|
|
"-retrotor") shift
|
2018-05-09 10:15:32 +02:00
|
|
|
useretrotor="true"
|
2017-12-31 16:22:19 +01:00
|
|
|
;;
|
2015-04-04 15:37:54 +00: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 17:15:50 +00:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2017-12-31 18:15:19 +01:00
|
|
|
if test "${useretrotor}" = "true"; then
|
2018-05-09 10:15:32 +02: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 18:15:19 +01:00
|
|
|
fi
|
|
|
|
|
2015-04-04 15:52:02 +00:00
|
|
|
if test "${dist}" = "" ; then
|
2018-05-09 10:15:32 +02:00
|
|
|
dist="trusty xenial artful bionic"
|
2015-04-04 15:52:02 +00:00
|
|
|
fi
|
|
|
|
|
2015-08-01 23:13:44 +02:00
|
|
|
echo Attempting to get revision number...
|
|
|
|
ccount=`git rev-list --count --all`
|
|
|
|
ccount=`expr $ccount + 8613 - 8267`
|
2015-01-10 12:47:58 +00:00
|
|
|
|
2018-12-18 23:14:14 +01:00
|
|
|
gitrev=`git describe | cut -d- -f2-3`
|
|
|
|
|
2018-02-19 21:49:06 +01:00
|
|
|
echo " Workdir :"${workdir}
|
|
|
|
echo " Version :"${version_number}
|
|
|
|
echo " Using revision :"${rev}
|
2018-12-18 23:14:14 +01:00
|
|
|
echo " Git Revision :"${gitrev}
|
2018-02-19 21:49:06 +01:00
|
|
|
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 10:49:53 +00:00
|
|
|
|
2017-12-31 16:22:19 +01:00
|
|
|
if test ${useretrotor} = "true"; then
|
2018-05-09 10:15:32 +02:00
|
|
|
echo " "Specific flags : retrotor
|
2017-12-31 16:22:19 +01:00
|
|
|
fi
|
|
|
|
|
2015-04-04 15:37:54 +00:00
|
|
|
echo Done.
|
2018-02-19 21:49:06 +01:00
|
|
|
version="${version_number}"."${rev}"
|
|
|
|
echo Got version number ${version}
|
|
|
|
echo
|
2011-02-23 10:49:53 +00:00
|
|
|
echo Please check that the changelog is up to date.
|
2014-12-27 17:15:50 +00:00
|
|
|
echo Hit ENTER if this is correct. Otherwise hit Ctrl+C
|
2010-08-02 10:27:40 +00:00
|
|
|
read tmp
|
|
|
|
|
|
|
|
echo Extracting base archive...
|
2013-01-28 14:29:23 +00:00
|
|
|
|
2015-04-04 15:37:54 +00:00
|
|
|
mkdir -p ${workdir}/src
|
|
|
|
echo Checking out latest snapshot...
|
|
|
|
cd ${workdir}/src
|
2017-12-31 18:15:19 +01:00
|
|
|
git clone --depth 1 ${gitpath} --single-branch --branch $branch .
|
2017-08-11 19:27:49 +02:00
|
|
|
|
2017-08-11 19:33:23 +02:00
|
|
|
# if ! test "$hhsh" = "" ; then
|
2018-05-09 10:15:32 +02:00
|
|
|
# echo Checking out revision $hhsh
|
|
|
|
# git checkout $hhsh
|
2017-08-11 19:33:23 +02:00
|
|
|
# fi
|
2017-08-11 19:27:49 +02:00
|
|
|
|
2015-04-04 15:37:54 +00:00
|
|
|
cd -
|
2013-01-28 14:29:23 +00:00
|
|
|
|
2015-08-02 18:35:27 +02:00
|
|
|
if ! test -d ${workdir}/src/libretroshare/; then
|
2018-05-09 10:15:32 +02:00
|
|
|
echo Git clone failed.
|
|
|
|
exit
|
2015-08-02 18:35:27 +02:00
|
|
|
fi
|
|
|
|
|
2015-08-01 23:13:44 +02:00
|
|
|
cp -r debian ${workdir}/debian
|
|
|
|
|
2013-01-28 14:29:23 +00:00
|
|
|
# VOIP tweak
|
2015-04-04 15:37:54 +00:00
|
|
|
cp ${workdir}/src/retroshare-gui/src/gui/chat/PopupChatDialog.ui ${workdir}/src/plugins/VOIP/gui/PopupChatDialog.ui
|
2013-01-28 14:29:23 +00:00
|
|
|
|
2018-05-11 16:33:19 +02:00
|
|
|
# remove unised qml code, only needed on Android
|
|
|
|
|
|
|
|
rm -rf ${workdir}/src/retroshare-qml-app/
|
2018-05-11 16:39:49 +02:00
|
|
|
rm -rf ${workdir}/src/build_scripts/
|
2018-05-11 17:02:58 +02:00
|
|
|
rm ${workdir}/debian/*~
|
2018-05-11 16:33:19 +02:00
|
|
|
|
2015-04-04 15:37:54 +00:00
|
|
|
# Cloning sqlcipher
|
2014-09-21 14:25:58 +00:00
|
|
|
# git clone https://github.com/sqlcipher/sqlcipher.git
|
2013-06-25 22:02:38 +00:00
|
|
|
|
2015-04-30 20:03:38 +00:00
|
|
|
cd ${workdir}
|
2010-08-02 10:27:40 +00:00
|
|
|
echo Setting version numbers...
|
|
|
|
|
|
|
|
# setup version numbers
|
2018-12-18 23:14:14 +01: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 07:25:50 +00:00
|
|
|
|
2010-02-06 22:26:30 +00:00
|
|
|
# Various cleaning
|
2010-08-02 10:27:40 +00:00
|
|
|
echo Cleaning...
|
2015-08-02 18:35:27 +02:00
|
|
|
|
|
|
|
\rm -rf src/.git
|
2015-04-04 15:37:54 +00:00
|
|
|
|
|
|
|
echo Calling debuild...
|
|
|
|
for i in ${dist}; do
|
2018-05-09 10:15:32 +02: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
|
2018-12-18 23:14:14 +01:00
|
|
|
sed -e s/XXXXXX/"-${gitrev}"/g debian/rules > debian_rules_tmp
|
|
|
|
cp debian_rules_tmp debian/rules
|
2018-05-09 10:15:32 +02:00
|
|
|
|
|
|
|
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 15:37:54 +00:00
|
|
|
else
|
2018-05-09 10:15:32 +02:00
|
|
|
echo creating official debian release. Using built-in changelog and control files
|
|
|
|
fi
|
2015-04-04 15:37:54 +00:00
|
|
|
|
2018-05-09 10:15:32 +02:00
|
|
|
debuild -S -k${gpgkey} --lintian-opts +pedantic -EviIL
|
2013-03-01 17:46:52 +00:00
|
|
|
done
|
2015-04-04 15:37:54 +00:00
|
|
|
cd -
|
|
|
|
|
|
|
|
exit 0
|