Blob Blame History Raw
%bcond_with opt
%if %{with opt}
%define _prefix /opt
%define __cmake cmake
%endif

# unpack_module_source():
# we check if we should build a given package
# if so, we unpack sources and add entry to config
# %1 - source number
# %2 - subpackage name

%define unpack_module_source() \
%if %{with %2}\
%setup -q -D -T -a %1 -n kadu/modules\
sed "s#^module_%2=.#module_%2=m#" -i ../.config\
%endif\
%nil

# enable_module():
# enable these internal modules which are not
# enabled by default

%define enable_module() \
%if %{expand:%%{?with_%1:1}%%{?!with_%1:0}}\
sed "s#^module_%1=.#module_%1=m#" -i ./.config\
%endif\
%nil

# module_files():
# both internal and external modules have at least their .so, .ui,
# .desc and .qm files. In order to simplify things, this macro 
# creates a simple %files section
# %1 - module/subpackage name
# if parameter -d is specified, module owns its data dir
# 
# all modules have very similar directory and files structure, so
# this macro is created to make it possible to simplify %files
# sections. All modules have .desc and .so files, a lot of them
# has configurations and translations or data dirs. We use 
# respectively -c, -t and -d parameters to know which files
# a module owns.

%define module_files(d,c,t) \
%{_libdir}/kadu/modules/lib%{1}.so\
%{_datadir}/kadu/modules/%1.desc\
%if "%{-c}" \
%{_datadir}/kadu/modules/configuration/%1.ui\
%endif\
%if "%{-t}" \
%{_datadir}/kadu/modules/translations/%{1}*.qm\
%endif\
%if "%{-d}" \
%{_datadir}/kadu/modules/data/%1\
%endif\
%nil

# kadu.spec
# table to make it possible to find out quickly which
# subpackage has which source's number
# LAST NUMBER: 120
# 109 agent
# 101 amarok_mediaplayer
# 117 anonymous_check
# 119 audacious_mediaplayer
# 102 globalhotkeys
# 110 falf_mediaplayer
# 104 led_notify
# 111 mail
# 112 mime_tex
# 113 mx610_notify
# 115 osd_hints
# 114 panelkadu
# 105 plus_pl_sms
# 118 powerkadu
# 103 senthistory
# 120 split_messages
# 106 tabs
# 116 water_notify
# 107 weather
# 108 xmms_mediaplayer
# the modules above aren't all external modules
# so here's the full list
# agent
# alsa_sound
# amarok_mediaplayer
# anonymous_check
# antistring
# ao_sound
# audacious_mediaplayer
# auto_hide
# autostatus
# cenzor
# esd_sound
# filedesc
# filtering
# firewall
# globalhotkeys
# last_seen
# led_notify
# mediaplayer
# plus_pl_sms
# osd_hints
# panelkadu
# parser_extender
# pcspeaker
# powerkadu
# profiles
# senthistory
# screenshot
# spellchecker
# split_messages
# tabs
# water_notify
# weather
# word_fix
# xmms_mediaplayer

# whether we want to build certain subpackages or not
# some of them are disabled by default due to
# not being adjusted to kadu-0.6.5
%bcond_with agent
%bcond_without alsa_sound
%bcond_with amarok_mediaplayer
%bcond_without anonymous_check
#%bcond_without antistring
#%bcond_without ao_sound
%bcond_with audacious_mediaplayer
%bcond_without auto_hide
#%bcond_without autostatus
#%bcond_without cenzor
#%bcond_with dcopexport
%bcond_with falf_mediaplayer
#%bcond_without filedesc
#%bcond_without filtering
#%bcond_without firewall
%bcond_without globalhotkeys
#%bcond_without last_seen
%bcond_without led_notify
%bcond_without mail
#%bcond_without mediaplayer
%bcond_without mime_tex
%bcond_with mx610_notify
%bcond_with osd_hints # formerly osd_hints
%bcond_without panelkadu
#%bcond_without parser_extender
#%bcond_without pcspeaker
%bcond_without plus_pl_sms # formerly miastoplusa_sms
%bcond_without powerkadu
#%bcond_without profiles
#%bcond_without screenshot
%bcond_without senthistory
#%bcond_without spellchecker
%bcond_without split_messages
%bcond_without tabs
%bcond_with water_notify
%bcond_with weather
#%bcond_without word_fix
%bcond_with xmms_mediaplayer
#%bcond_without qt4_docking
#%bcond_without qt4_sound

%if ! %{with opt}
Name:		kadu
%else
Name:		kadu_opt
%endif
Version:	0.6.5
Release:	1%{?dist}
Summary:	An Gadu-Gadu client for online messaging
Summary(pl):	Klient Gadu-Gadu
Group:		Applications/Internet
License:	GPLv2
URL:		http://www.kadu.net
Source0:	http://www.kadu.net/download/stable/kadu-%{version}.tar.bz2
Source3:	kadu.desktop

# external modules:
%if %{with agent}
Source109:	http://misiek.jah.pl/assets/2008/2/8/kadu-agent-0.5.tar.bz2
%endif
%if %{with amarok_mediaplayer}
Source101:	http://www.kadu.net/download/modules_extra/amarok_mediaplayer/amarok_mediaplayer-20071220.tar.bz2
%endif
%if %{with anonymous_check}
Source117:	http://kadu.net/~patryk/anonymous_check/anonymous_check-0.6.5.1.tar.bz2
%endif
%if %{with audacious_mediaplayer}
Source119:	http://www.kadu.net/download/modules_extra/audacious_mediaplayer/audacious_mediaplayer-20080423.tar.bz2
%endif
%if %{with falf_mediaplayer}
Source110:      http://www.kadu.net/download/modules_extra/falf_mediaplayer/falf_mediaplayer-20071225.tar.bz2
%endif
%if %{with globalhotkeys}
Source102:	http://www.ultr.pl/kadu/globalhotkeys-0.6.5-7.tar.gz
%endif
%if %{with led_notify}
Source104:	http://kadu.net/~blysk/led_notify-0.21.tar.bz2
%endif
%if %{with mail}
Source111:      http://kadu.net/~michal/mail/mail-current.tar.bz2
%endif
%if %{with plus_pl_sms}
Source105:	http://kadu.net/~patryk/plus_pl_sms/plus_pl_sms-0.6.5.1.tar.bz2
%endif
%if %{with mime_tex}
Source112:      http://kadu.net/~patryk/mime_tex/mime_tex-0.6.5.1.tar.bz2
%endif
%if %{with mx610_notify}
Source113:      http://kadu.jarzebski.pl/mx610_notify-0.3.1.tar.bz2
%endif
%if %{with osd_hints}
Source115:	http://www.kadu.net/~dorr/moduly/kadu-osd_hints-0.1.2.tar.bz2
%endif
%if %{with panelkadu}
Source114:	http://www.ultr.pl/kadu/panelkadu-0.6.5-2.tar.gz
%endif
%if %{with powerkadu}
Source118:	http://www.kadu.net/~dorr/moduly/kadu-powerkadu-2.1.1.tar.bz2
%endif
%if %{with senthistory}
Source103:	http://www.ultr.pl/kadu/senthistory-0.6.5-3.tar.gz
%endif
%if %{with split_messages}
Source120:	http://www.kadu.net/~dorr/moduly/kadu-split_messages-0.3.tar.bz2
%endif
%if %{with tabs}
Source106:	http://www.kadu.net/~arvenil/tabs/download/0.6.5/kadu-tabs-1.2.1.tar.bz2
%endif
%if %{with water_notify}
Source116:	http://kadu.jarzebski.pl/water_notify-0.1.1-try2.tar.bz2
%endif
%if %{with weather}
Source107:	http://kadu.net/~blysk/weather-3.13.tar.bz2
%endif
%if %{with xmms_mediaplayer}
Source108:	http://www.kadu.net/download/modules_extra/xmms_mediaplayer/xmms_mediaplayer-20080116.tar.bz2
%endif

#Patch0:		kadu-0.6.0-xmmsfix.patch
Patch0:		kadu-0.6.5-voice-external-libgsm.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  cmake
BuildRequires:	libpng-devel libsndfile-devel openssl-devel
BuildRequires:	qt-devel
BuildRequires:	libgadu-devel > 1.8.0
BuildRequires:	gsm-devel
BuildRequires:  desktop-file-utils
Obsoletes:	%{name}-ext_info < 0.6.0-0.1.alpha1
Obsoletes:	%{name}-iwait4u < 0.6.0-0.1.alpha1
Obsoletes:	%{name}-wmaker_docking < 0.6.0-0.1.alpha1
Obsoletes:	%{name}-arts_sound < 0.6.5-0.1.rc2 
#support for arts has been dropped, we've got qt4_sound now
Obsoletes:	%{name}-dcopexport < 0.6.5-0.1.rc2 
#dropped, there is no more DCOP in QT4
Obsoletes:	%{name}-advanced_userlist < 0.6.0-0.1.alpha1
Provides:	%{name}-advanced_userlist = %{version}-%{release}
Obsoletes:	%{name}-exec_notify < 0.6.0-0.1.alpha1
Provides:	%{name}-exec_notify = %{version}-%{release}
Obsoletes:	%{name}-devel < 0.6.5-0.1.rc2
Obsoletes:	%{name}-ao_sound < 0.6.5-0.1.rc2
Provides:	%{name}-ao_sound = %{version}-%{release}
Obsoletes:	%{name}-autostatus < 0.6.5-0.1.rc2
Provides:	%{name}-autostatus = %{version}-%{release}
Obsoletes:	%{name}-auto_hide < 0.6.5-0.1.rc2
Provides:	%{name}-auto_hide = %{version}-%{release}
Obsoletes:	%{name}-filedesc < 0.6.5-0.1.rc2
Provides:	%{name}-filedesc = %{version}-%{release}
Obsoletes:	%{name}-filtering < 0.6.5-0.1.rc2
Provides:	%{name}-filtering = %{version}-%{release}
Obsoletes:	%{name}-firewall < 0.6.5-0.1.rc2
Provides:	%{name}-firewall = %{version}-%{release}
Obsoletes:	%{name}-last_seen < 0.6.5-0.1.rc2
Provides:	%{name}-last_seen = %{version}-%{release}
Obsoletes:	%{name}-mediaplayer < 0.6.5-0.1.rc2
Obsoletes:	%{name}-parser_extender < 0.6.5-0.1.rc2
Provides:	%{name}-parser_extender = %{version}-%{release}
Obsoletes:	%{name}-pcspeaker < 0.6.5-0.1.rc2
Provides:	%{name}-pcspeaker = %{version}-%{release}
Obsoletes:	%{name}-profiles < 0.6.5-0.1.rc2
Provides:	%{name}-profiles = %{version}-%{release}
Obsoletes:	%{name}-word_fix < 0.6.5-0.1.rc2
Provides:	%{name}-word_fix = %{version}-%{release}


%description
Kadu is a dynamically evolving instant messenger compatible with the Gadu-Gadu
protocol.

%description -l pl
Kadu to dynamicznie rozwijający się komunikator internetowy kompatybilny z
protokołem Gadu-Gadu.

%if %{with agent}
%package agent
Summary:	Who has me on userlist
Summary(pl):	Kto ma mnie na liście użytkowników
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description agent
Agent is a module to let an user find out who has him on userlist.

%description agent -l pl
Agent to moduł umożliwiający dowiedzenie się użytkownikowi kto go ma na
swojej liście kontaktów.

%endif

%if %{with alsa_sound}
%package alsa_sound
Summary:	ALSA sound support
Summary(pl):	Obsługa dźwięku przez ALSA
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
BuildRequires:	alsa-lib-devel
%description alsa_sound
Alsa_sound is a module to support sound with ALSA.

%description alsa_sound -l pl
Alsa_sound to moduł umożliwiający obsługę dźwięku przez ALSA.

%endif

%if %{with amarok_mediaplayer}
%package amarok_mediaplayer
Summary:	Amarok support in mediaplayer module
Summary(pl):	Wsparcie dla Amaroka w module mediaplayer
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-mediaplayer = %{version}-%{release}
Obsoletes:	%{name}-amarok < 0.6.0-0.1.alpha1
Provides:	%{name}-amarok = %{version}-%{release}

%description amarok_mediaplayer
Amarok_mediaplayer is a module to put title of current song from Amarok in
your status.

%description amarok_mediaplayer -l pl
Amarok_mediaplayer to moduł umożliwiający umieszczenie tytułu aktualnie
słuchanej piosenki w Amaroku w opisie.

%endif

%if %{with anonymous_check}
%package anonymous_check
Summary:        Automatic lookup of an interlocutor in public directory
Summary(pl):    Automatyczne wyszukiwanie nieznajomych w katalogu
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}

%description anonymous_check
Anonymous_check is a module to automatic lookup who is an interlocutor
when (s)he starts talking to you.

%description anonymous_check -l pl
Anonymous_check to moduł, która automatycznie sprawdza dane w publicznym
katalogu nieznajomego, gdy ten zagada.

%endif

#%if %{with antistring}
#%package antistring
#Summary:        Protection against chain letters
#Summary(pl):    Ochrona przed łańcuszkami
#Group:          Applications/Internet
#Requires:       %{name} = %{version}-%{release}

#%description antistring
#Antistring is a module to protect an user against chain letters.

#%description antistring -l pl
#Antistring to moduł służący do ochrony przed łańcuszkami.

#%endif

%if %{with ao_sound}
%package ao_sound
Summary:	AO library sound module
Summary(pl):	Moduł obsługujący dźwięk przy pomocy libao
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
BuildRequires:	libao-devel
%description ao_sound
Ao_sound is a module to support sound using libao.

%description ao_sound -l pl
Ao_sound to moduł umożliwiający obsługę dźwięku przy użyciu libao.

%endif

%if %{with audacious_mediaplayer}
%package audacious_mediaplayer
Summary:	Audacious support in mediaplayer module
Summary(pl):	Wsparcie dla Audacious w module mediaplayer
Group:		Applications/Internet
BuildRequires:	audacious-devel dbus-glib-devel
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-mediaplayer = %{version}-%{release}

%description audacious_mediaplayer
Audacious_mediaplayer is a module to put title of current song from 
Audacious in your status.

%description audacious_mediaplayer -l pl
Audacious_mediaplayer to moduł umożliwiający umieszczenie tytułu aktualnie
słuchanej piosenki w Audacious w opisie.

%endif

#%if %{with auto_hide}
#%package auto_hide
#Summary:        Auto hide Kadu window
#Summary(pl):    Automatyczne ukrywanie okna Kadu
#Group:          Applications/Internet
#Requires:       %{name} = %{version}-%{release}

#%description auto_hide
#Auto hide Kadu window.

#%description auto_hide -l pl
#Automatyczne ukrywanie okna kadu.

#%endif

%if %{with autostatus}
%package autostatus
Summary:        Autostatus
Summary(pl):    Automatyczne zmiany statusu
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}

%description autostatus
Autostatus is a module to change status automatically.

%description autostatus -l pl
Autostatus to moduł do automatycznych zmian statusu.

%endif

#%if %{with cenzor}
#%package cenzor
#Summary:        Censor
#Summary(pl):    Cenzor
#Group:          Applications/Internet
#Requires:       %{name} = %{version}-%{release}
#
#%description cenzor
#Censor.

#%description cenzor -l pl
#Cenzor.

#%endif

%if %{with falf_mediaplayer}
%package falf_mediaplayer
Summary:	FALF support in mediaplayer module
Summary(pl):	Wsparcie dla FALF w module mediaplayer
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
%description falf_mediaplayer
Falf_mediaplayer is a module to put title of current song from
FALF in your status

%description falf_mediaplayer -l pl
Falf_mediaplayer to moduł umożliwiający umieszczenie tytułu aktualnie
słuchanej piosenki w FALF w opisie.

%endif

%if %{with filedesc}
%package filedesc
Summary:	Get status from file
Summary(pl):	Pobieranie opisów z pliku
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description filedesc
Filedesc is a module to get your status text from a given file.

%description filedesc -l pl
Filedesc to moduł umożliwiający pobieranie tekstu opisu z pliku.

%endif

%if %{with filtering}
%package filtering
Summary:	User list filtering
Summary(pl):	Filtrowanie listy kontaktów
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description filtering
Filtering is a module to filter visible contacts in user list.

%description filtering -l pl
Filtering to moduł umożliwiający filtrowanie widocznych
kontaktów na liście.

%endif

%if %{with firewall}
%package firewall
Summary:	Protection against unwanted chats
Summary(pl):	Ochrona przed niechcianymi rozmowami
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
%description firewall
Firewall is a module to ask a simple question to unknown
interlocutor.

%description firewall -l pl
Firwall to moduł zadający proste, zdefiniowane pytanie
nieznajomym rozmówcom.

%endif

%if %{with globalhotkeys}
%package globalhotkeys
Summary:        Global hotkeys support to Kadu
Summary(pl):    Obsługa skrótów globalnych
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}

%description globalhotkeys
Globalhotkeys is a module that adds support to global
hotkeys in kadu.

%description globalhotkeys -l pl
Globalhotkeys to moduł dodający obsługę skrótów globalnych
w kadu.

%endif

#%if %{with last_seen}
#%package last_seen
#Summary:        Last status info
#Summary(pl):    Informacje o ostatnich statusach kontaktów
#Group:          Applications/Internet
#Requires:       %{name} = %{version}-%{release}

#%description last_seen
#Last_seen is a module to check information of last statuses
#of a given contact.

#%description last_seen -l pl
#Last_seen to moduł umożliwiający sprawdzanie jakie statusy
#miał ostatnio dany kontakt.

#%endif

%if %{with led_notify}
%package led_notify
Summary:	Notification by Scroll Lock LED
Summary(pl):	Powiadamianie diodą Scroll Lock
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description led_notify
Led_notify is a module to notify user of some events using Scroll Lock
LED.


%description led_notify -l pl
Led_notify to moduł umożliwiający powiadamianie użytkownika o pewnych
zdarzenia przy użyciu diody Scroll Lock.

%endif

%if %{with mail}
%package mail
Summary:	Mail checking module
Summary(pl):	Moduł do sprawdzania poczty
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
%description mail
Mail is a module to check whether there are new mails.

%description mail -l pl
Mail to moduł do sprawdzania czy są nowe maile.

%endif

#%if %{with mediaplayer}
#%package mediaplayer
#Summary:	Put a current song name in status
#Summary(pl):	Wstawianie tytułu słuchanej piosenki w opisie
#Group:		Applications/Internet
#Requires:	%{name} = %{version}-%{release}
#%description mediaplayer
#Mediaplayer is a module to put title of current song in status.

#%description mediaplayer -l pl
#Mediaplayer to moduł umożliwiający umieszczenie tytułu obecnie słuchanej
#piosenki w opisie.

#%endif

%if %{with plus_pl_sms}
%package plus_pl_sms
Summary:	Miasto Plusa SMS gateway support
Summary(pl):	Obsługa bramki SMS Miasto Plusa
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
Obsoletes:	%{name}-miastoplusa_sms < 0.6.5-0.1.rc2
Provides:	%{name}-miastoplusa_sms = %{version}-%{release}
BuildRequires:	curl-devel
%description plus_pl_sms
Plus_pl_sms is a module to support Plus.pl SMS Gateway.

%description plus_pl_sms -l pl
Plus_pl_sms to moduł umożliwiający obsługę bramki SMS-owej "Plus.pl".

%endif

%if %{with mime_tex}
%package mime_tex
Summary:	TeX formulas support
Summary(pl):	Obsługa formuł matematycznych TeX
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
%description mime_tex
Mime_tex is a module to edit TeX mathematic formulas in chat window.

%description mime_tex -l pl
Mime_tex to moduł umożliwiający edycję formuł matematycznych TeX
w oknie rozmowy.

%endif

%if %{with mx610_notify}
%package mx610_notify
Summary:	Notify with LED on Logitech MX610 mouse
Summary(pl):	Powiadamianie diodami LED w myszce Logitech MX610
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
%description mx610_notify
Mx610_notify is a module to notify user of some events using LED
on Logitech MX610 mouse.

%description mx610_notify -l pl
Mx610_notify to moduł umożliwiający powiadamianie użytkownika
o pewnych zdarzeniach przy pomocy diod LED myszki Logitech MX610.

%endif

%if %{with osd_hints}
%package osd_hints
Summary:	Notification by OSD-like hints
Summary(pl):	Powiadamanie o zdarzeniach przy pomocy dymków typu OSD
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
Obsoletes:	%{name}-osdhints-notify < 0.6.5-1
Provides:	%{name}-osd_hints = %{version}-%{release}
%description osd_hints
Osd_hints is a module to notify users about some events
with OSD-like hints.

%description osd_hints -l pl
Osd_hints to moduł umożliwiający powiadamianie użytkownika
o pewnych zdarzeniach przy pomocy dymków typu OSD.

%endif

%if %{with panelkadu}
%package panelkadu
Summary:	Makes a panel from Kadu main window
Summary(pl):	Zamienia Kadu w panel na skraju ekranu
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
BuildRequires:  libXtst-devel
%description panelkadu
Panelkadu is a module to make a panel from Kadu main window.

%description panelkadu -l pl
Panelkadu to moduł zamieniający kadu w panel na skraju ekranu.

%endif

#%if %{with parser_extender}
#%package parser_extender
#Summary:        Extends Kadu Parser
#Summary(pl):    Rozszerza możliwości parsera Kadu
#Group:          Applications/Internet
#Requires:       %{name} = %{version}-%{release}

#%description parser_extender
#Extends Kadu Parser.

#%description parser_extender -l pl
#Rozszerza możliwość parsera Kadu.

#%endif

%if %{with pcspeaker}
%package pcspeaker
Summary:	Notify by PC Speaker
Summary(pl):	Powiadamianie przy pomocy PC Speakera
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description pcspeaker
Pcspeaker is a module to notify user of some events using PC Speaker.


%description pcspeaker -l pl
Pcspeaker to moduł umożliwiający powiadamianie użytkownika o pewnych
zdarzeniach przy pomocy PC Speakera.

%endif

%if %{with powerkadu}
%package powerkadu
Summary:        PowerKadu
Summary(pl):    PowerKadu
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
Requires:	%{name}-anonymous_check = %{version}-%{release}
#Requires:	kadu-antistring = %{version}-%{release}
#Requires:	kadu-auto_hide = %{version}-%{release}
#Requires:	kadu-cenzor = %{version}-%{release}
#Requires:	kadu-parser_extender = %{version}-%{release}
Requires:	%{name}-split_messages = %{version}-%{release}
#Requires:	kadu-word_fix = %{version}-%{release}

#All submodules except anonymous-check and split_messages are now merged into kadu core, 
#so powerkadu shouldn't require them.
 
%description powerkadu
PowerKadu is a metapackage which contains modules known from the "old"
powerkadu.

%description powerkadu -l pl
PowerKadu to teraz metapakiet, który zawiera moduły znane ze "starego"
powerkadu.

%endif

%if %{with profiles}
%package profiles
Summary:	Profiles support
Summary(pl):	Obsługa profili
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description profiles
Profiles is a module to quick and comfortable support of multiple
profiles.

%description profiles -l pl
Profiles to moduł umożliwiający szybką i wygodnę obsługę wielu
profili.

%endif

%if %{with screenshot}
%package screenshot
Summary:	Make a screenshot and send it
Summary(pl):	Tworzenie zrzutu ekranu i wysłanie go
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description screenshot
Screenshot is a module to select a part of the screen and send an
image with its content.

%description screenshot -l pl
Screenshot to moduł umożliwiający zaznaczenie części ekranu
i wysłania obrazka z jego zawartością.

%endif

%if %{with senthistory}
%package senthistory
Summary:	History of sent messages in chat windows
Summary(pl):	Historia wysłanych wiadomości w oknie rozmowy
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description senthistory
Senthistory is a module which adds history of sent messages to
chat windows.

%description senthistory -l pl
Senthistory to moduł, który dodaje historię wysłanych wiadomości
do okien rozmowy.

%endif

%if %{with spellchecker}
%package spellchecker
Summary:	Spellchecking in chat window
Summary(pl):	Sprawdzanie pisowni w oknie rozmowy
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
BuildRequires:	aspell-devel
%description spellchecker
Spellchecker is a module to check spelling in chat window.

%description spellchecker -l pl
Spellchecker to moduł umożliwiający sprawdzanie pisowni w oknie
rozmowy.

%endif

%if %{with split_messages}
%package split_messages
Summary:        Split too long messages
Summary(pl):    Dzielenie zbyt długich wiadomości
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}

%description split_messages
Split_messages is a module to split a message to smaller parts
if it's too long.

%description split_messages -l pl
Split_messages to moduł dzielący wiadomość na mniejsze części,
jeśli jest za długa.

%endif

%if %{with tabs}
%package tabs
Summary:	Tabbed chat dialog
Summary(pl):	Okno rozmowy z zakładkami
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description tabs
Tabs is a module to add a feature to use one window to talk with all
people and use cards to switch them.

%description tabs -l pl
Tabs to moduł dodający możliwość prowadzenia rozmów w jednym oknie,
w którym pomiędzy poszczególnymi rozmówcami przełącza się przy pomocy
zakładek.

%endif

%if %{with water_notify}
%package water_notify
Summary:	Notifications by Water Compiz plugin
Summary(pl):	Powiadomienia kroplami wody w Compiz
Group:          Applications/Internet
Requires:       %{name} = %{version}-%{release}
BuildRequires:	dbus-devel
%description water_notify
Water_notify is a module to notify user about some events with
Water Compiz plugin.

%description water_notify -l pl
Water_notify to moduł umożliwiający powiadamianie użytkownika
o pewnych zdarzeniach przy użyciu wtyczki Woda z Compiza.

%endif


%if %{with weather}
%package weather
Summary:	Weather checking
Summary(pl):	Sprawdzanie pogody
Group:		Applications/Internet
Requires:	%{name} = %{version}-%{release}
%description weather
Weather is a module to check weather forecast for a few nearest days.
It also allows to check weather for people in contact list and any other
city that is available.

%description weather -l pl
Moduł pobiera i wyświetla informacje pogodowe oraz prognozę na następne
dni. Umożliwia wyświetlenie pogody dla wybranego kontaktu na liście
kontaktów oraz dla dowolnego miasta, dla którego dostępna jest prognoza.

%endif

#%if %{with word_fix}
#%package word_fix
#Summary:        Automatic word replacement
#Summary(pl):    Automatyczna zamiana słów
#Group:          Applications/Internet
#Requires:       %{name} = %{version}-%{release}

#%description word_fix
#Automatic word replacement

#%description word_fix -l pl
#Automatyczna zamiana słów

#%endif

%if %{with xmms_mediaplayer}
%package xmms_mediaplayer
Summary:	Xmms support in mediaplayer module
Summary(pl):	Wsparcie dla Xmms w module mediaplayer
Group:		Applications/Internet
BuildRequires:	xmms-devel
Requires:	%{name} = %{version}-%{release}
Requires:	%{name}-mediaplayer = %{version}-%{release}
Obsoletes:	%{name}-xmms < 0.6.0-0.1.alpha1
Provides:	%{name}-xmms = %{version}-%{release}
%description xmms_mediaplayer
Xmms_mediaplayer is a module to put title of current song from xmms in
your status.

%description xmms_mediaplayer -l pl
Xmms_mediaplayer to moduł umożliwiający umieszczenie tytułu aktualnie
słuchanej piosenki w xmms w opisie.

%endif


%prep
%setup -q -n kadu
%unpack_module_source 109 agent
%unpack_module_source 101 amarok_mediaplayer
%unpack_module_source 117 anonymous_check
%unpack_module_source 119 audacious_mediaplayer
%unpack_module_source 102 globalhotkeys
%unpack_module_source 110 falf_mediaplayer
%unpack_module_source 104 led_notify
%unpack_module_source 111 mail
%unpack_module_source 112 mime_tex
%unpack_module_source 113 mx610_notify
%unpack_module_source 115 osd_hints
%unpack_module_source 114 panelkadu
%unpack_module_source 105 plus_pl_sms
%unpack_module_source 118 powerkadu
%unpack_module_source 103 senthistory
%unpack_module_source 120 split_messages
%unpack_module_source 106 tabs
%unpack_module_source 116 water_notify
%unpack_module_source 107 weather
%unpack_module_source 108 xmms_mediaplayer
%setup -q -D -T -n kadu

%enable_module alsa_sound
%enable_module antistring
%enable_module ao_sound
%enable_module auto_hide
%enable_module autostatus
%enable_module cenzor
%enable_module filedesc
%enable_module filtering
%enable_module firewall
%enable_module last_seen
#enable_module mediaplayer
%enable_module qt4_docking
%enable_module qt4_sound
%enable_module parser_extender
%enable_module pcspeaker
%enable_module profiles
%enable_module screenshot
%enable_module spellchecker
%enable_module word_fix

# exec_notify and ext_sound have always been standard modules
# so let's keep it this way
sed "s#^module_exec_notify=.#module_exec_notify=m#" -i .config
sed "s#^module_ext_sound=.#module_ext_sound=m#" -i .config

sed "s#^icons_glass16=.#icons_glass16=n#" -i .config
sed "s#^icons_glass22=.#icons_glass22=n#" -i .config

%if %{with audacious_mediaplayer}
pushd modules/audacious_mediaplayer
sed 's#cflags`#cflags` -I/usr/include/dbus-1.0#' -i spec
# above adds missing include path
popd
%endif

#let's not annoy users with update notifies
#and disable them

pushd kadu-core
sed "/CheckUpdates/s#true#false#" -i kadu.cpp
popd

# force the right lib path and set DETAILED_VERSION
sed 's#set (LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)#set (LIBDIR %{_libdir})#' -i CMakeLists.txt
sed 's@#define DETAILED.*@#define DETAILED_VERSION "%{name}-%{version}-%{release}"@' -i kadu-config.h.cmake

# fix mediaplayer plugin bug
#echo 'install (FILES "data/mediaplayer.png" DESTINATION "share/kadu/modules/data/mediaplayer")' >> modules/mediaplayer/CMakeLists.txt

%patch0

%build
%{cmake} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_USE_PTHREADS:BOOL=ON -DBUILD_DESCRIPTION="Fedora" .
make VERBOSE=1 %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_datadir}/applnk/Internet/kadu.desktop
rm -rf $RPM_BUILD_ROOT%{_datadir}/applications/kadu.desktop
desktop-file-install --vendor fedora				\
	--dir ${RPM_BUILD_ROOT}%{_datadir}/applications		\
	%{SOURCE3}

if [ "x%{_lib}" != "xlib" ]; then
	mv $RPM_BUILD_ROOT%{_prefix}/lib $RPM_BUILD_ROOT%{_libdir}
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)

%doc COPYING
%{_bindir}/kadu
%{_datadir}/applications/fedora-kadu.desktop
%dir %{_libdir}/kadu
%dir %{_libdir}/kadu/modules
%dir %{_datadir}/kadu
%{_datadir}/kadu/syntax
%{_datadir}/kadu/AUTHORS
%{_datadir}/kadu/ChangeLog
%{_datadir}/kadu/COPYING
%{_datadir}/kadu/HISTORY
%{_datadir}/kadu/README
%{_datadir}/kadu/THANKS
%{_datadir}/kadu/configuration
%dir %{_datadir}/kadu/modules
%dir %{_datadir}/kadu/modules/configuration
%dir %{_datadir}/kadu/modules/data
%dir %{_datadir}/kadu/modules/translations
%dir %{_datadir}/kadu/themes
%dir %{_datadir}/kadu/themes/emoticons
%{_datadir}/kadu/themes/emoticons/penguins
%dir %{_datadir}/kadu/themes/icons
%{_datadir}/kadu/themes/icons/default
%dir %{_datadir}/kadu/themes/sound
%{_datadir}/kadu/themes/sound/default
%{_datadir}/kadu/translations
%{_datadir}/pixmaps/kadu*.png
%{_datadir}/kadu/modules/docking.desc
%{_datadir}/kadu/modules/configuration/docking.ui
%{_datadir}/kadu/modules/translations/docking_*.qm

# internal modules:
%module_files account_management -t
%module_files advanced_userlist -ct
%module_files alsa_sound -ct
%module_files antistring -cdt
%module_files ao_sound
%module_files auto_hide -ct
%module_files autoaway -ct
%module_files autoresponder -ct
%module_files autostatus -ct
%module_files cenzor -cdt
%module_files config_wizard -td
%module_files dcc -ct
%module_files default_sms -ct
%module_files dsp_sound -ct
%module_files encryption -ct
%module_files exec_notify -t
%module_files ext_sound -ct
%module_files filedesc -ct
%module_files filtering -cdt
%module_files firewall -ct
%module_files hints -ct
%module_files history -ct
%module_files last_seen -t
#module_files mediaplayer -cdt
%module_files notify -ct
%module_files qt4_docking
%module_files qt4_sound
%module_files parser_extender -ct
%module_files pcspeaker -ct
%module_files profiles -t
%module_files screenshot -ct
%module_files sms -ct
%module_files sound -ct
%module_files spellchecker -ct
%module_files voice -ct
%module_files window_notify -t
%module_files word_fix -cdt

# external modules:

%if %{with agent}
%files agent
%defattr(-, root, root, -)
%module_files agent -t
%endif

%if %{with amarok_mediaplayer}
%files amarok_mediaplayer
%defattr(-, root, root, -)
%module_files amarok_mediaplayer
%endif

%if %{with anonymous_check}
%files anonymous_check
%defattr(-, root, root, -)
%module_files anonymous_check -ct
%endif

%if %{with arts_sound}
%files arts_sound
%defattr(-, root, root, -)
%module_files arts_sound
%{_libdir}/kadu/modules/bin/arts_sound
%endif

%if %{with audacious_mediaplayer}
%files audacious_mediaplayer
%defattr(-, root, root, -)
%module_files audacious_mediaplayer
%endif

#%if %{with cenzor}
#%files cenzor
#%defattr(-, root, root, -)
#%module_files cenzor -cdt
#%endif

#if %{with dcopexport}
#files dcopexport
#defattr(-, root, root, -)
#module_files dcopexport -dt
#{_libdir}/kadu/modules/bin/dcopexport
#endif

%if %{with falf_mediaplayer}
%files falf_mediaplayer
%defattr(-, root, root, -)
%module_files falf_mediaplayer
%endif

%if %{with globalhotkeys}
%files globalhotkeys
%defattr(-, root, root, -)
%module_files globalhotkeys -ct
%endif

%if %{with led_notify}
%files led_notify
%defattr(-, root, root, -)
%module_files led_notify -ct
%endif

%if %{with mail}
%files mail
%defattr(-, root, root, -)
%module_files mail -ct
%endif

%if %{with plus_pl_sms}
%files plus_pl_sms
%defattr(-, root, root, -)
%module_files plus_pl_sms -cdt
%endif

%if %{with mime_tex}
%files mime_tex
%defattr(-, root, root, -)
%module_files mime_tex -cdt
%{_libdir}/kadu/modules/bin/mime_tex
%endif

%if %{with mx610_notify}
%files mx610_notify
%defattr(-, root, root, -)
%module_files mx610_notify -ct
%endif

%if %{with osd_hints}
%files osd_hints
%defattr(-, root, root, -)
%module_files osd_hints -cdt
%endif

%if %{with panelkadu}
%files panelkadu
%defattr(-, root, root, -)
%module_files panelkadu -ct
%endif

%if %{with powerkadu}
%files powerkadu
%defattr(-, root, root, -)
%module_files powerkadu -dt
%endif

%if %{with senthistory}
%files senthistory
%defattr(-, root, root, -)
%module_files senthistory -ct
%endif

%if %{with split_messages}
%files split_messages
%defattr(-, root, root, -)
%module_files split_messages -ct
%endif


%if %{with tabs}
%files tabs
%defattr(-, root, root, -)
%module_files tabs -ct
%endif

%if %{with water_notify}
%files water_notify
%defattr(-, root, root, -)
%module_files water_notify -ct
%endif


%if %{with weather}
%files weather
%defattr(-, root, root, -)
%module_files weather -cdt
%endif

%if %{with xmms_mediaplayer}
%files xmms_mediaplayer
%defattr(-, root, root, -)
%module_files xmms_mediaplayer
%endif


%changelog
* Wed Dec 03 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.5-1
- 0.6.5
- Lots of changes:
-    some modules are now considered default,
-    some others are disabled,
-    some no longer exists,
-    some changed name,
- Parameter "--with=opt" given to rpmbuild makes kadu build to
  /opt instead of /usr (useful feature in testing)
- Kadu now uses qt4
- Lots of Obsoletes/Provides to prevent breaking updates
- Etc.

* Mon May 19 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0.1-1
- 0.6.0.1
- New version of mime_tex, tabs, firewall, osd_hints, powerkadu,
audacious_mediaplayer
- New url of ao_sound
- New modules: autostatus, last_seen, globalhotkeys
- Panelkadu requires libXtst-devel to build

* Tue Apr 01 2008 Rex Dieter <rdieter@fedoraproject.org> - 0.6.0-3
- -devel: qt3-devel (f9+)

* Wed Mar 12 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-2
- Fix bugs 436574 (f8) and 436575 (f7)
- New versions of tabs and osd_hints
- New modules: anonymous_check antistring auto_hide cenzor parser_extender 
powerkadu split_messages word_fix


* Thu Feb 28 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-1
- Stable
- New versions of osd_hints, audacious_mediaplayer, filtering,
mediaplayer and panelkadu

* Mon Feb 18 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.12.rc4
- rc4
- Add modules: water_notify, osd_hints, panelkadu

* Wed Feb 13 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.11.rc3
- rc3
- New firewall module
- New versions of some modules

* Sun Feb 03 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.10.rc2.try2
- rc2-try2

* Sun Feb 03 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.9.rc2
- rc2
- New versions of led_notify, weather, pcspeaker, mime_tex, tabs,
mediaplayer, xmms_mediaplayer and mail modules
- Add filtering module
- Get rid of xmmsfix patch
- Fix mail module

* Sun Jan 13 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.8.rc1
- rc1
- New mx610_notify, falf_mediaplayer, mail and mime_tex modules.
- New versions of some modules

* Sun Jan 06 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.7.beta2
- Fix bug 427679 (add forgotten %% symbol in one place)

* Sun Jan 06 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.6.beta2
- Now forgot to include that one source changed its name

* Sun Jan 06 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.5.beta2
- Forgot to upload some sources...

* Sat Jan 05 2008 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.4.beta2
- beta2
- Add kadu-agent

* Fri Dec 21 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.3.beta1
- 0.6.0-beta1
- Changes of almost everything, spec file has been completely rewritten
- Get rid of stupid macros including %%{_kadudir} and %%{_modtrans}
- Make it possible to build any subpackages whoever wants, no need to build
all
- Add Polish descriptions to all subpackages and change English ones
- There are too many changes to list all of them ;-)
- Hope it's now much more readable and user-friendly

* Wed Dec 19 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.2.alpha2
- 0.6.0-alpha2
- New pcspeaker module
- New version of miastoplusa_sms, profiles, dcopexport

* Sat Dec 01 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.6.0-0.1.alpha1
- 0.6.0-alpha1
- remove xmms, amarok, mail, extinfo, iwait4u, powerkadu, advanced_userlist, osd_hints, screenshot, firewall, filedesc
- update spellchecker, weather, dcopexport, miastopolusa_sms, tabs, led_notify, filtering
- get rid of tabs patch
- add filedesc, spellchecker and firewall patches
- exec_notify is now built-in

* Fri Aug 24 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-4
- Fix desktop file

* Fri Aug 24 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-3
- BuildID rebuild
- Fix License tag

* Thu Apr 05 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-2
- Own %%{_datadir}/kadu/modules/data (BZ: 233855)

* Tue Jan 02 2007 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-1
- Finally a stable release

* Mon Dec 25 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.21.rc2
- Bump to RC2

* Mon Nov 14 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.20.rc1
- Add advanced_userlist, osd_hints and screenshot modules

* Wed Nov 08 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.19.rc1
- Update kadu to RC1
- Update ext_info module to 2.0beta9
- Update powerkadu module to 20061026
- Update xmms module to 1.32
- Update amarok module to 1.19
- Amarok builds on all architectures again
- Add tabs patch

* Thu Nov 02 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.18.20060915svn
- Come back to 20060915

* Sun Oct 29 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.17.20061029svn
- Disabling kadu-amarok on ppc arch

* Sun Oct 29 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.16.20061029svn
- Bump cvs snapshot to 20061029

* Tue Oct 10 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.15.20060915svn
- Another fix to not rebuilding kadu-amarok

* Sat Oct 07 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.14.20060915svn
- It really shoud work now

* Sat Oct 07 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.13.20060915svn
- It should work now

* Fri Oct 06 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.12.20060915svn
- Yet another fix...

* Fri Oct 06 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.11.20060915svn
- Rpmbuild build error workaround.

* Fri Oct 06 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.10.20060915svn
- Not rebuilding kadu-amarok on some archs

* Sat Sep 16 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.9.20060915svn
- Update upstream to 20060915
- Move themes to external spec file
- Link to existing libgadu

* Mon Sep 04 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.8.20006808svn
- FC6 rebuild

* Fri Aug 11 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.7.20060808svn
- Update upstream to 20060808
- Add firewall and wmaker_docking modules

* Sun Jul 30 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.6.20060730svn
- Update upstream do 20060730, with fixed x64 bugs
- Add mail module and emots theme

* Thu Jul 27 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.5.20060727svn
- Delete qt dependency
- Exclude libgadu.a file
- Add powerkadu, filtering and profiles modules

* Mon Jul 24 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.4.20060716svn
- Add COPYING file to doc

* Sun Jul 23 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.3.20060716svn
- Yet another fix permissions of .so files

* Sun Jul 23 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.2.20060716svn
- Fix Source0 address
- Fix permissions of .so files
- Remove libsndfile require
- Fix some descriptions of subpackages
- Add --enable-debug and --disable-dependency-tracking options to configure

* Thu Jul 20 2006 Michał Bentkowski <mr.ecik at gmail.com> - 0.5.0-0.1.20060716svn
- Another first release