Table of Contents

Psi+ on OpenSUSE Linux

Introduction

Building Psi+ on OpenSUSE “from scratch” (the bare system).

What may be needed and how to build?

Your system may not be QtCrypto and QtDev>=4.4.2. If you do not – they must be installed prior to build.

Install packages to build Psi+. Installed once at the first build.

zypper in git-core gcc libqt4-devel qt4-x11-tools qdevelop patch make

Remove previous build to build “clean”:

cd ~
rm psi -r

Download the source code of Psi and submodules from git:

cd ~
git clone git://git.psi-im.org/psi.git
cd psi
git submodule init
git submodule update

The resulting directory you can save and then run the command for get the current version of Psi.

git pull
git submodule update

Download all the patches and install them:

cd ~
svn co http://psi-dev.googlecode.com/svn/trunk/patches/ psi
cd psi
cat *.diff|patch -p1

Download iconsets needed to build and put the current revision to Psi+:

cd ~/psi
svn export --force http://psi-dev.googlecode.com/svn/trunk/iconsets/system/default iconsets/system/default
svn export --force http://psi-dev.googlecode.com/svn/trunk/iconsets/roster/default iconsets/roster/default
rev=`svnversion`
sed "s/\(xxx\)/${rev}/" -i src/applicationinfo.cpp

Build Psi+ and install:

cd ~/psi
qconf && ./configure --enable-plugins && make && make install

Note! If the qconf not installed then you need to do it yourself.

If the command ./configure get an qtcore error then we write:

qmake --version

Look at the path and run ./configure with parameter:

./configure --qtdir=<path>

Most likely it will be:

./configure --qtdir=/usr/lib

Installing additional components

If you need to install additional emoticons, moods or Russian localization then do the following:

Emoticons

cd /usr/local/share/psi/iconsets/emoticons
wget http://psi-dev.googlecode.com/svn/trunk/iconsets/emoticons/lk_35x35x138_tasha.jisp
wget http://psi-dev.googlecode.com/svn/trunk/iconsets/emoticons/tasha_18x18x93.jisp

Moods

cd /usr/local/share/psi/iconsets
mkdir moods
cd moods
wget http://psi-dev.googlecode.com/svn/trunk/iconsets/moods/silk.jisp

Russian localization

cd /usr/local/share/psi
wget http://psi-ru.googlecode.com/svn/branches/psi-plus/psi_ru.qm

Building rpm package

Building source code and patches

#!/bin/sh
#
#variables:
#$USER - username in the system
home=/home/$USER
psi=/home/$USER/psi_dev
#note: for the x86_64 architecture replace app_info to $(ls /home/$USER/psi_dev/psi/ | grep application-info.diff)
app_info=ls /home/$USER/psi_dev/psi/ | grep application-info.diff
build_root=/usr/src/packages/
#note: for the x86_64 architecture replace rev to $(svnversion "$/home/$USER/psi_dev/patches")
rev=`svnversion "$/home/$USER/psi_dev/patches"`
cd ${home}
mkdir psi_dev
cd ${psi}
git clone git://git.psi-im.org/psi.git
cd psi
git submodule init
git submodule update
cd ${psi}
svn co http://psi-dev.googlecode.com/svn/trunk/patches/
cp ${psi}/patches/*diff ${psi}/psi
cd ${psi}/psi
sed "s/\(xxx Beta\)/${rev} Beta/" -i "${app_info}"
for f in *diff; do patch -p1 -i "${f}"; done
sed 's/<!--\(.*plugins.*\)-->/\1/' -i psi.qc
cd ${psi}
mv psi psi-0.15_dev
tar -pczf psi-0.15_dev.tar.gz psi-0.15_dev
rm -r ${build_root}/SOURCES/
cp psi-0.15_dev.tar.gz ${build_root}/SOURCES
chown -R $USER:users ${psi}
exit 0

Note: This script was going to the source code and prepares them for build a rpm-package (require root privileges).

To build the rpm package requires spec file

Summary: Client application for the XMPP network      
Name: psi                                               
Version: 0.15_dev                                       
Release: %{dist}                                        
License: GPL                                            
Group: Applications/Internet                            
URL: http://code.google.com/p/psi-dev/                  
Source0: %{name}-%{version}.tar.gz                      


BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root


BuildRequires: openssl-devel, gcc-c++, zlib-devel
%{!?_without_freedesktop:BuildRequires: desktop-file-utils}


%description
Psi is the premiere Instant Messaging application designed for Microsoft Windows, 
Apple Mac OS X and GNU/Linux. Built upon an open protocol named XMPP,           
si is a fast and lightweight messaging client that utilises the best in open      
source technologies. The goal of the Psi project is to create a powerful, yet     
easy-to-use XMPP client that tries to strictly adhere to the XMPP drafts.  
and XMPP JEPs. This means that in most cases, Psi will not implement a feature  
unless there is an accepted standard for it in the XMPP community. Doing so     
ensures that Psi will be compatible, stable, and predictable, both from an end-user 
and developer standpoint.                                                           


%prep
%setup


%build
qconf
# to build without webkit you need to remove the flag *-- enable-qtwebkit*
./configure --prefix="%{_prefix}" --bindir="%{_bindir}" --datadir="%{_datadir}" --qtdir=$QTDIR --enable-plugins --enable-qtwebkit --no-separate-debug-info
%{__make} %{?_smp_mflags}                                                                                                               


%install
%{__rm} -rf %{buildroot}


%{__make} install INSTALL_ROOT="%{buildroot}"


# Install the pixmap for the menu entry
%{__install} -Dp -m0644 iconsets/system/default/logo_128.png}} \
    %{buildroot}%{_datadir}/pixmaps/psi.png}} ||:               


%post
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%postun
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-, root, root, 0755)
%doc COPYING README TODO
%{_bindir}/psi
%{_datadir}/psi/
%{_datadir}/pixmaps/psi.png
%{_datadir}/applications/psi.desktop
%{_datadir}/icons/hicolor/*/apps/psi.png
%exclude %{_datadir}/psi/COPYING
%exclude %{_datadir}/psi/README

Note: spec file needs to save at the /usr/src/packages/SPECS/psi.spec

Building rpm package

cd /usr/src/packages/SPECS/
rpmbuild -bb psi.spec

Note: Flag - bb indicates program to build a binary package. After successful build of the package can be picked up from the directory /usr/src/packages/RPMS/$processor-architecture.

And install by the command:

rpm -ihv psi-0.15_dev.rpm

Finally

Enjoy ;-)