File licq.spec of Package licq

#
# spec file for package licq (Version 1.3.6)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           licq
BuildRequires:  boost-devel cdk-devel cmake gtk2-devel gtkspell-devel kdelibs3-devel libqt4-devel libstdc++-devel qt3-devel-tools xosd-devel
%if 0%{?suse_version} > 1000
BuildRequires:  gpgme-devel
%else
BuildRequires:  openssl-devel
%endif
License:        GPL v2 or later
Group:          Productivity/Networking/ICQ
AutoReqProv:    on
Version:        1.3.6
Release:        5
Summary:        Linux ICQ Client
Source:         %{name}-%{version}.tar.bz2
# Maybe in future will somebody make icqnd plugin get working
# icqnd subpackage has been droped for 11.1
#icqndURL:  http://icqnd.sourceforge.net/
#Source1:        icqnd-0.2BETA.tar.bz2
Source2:        licq.png
%if 0%{?suse_version} > 1000
Recommends:     sox
%endif
Patch1:         %{name}-%{version}-config-fix.patch
Patch2:         %{name}-%{version}-userinfodlg.patch
Patch3:         %{name}-%{version}-viewurl.patch
Patch4:         %{name}-%{version}-two_desktop_files.patch
Patch5:         %{name}-%{version}-array_del.patch
Patch6:         %{name}-%{version}-gcc44.patch
Patch7:         %{name}-%{version}-ru_login_fix.patch
Patch8:         %{name}-%{version}-leak-fix.patch
#Patch20:        icqnd-0.1.9-libdir_64bit.patch
#Patch21:        icqnd-0.1.9-do_not_strip.patch
Url:            http://www.licq.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Licq includes all the basic features of ICQ, like sending and receiving
messages, chat, file transfer, contact list with pixmaps and user
status, basic and extended user information, adding and editing users
from within the GUI, user history, user groups, and new user
registration. All commands and information are available through a
simple and convenient tab dialog. Licq also has a completely
configurable user interface with Skin and Icon pack support. It is
written in C++ and comes with a GUI plug-in using the Qt widget set.
Other plug-ins are also available.



%package qt4-gui
License:        GPL v2 or later
Summary:        QT4 plug-in for Licq
Group:          Development/Sources
Requires:       licq = %{version}

%description qt4-gui
This plug-in uses the latest qt4 libraries. It's more useful if you're
using KDE4.



%package devel
License:        GPL v2 or later
Summary:        Development files of Licq
Group:          Development/Sources
Requires:       licq = %{version}

%description devel
Header files of Licq program.



%prep
%setup -n %{name}-%{version}
## move icqnd source into plugins where it belongs
#mv 0.2BETA plugins/icqnd
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6 -p1
%patch7
# PATCH-FIX-UPSTREAM fix mem leak (bnc#540498)
%patch8
##patches for icqnd
#%patch20
#%patch21

%build
%if 0%{?suse_version} > 1001
export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fstack-protector"
export CXXFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -fstack-protector"
export CPPFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
%else
export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
export CXXFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
export CPPFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing"
%endif
#make -f Makefile.cvs
aclocal
automake
autoconf
./configure \
	--disable-static \
	--prefix=%{_prefix} \
	--libdir=%{_libdir} \
	--mandir=%{_mandir} \
	--with-libname=%{_lib}
make %{?jobs:-j%jobs}
cd plugins
  cp -a qt-gui kde-gui
cd rms
#  make -f Makefile.cvs
  aclocal
  automake
  autoconf
  ./configure \
	--prefix=%{_prefix} \
	--libdir=%{_libdir}/licq \
	--mandir=%{_mandir}
  make %{?jobs:-j%jobs}
#cd ../icqnd
#  aclocal
#  automake
#  autoconf
#  ./configure\
#	--prefix=%{_prefix} \
#	--libdir=%{_libdir}/licq \
#	--mandir=%{_mandir} \
#        --with-licq-includes=../../include \
#        --enable-gtkspell  
#  make %{?jobs:-j%jobs}
###
cd ../console
#  make -f Makefile.cvs
  aclocal
  automake
  autoconf
  ./configure\
	--prefix=%{_prefix} \
	--libdir=%{_libdir}/licq \
	--mandir=%{_mandir}
  make %{?jobs:-j%jobs}
cd ../qt4-gui
  mkdir build
  cd build
# switch  -DWITH_KDE=ON is problematic, KDE support is now disabled
    cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DINSTALL_LIB_DIR=%{_libdir} ..
  make %{?jobs:-j%jobs}
  cd ..
cd ../qt-gui
#  make -f Makefile.cvs
        aclocal
	automake
	perl am_edit {src/,share/,po/}Makefile.in
	autoconf
QTDIR=/usr/lib/qt3 QTLIB=/usr/lib/qt3/%_lib \
	./configure \
		--prefix=%{_prefix} \
	     	--libdir=%{_libdir}/licq \
		--mandir=%{_mandir}
  make %{?jobs:-j%jobs}
cd ../kde-gui
#  make -f Makefile.cvs
	aclocal
	automake
	perl am_edit {src/,share/,po/}Makefile.in
	autoconf
QTDIR=/usr/lib/qt3 QTLIB=/usr/lib/qt3/%_lib KDEDIR=/opt/kde3/%_lib \
	./configure \
		--with-kde \
		--prefix=%{_prefix} \
		--libdir=%{_libdir}/licq \
		--mandir=%{_mandir}
  make %{?jobs:-j%jobs}
cd ../email
#  make -f Makefile.cvs
  aclocal -I /usr/share/aclocal
  automake
  autoconf
  ./configure\
        --prefix=%{_prefix} \
        --libdir=%{_libdir}/licq \
        --mandir=%{_mandir}
  make %{?jobs:-j%jobs}
cd ../auto-reply
#  make -f Makefile.cvs
  aclocal
  automake
  autoconf
  ./configure\
        --prefix=%{_prefix} \
        --libdir=%{_libdir}/licq \
        --mandir=%{_mandir}
  make %{?jobs:-j%jobs}
cd ../osd
#  make -f Makefile.cvs
  gettextize -f
  aclocal
  automake
  autoconf
  ./configure\
        --prefix=%{_prefix} \
        --libdir=%{_libdir} \
        --mandir=%{_mandir}
  make %{?jobs:-j%jobs}
cd ../msn
#  make -f Makefile.cvs
  aclocal
  automake
  autoconf
  ./configure\
        --prefix=%{_prefix} \
        --libdir=%{_libdir}/licq \
        --mandir=%{_mandir}
  make %{?jobs:-j%jobs}

%install 
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd plugins/rms
 make  DESTDIR=$RPM_BUILD_ROOT install
# cd ../icqnd
# make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../console
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../qt-gui
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../kde-gui
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../qt4-gui/build
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ..
 cd ../email
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../auto-reply
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../msn
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../osd
 make  DESTDIR=$RPM_BUILD_ROOT install
 cd ../..
# docs
mkdir -p  $RPM_BUILD_ROOT%{_prefix}/share/doc/packages/licq
#rm -rf doc/CVS
install -m 644 doc/*  $RPM_BUILD_ROOT%{_prefix}/share/doc/packages/licq
chmod 755 `find $RPM_BUILD_ROOT%{_prefix}/share/licq -type d`
# install icon
mkdir -p $RPM_BUILD_ROOT%{_prefix}/share/pixmaps
install -m 644 %{S:2} $RPM_BUILD_ROOT%{_prefix}/share/pixmaps/
%if 0%{?suse_version} < 1010
%suse_update_desktop_file -i licq Network InstantMessaging
%else
%suse_update_desktop_file -i -G "ICQ Client" licq Network InstantMessaging
%endif
%find_lang %{name}

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(-,root,root,755)
%doc %{_prefix}/share/doc/packages/licq/
%{_prefix}/bin/licq
%{_prefix}/bin/viewurl-lynx.sh
%{_prefix}/bin/viewurl-ncftp.sh
%{_prefix}/bin/viewurl-netscape.sh
%{_prefix}/bin/viewurl-w3m.sh
%{_prefix}/bin/viewurl-mozilla.sh
%{_prefix}/bin/viewurl-opera.sh
%{_prefix}/bin/viewurl-firefox.sh
%{_prefix}/bin/viewurl-seamonkey.sh
%{_libdir}/licq/
%{_prefix}/share/licq/
# mo files of xosd plugin needs to be listed mannualy
#%{_prefix}/share/locale/*/LC_MESSAGES/*.mo
%lang(sv) %{_prefix}/share/locale/sv/LC_MESSAGES/licq_osd_plugin.mo
%lang(sk) /usr/share/locale/sk/LC_MESSAGES/licq_osd_plugin.mo
%lang(ru) /usr/share/locale/ru/LC_MESSAGES/licq_osd_plugin.mo
%lang(ro) /usr/share/locale/ro/LC_MESSAGES/licq_osd_plugin.mo
%lang(pt_BR) /usr/share/locale/pt_BR/LC_MESSAGES/licq_osd_plugin.mo
%lang(pt) /usr/share/locale/pt/LC_MESSAGES/licq_osd_plugin.mo
%lang(fr) /usr/share/locale/fr/LC_MESSAGES/licq_osd_plugin.mo
%lang(es) /usr/share/locale/es/LC_MESSAGES/licq_osd_plugin.mo
%lang(de) /usr/share/locale/de/LC_MESSAGES/licq_osd_plugin.mo
%lang(cs) /usr/share/locale/cs/LC_MESSAGES/licq_osd_plugin.mo
%lang(be) /usr/share/locale/be/LC_MESSAGES/licq_osd_plugin.mo
# files in include dir go to devel subpackage
%exclude %{_prefix}/include/licq/
/usr/share/applications/licq.desktop
/usr/share/pixmaps/licq.png
%exclude %{_libdir}/licq/*.*a
%exclude %{_libdir}/licq/licq_qt4-gui.so
#%exclude /usr/share/licq/icqnd
#%exclude %{_libdir}/licq/licq_icqnd.so
%exclude /usr/share/licq/qt4-gui

%files devel
%defattr(-,root,root,755)
%{_prefix}/include/licq/

%files qt4-gui
%defattr(-,root,root,755)
%{_libdir}/licq/licq_qt4-gui.so
/usr/share/licq/qt4-gui
# mo files of qt4-plugin plugin needs to be listed mannualy
#%files icqnd
#%defattr(-,root,root,755)
#%{_libdir}/licq/licq_icqnd.so
#/usr/share/licq/icqnd
## mo files of icqnd plugin needs to be listed mannualy
#%lang(de) /usr/share/locale/de/LC_MESSAGES/icqnd.mo

%changelog
openSUSE Build Service is sponsored by