Commit 7fbc7001 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files
parents 5042ab1a 29f12f21
......@@ -2,16 +2,48 @@
#
# @author: Yun Liu <yun.liu@savoirfairelinux.com>
#
# Build sflphone debian packages for Ubuntu 8.04
# 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."
exit 1
exit 1
fi
# Anonymous git http access
......@@ -22,33 +54,54 @@ git checkout origin/release -b release
# Get system parameters
arch_flag=`getconf -a|grep LONG_BIT | sed -e 's/LONG_BIT\s*//'`
os_version=`lsb_release -d -s -c | sed -e '1d'`
ver=0.9.2
if [ $platform == "ubuntu" ];then
# Generate the changelog, according to the distribution and the git commit messages
cp debian/changelog.$os_version debian/changelog
git-dch --debian-branch=release --release
fi
# Generate the changelog, according to the distribution and the git commit messages
cp debian/changelog.$os_version debian/changelog
git-dch --debian-branch=release --release
cd ..
# Remove useless git directory
rm sflphone/.git/ -rf
# Copy the appropriate control file based on different archtecture
cp sflphone/debian/control.$os_version sflphone/debian/control
# Get the public gpg key to sign the packages
wget -q http://www.sflphone.org/downloads/gpg/sflphone.gpg.asc -O- | gpg --import -
echo "Building sflphone package on Ubuntu $os_version $arch_flag bit architecture...."
if [ $platform == "ubuntu" ];then
# Copy the appropriate control file based on different archtecture
cp sflphone/debian/control.$os_version sflphone/debian/control
# Provide prerequisite directories used by debuild
cp sflphone sflphone-0.9.2 -r
cp sflphone sflphone-0.9.2.orig -r
echo "Building sflphone package on Ubuntu $os_version $arch_flag bit architecture...."
# Provide prerequisite directories used by debuild
cp sflphone sflphone-$ver -r
cp sflphone sflphone-$ver.orig -r
# Build packages
cd sflphone-$ver/debian; debuild -k'Savoir-Faire Linux Inc.'
# Get the public gpg key to sign the packages
wget -q http://www.sflphone.org/downloads/gpg/sflphone.gpg.asc -O- | gpg --import -
# Post clean
cd ..
rm sflphone-$ver sflphone -rf
echo "Done! All the source packages and binary packages are generated in the current directory"
# Build packages
cd sflphone-0.9.2/debian; debuild -k'Savoir-Faire Linux Inc.'
else
# Prepare for packaging
mv sflphone sflphone-$ver
# Clean
cd ../..
rm sflphone-0.9.2/ -rf
rm sflphone/ -rf
cp sflphone-$ver/platform/$platform.spec $BUILDDIR/SPECS/sflphone.spec
sed -e "s!@PREFIX@!/usr!" sflphone-$ver/libs/pjproject-1.0/libpj-sfl.pc.in > $BUILDDIR/SOURCES/libpj-sfl.pc
tar zcvf sflphone-$ver.tar.gz sflphone-$ver
echo "Building package finished successullly!"
rm sflphone-$ver -rf
mv sflphone-$ver.tar.gz $BUILDDIR/SOURCES
echo "Building sflphone package on $platform $arch_flag bit architecture...."
# Build packages
cd $BUILDDIR/SPECS/
rpmbuild -ba --sign sflphone.spec
echo "Done! All source rpms and binary rpms are stored in $BUILDDIR/SRPMS and $BUILDDIR/RPMS"
fi
%define name sflphone
%define version 0.9.2
Autoreq: 0
Name: %name
Summary: A VoIP daemon with SIP protocol and IAX protocol
Version: %version
Release: 6fedora
License: GPL
Group: System Environment/Daemons
URL: http://www.sflphone.org/
Packager: Yun Liu <yun.liu@savoirfairelinux.com>
Source0: %{name}-%{version}.tar.gz
Source1: libpj-sfl.pc
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex sflphone-iax2 dbus-c++ libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl
%description
SFLPhoned is a VoIP daeamon with SIP protocol and IAX protocol.
%prep
%setup -q
cd libs/pjproject-1.0
./configure --prefix=/usr
make dep
make clean
make
cd ../..
%build
./autogen.sh --prefix=/usr
make
cd sflphone-gtk/
./autogen.sh --prefix=/usr
make
cd ..
%install
%makeinstall
cd sflphone-gtk/
%makeinstall
cd ../libs/pjproject-1.0
%makeinstall
cd ../..
cd %{buildroot}/usr/bin/
ln -sf ./sflphone-gtk sflphone
cd -
cp %{SOURCE1} %{buildroot}/usr/lib/pkgconfig/ -f
rm -rf %{buildroot}/usr/lib/debug
rm -rf %{buildroot}/usr/include/
%files
%defattr(-, root, root)
/usr/bin/*
/usr/lib/*
/usr/share/applications/*
/usr/share/dbus-1/services/*
/usr/share/locale/*
/usr/share/pixmaps/*
/usr/share/sflphone/*
/usr/share/man/*
%clean
rm -rf %{buildroot}
%changelog
* Mon Jan 26 2009 Yun Liu <yun.liu@savoirfairelinux.com> 6
- Packaging sflphone for Fedora 10
* Mon Jan 5 2009 Yun Liu <yun.liu@savoirfairelinux.com>
- Fix bug ticket #107, #108, #109, #110, #111, #117, #129
* Thu Nov 6 2008 Yun Liu <yun.liu@savoirfairelinux.com>
- Packaging sflphone for Fedora 9
* Thu Nov 30 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone for Fedora Core 6
* Wed Sep 6 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone, sflphone-qt and sflphone-cli
* Mon Nov 21 2005 Yan Morin <yan.morin@savoirfairelinux.com>
- Final 0.6.0 version (Release / Source without alphatag)
%define name sflphone
%define version 0.9.2
Autoreq: 0
Name: %name
Summary: A VoIP daemon with SIP protocol and IAX protocol
Version: %version
Release: 6suse
License: GPL
Group: System Environment/Daemons
URL: http://www.sflphone.org/
Packager: Yun Liu <yun.liu@savoirfairelinux.com>
Source0: %{name}-%{version}.tar.gz
Source1: libpj-sfl.pc
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: commoncpp2 ccrtp cppunit libsamplerate pulseaudio-libs-zeroconf pulseaudio-libs-devel gsm speex sflphone-iax2 dbus-c++ libgcc dbus-glib expat gtk2 glibc glib2 dbus-libs dbus-glib libsexy libnotify perl
%description
SFLPhoned is a VoIP daeamon with SIP protocol and IAX protocol.
%prep
%setup -q
cd libs/pjproject-1.0
./configure --prefix=/usr
make dep
make clean
make
cd ../..
%build
./autogen.sh --prefix=/usr
make
cd sflphone-gtk/
./autogen.sh --prefix=/usr
make
cd ..
%install
make prefix=%{buildroot}/usr install
cd sflphone-gtk/
make prefix=%{buildroot}/usr install
cd ../libs/pjproject-1.0
make prefix=%{buildroot}/usr install
cd ../..
cd %{buildroot}/usr/bin/
ln -sf ./sflphone-gtk sflphone
cd -
cp %{SOURCE1} %{buildroot}/usr/lib/pkgconfig/ -f
rm -rf %{buildroot}/usr/lib/debug
rm -rf %{buildroot}/usr/include
%files
%defattr(-, root, root)
/usr/bin/*
/usr/lib/*
/usr/share/applications/*
/usr/share/dbus-1/services/*
/usr/share/locale/*
/usr/share/pixmaps/*
/usr/share/sflphone/*
/usr/share/man/*
%clean
rm -rf %{buildroot}
%changelog
* Mon Jan 26 2009 Yun Liu <yun.liu@savoirfairelinux.com> 6suse
- Packaging sflphone on openSUSE 11
* Mon Jan 5 2009 Yun Liu <yun.liu@savoirfairelinux.com>
- Fix bug ticket #107, #108, #109, #110, #111, #117, #129
* Thu Nov 6 2008 Yun Liu <yun.liu@savoirfairelinux.com>
- Packaging sflphone for Fedora 9
* Thu Nov 30 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone for Fedora Core 6
* Wed Sep 6 2006 Yan Morin <yan.morin@savoirfairelinux.com>
Packaging sflphone, sflphone-qt and sflphone-cli
* Mon Nov 21 2005 Yan Morin <yan.morin@savoirfairelinux.com>
- Final 0.6.0 version (Release / Source without alphatag)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment