# Build sflphone rpm packages for Fedora 10 and openSUSE 11
# 1 - The SFLphone package must be build with a specific GnuPG key. Please contact us to have more information about that (<sflphoneteam@savoirfairelinux.com>)
# 2. The source code can be teched through anonymous http access. So no need of special access.
# 3. After having all the prerequisites, you can run "build-package.sh" to build debian packages for sflphone.
# All the source packages and binary packages will be generated in the current directory.
# 3. After having all the prerequisites, you can run "build-rpm-package.sh" to build rpm packages for sflphone.
#
# Refer to http://www.sflphone.org for futher information
# Analyze parameters
if["$1"=="--help"]||["$1"==""];then
echo-e'\E[34mThis script is used to build sflphone rpm packages on ubuntu series(8.04,8,10,9), Fedora 10 and SUSE 11 platform.'
echo-e'\E[34mYou can add --fedora, --suse or --ubuntu to start packaging.'
echo
echo"The SFLphone package must be build with a specific GnuPG key. Please contact us to have more information about that (<sflphoneteam@savoirfairelinux.com>)"
echo
echo"For fedora and SUSE, you also need to add the following lines to $HOME/.rpmmacros:"
echo-e'\E[32m%_gpg_path /home/yun/.gnupg'
echo-e'\E[32m%_gpg_name Savoir-Faire Linux Inc. (Génération des paquets pour SFLphone) <sflphoneteam@savoirfairelinux.com>'
echo-e'\E[32m%_gpgbin /usr/bin/gpg'
echo
echo-e'\E[34mAfter all these preparations done, you can run ./build-package.sh --platform-name'
echo
echo-e'\E[36mHave fun!'
tput sgr0 # Reset colors to "normal."
echo
exit 1
elif[$1=="--fedora"];then
BUILDDIR=$HOME/rpmbuild
platform="fedora"
elif[$1=="--suse"];then
BUILDDIR=/usr/src/packages
platform="suse"
elif[$1=="--ubuntu"];then
platform="ubuntu"
else
echo"This script can only be used for Ubuntu series, Fedora 10 and SUSE 11 platform. Use --help to get more information."
exit 1
fi
if[-d"sflphone"];then
echo"Directory sflphone already exists. Please remove it first."