2010-02-06 02:25:50 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
2013-01-28 09:29:23 -05:00
|
|
|
###################### PARAMETERS ####################
|
2017-07-20 16:11:35 -04:00
|
|
|
version="0.6.3"
|
2015-08-01 17:13:44 -04:00
|
|
|
gitpath="https://github.com/RetroShare/RetroShare.git"
|
2017-07-17 04:44:27 -04:00
|
|
|
workdir=retroshare-${version}
|
2017-09-12 15:05:59 -04:00
|
|
|
branch="master"
|
|
|
|
#branch="v0.6.3-official_release"
|
2014-09-06 12:45:42 -04:00
|
|
|
#bubba3="Y" # comment out to compile for bubba3
|
2013-01-28 09:29:23 -05:00
|
|
|
######################################################
|
|
|
|
|
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
|
2017-12-31 12:15:19 -05: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
|
|
|
|
gitpath="https://github.com/csoler/RetroShare.git"
|
|
|
|
branch="v0.6-TorOnly"
|
|
|
|
fi
|
|
|
|
|
2015-04-04 11:52:02 -04:00
|
|
|
if test "${dist}" = "" ; then
|
2017-10-14 12:10:55 -04:00
|
|
|
dist="precise trusty xenial zesty artful"
|
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
|
|
|
|
2015-08-01 17:13:44 -04:00
|
|
|
echo " "Using PGP key id : ${gpgkey}
|
|
|
|
echo " "Using distributions: ${dist}
|
|
|
|
echo " "Commit count : ${ccount}
|
|
|
|
echo " "Date : ${date}
|
2015-08-02 11:07:05 -04:00
|
|
|
echo " "Time : ${time}
|
2015-08-01 17:13:44 -04:00
|
|
|
echo " "Hash : ${hhsh}
|
2017-03-11 12:15:35 -05:00
|
|
|
echo " "Using branch : ${branch}
|
2015-08-01 17:13:44 -04:00
|
|
|
echo " "Using revision : ${rev}
|
2011-02-23 05:49:53 -05:00
|
|
|
|
2017-12-31 10:22:19 -05:00
|
|
|
if test ${useretrotor} = "true"; then
|
|
|
|
echo " "Specific flags : retrotor
|
|
|
|
fi
|
|
|
|
|
2015-04-04 11:37:54 -04:00
|
|
|
echo Done.
|
2015-08-01 17:13:44 -04:00
|
|
|
version="${version}"."${rev}"
|
2015-04-04 11:37:54 -04:00
|
|
|
echo Got version number ${version}.
|
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
|
|
|
|
# echo Checking out revision $hhsh
|
|
|
|
# git checkout $hhsh
|
|
|
|
# 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
|
|
|
|
echo Git clone failed.
|
|
|
|
exit
|
|
|
|
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
|
|
|
|
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
|
|
|
|
echo copying changelog for ${i}
|
2015-08-01 17:13:44 -04:00
|
|
|
sed -e s/XXXXXX/"${rev}"/g -e s/YYYYYY/"${i}"/g ../changelog > debian/changelog
|
2015-04-04 11:37:54 -04:00
|
|
|
|
2017-12-31 10:22:19 -05:00
|
|
|
if test ${useretrotor} = "true"; then
|
|
|
|
cp ../rules.retrotor debian/rules
|
2017-12-31 12:15:19 -05:00
|
|
|
cp ../control.trusty_retrotor debian/control
|
|
|
|
elif test -f ../control."${i}" ; then
|
2017-10-14 12:10:55 -04:00
|
|
|
echo \/\!\\ Using specific control file for distribution "${i}"
|
2017-12-31 12:15:19 -05:00
|
|
|
cp ../control."${i}" debian/control
|
2015-04-04 11:37:54 -04:00
|
|
|
else
|
2017-10-14 12:10:55 -04:00
|
|
|
echo Using standard control file control."${i}" for distribution "${i}"
|
2017-12-31 12:15:19 -05:00
|
|
|
cp ../debian/control debian/control
|
|
|
|
fi
|
2015-04-04 11:37:54 -04:00
|
|
|
|
|
|
|
debuild -S -k${gpgkey}
|
2013-03-01 12:46:52 -05:00
|
|
|
done
|
2015-04-04 11:37:54 -04:00
|
|
|
cd -
|
|
|
|
|
|
|
|
exit 0
|