summaryrefslogtreecommitdiff
blob: efb8cd6c87cceca2eba008f9570125e75b27c173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-im/kadu/kadu-0.4.3.ebuild,v 1.4 2005/12/02 09:13:17 josejx Exp $

inherit flag-o-matic eutils

TCL="0.6.2-Josephine"		#http://scripts.one.pl/tcl4kadu
TABS="rev38"				#http://gov.one.pl/svnsnap
AMAROK="1.13"				#http://scripts.one.pl/amarok
WEATHER="2.02"				#http://www.kadu.net/~blysk/
#EXT_INFO="2.0beta5"			#http://kadu-ext-info.berlios.de
EXT_INFO="1.4.3"
XMMS="1.25"					#http://scripts.one.pl/xmms
XOSD_NOTIFY="050607"		#http://www.kadu.net/~joi/xosd_notify
MAIL="0.2.0"				#http://michal.gov.one.pl/mail
SPELLCHECKER="0.15"			#http://scripts.one.pl/spellchecker
SPY="0.0.8-1"				#http://scripts.one.pl/~przemos/projekty/kaduspy/
FIREWALL="0.8"				#http://users.skorpion.wroc.pl/arturmat/firewall/
LED_NOTIFY="0.2"			#http://republika.pl/buysk/led_notify
SCREEN_SHOT="0.3.1"			#http://scripts.one.pl/screenshot
CONTACTS="1.0rc1"			#http://obeny.kicks-ass.net/obeny/kadu/modules/contacts
OSD_NOTIFY="0.2.6"			#http://www.kadu.net/~pan_wojtas/osdhints_notify/
THEMES="kadu-theme-crystal-16
	kadu-theme-crystal-22
	kadu-theme-gg3d
	kadu-theme-noia-16
	kadu-theme-nuvola-16
	kadu-theme-nuvola-22
	kadu-theme-old_default
	kadu-theme-piolnet
	kadu-theme-real_gg
	alt_cryst"				#http://www.kadu.net/download/additions

DESCRIPTION="QT client for popular in Poland Gadu-Gadu IM network"
HOMEPAGE="http://kadu.net/"

LICENSE="GPL-2"

SLOT="0"
KEYWORDS="amd64 ppc x86"

IUSE="debug alsa arts esd voice speech nas oss spell ssl tcltk
	xmms xosd amarok extraicons extramodules mail config_wizard"

DEPEND="=x11-libs/qt-3*
	alsa? ( media-libs/alsa-lib virtual/alsa
	media-libs/libsndfile )
	arts? ( kde-base/arts
			media-libs/libsndfile )
	esd? ( media-sound/esound
			media-libs/libsndfile )
	nas? ( media-libs/nas
			media-libs/libsndfile )
	oss? ( media-libs/libsndfile )
	config_wizard? ( media-libs/libsndfile )
	voice? ( media-libs/libsndfile )
	amarok? ( media-sound/amarok )
	spell? ( app-dicts/aspell-pl )
	ssl? ( dev-libs/openssl )
	speech? ( app-accessibility/powiedz )
	tcltk? ( >=dev-lang/tcl-8.4.0 >=dev-lang/tk-8.4.0 )
	xmms? ( media-sound/xmms )
	xosd? ( x11-libs/xosd )"


SRC_URI="http://kadu.net/download/stable/${P}.tar.bz2
	amarok? ( http://scripts.one.pl/amarok/stable/0.4.0/amarok-${AMAROK}.tar.gz )
	tcltk? ( http://scripts.one.pl/tcl4kadu/files/stable/${PV}/tcl_scripting-${TCL}.tar.gz )
	extraicons? (
	    http://biprowod.wroclaw.pl/kadu/kadu-theme-alt_cryst.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-crystal-16.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-crystal-22.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-gg3d.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-noia-16.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-nuvola-16.tar.gz
	    http://www.kadu.net/download/additions/kadu-theme-nuvola-22.tar.gz
	    http://www.kadu.net/download/additions/kadu-theme-old_default.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-piolnet.tar.bz2
	    http://www.kadu.net/download/additions/kadu-theme-real_gg.tar.bz2 )
	extramodules? (
		http://gov.one.pl/svnsnap/tabs-svn-${TABS}.tar.gz
	    http://www.kadu.net/~blysk/weather-${WEATHER}.tar.bz2
	    http://www.kadu.net/~dzwiedziu/pub/ext_info-${EXT_INFO}.tar.bz2
		http://scripts.one.pl/~przemos/download/kadu-spy-${SPY}.tar.gz
	    http://users.skorpion.wroc.pl/arturmat/firewall/files/firewall-${FIREWALL}.tar.bz2
	    http://pcb45.tech.us.edu.pl/~blysk/led_notify/led_notify-${LED_NOTIFY}.tar.bz2
		http://scripts.one.pl/screenshot/stable/0.4.0/screenshot-${SCREEN_SHOT}.tar.gz
		http://obeny.kicks-ass.net/obeny/kadu/modules/contacts/contacts-${CONTACTS}.tar.bz2
		http://www.kadu.net/~joi/kde_transparency.tar.bz2
		http://www.kadu.net/~pan_wojtas/osdhints_notify/download/kadu-osdhints_notify-${OSD_NOTIFY}.tar.gz )
	xmms? ( http://scripts.one.pl/xmms/devel/0.4.0/xmms-${XMMS}.tar.gz )
	xosd? ( http://www.kadu.net/~joi/xosd_notify/packages/xosd_notify-${XOSD_NOTIFY}.tar.bz2 )
	mail? ( http://michal.kernel-panic.cjb.net/mail/tars/release/mail-${MAIL}.tar.bz2 )
	spell? (
	http://scripts.one.pl/spellchecker/devel/${PV}/spellchecker-${SPELLCHECKER}.tar.gz
	)"


S=${WORKDIR}/${PN}

enable_module() {
	if use ${1}; then
	    mv ${WORKDIR}/${2} ${WORKDIR}/kadu/modules/
	    module_config ${2} m
	fi
}

module_config() {
	sed -i -r "s/(^module_${1}\\s*=\\s*).*/\\1${2}/" .config
}

spec_config() {
	sed -i -r "s/(^${2}\\s*=\\s*).*//" modules/${1}/spec
	echo "${2}=${3}" >> modules/${1}/spec
}

src_unpack() {
	unpack ${A}
	cd ${S}

	# Disabling autodownload for modules
	rm -f ${WORKDIR}/kadu/modules/*.web

	# Disabling autodownload for icons
	rm -f ${WORKDIR}/kadu/varia/themes/icons/*.web

	# Disabling all modules and iconsets for further activation via USE flags
	sed .config -i -e 's/=m/=n/g'
	sed .config -i -e 's/=y/=n/g'

	# Enable default icon theme
	sed .config -i -e 's/icons_default=n/icons_default=y/'

	enable_module amarok amarok
	enable_module spell spellchecker
	enable_module xmms xmms
	enable_module xosd xosd_notify
	enable_module mail mail
	enable_module tcltk "tcl_scripting"

	enable_module extramodules weather
	enable_module extramodules ext_info
	enable_module extramodules spy
	enable_module extramodules led_notify
	enable_module extramodules tabs
	enable_module extramodules screenshot
	enable_module extramodules osdhints_notify

	# put some patches
	epatch ${FILESDIR}/kadu-toolbar_toggle-gentoo.diff
#	use tcltk && epatch ${FILESDIR}/${P}-tcltk.patch
	use xosd && epatch ${FILESDIR}/xosd-gentoo.patch
}

src_compile() {
	# Enabling default iconset
	module_config icons_default y

	# Enabling dependencies that are needed by other modules
	module_config account_management m
	module_config autoaway m
	module_config autoresponder m
	module_config dcc m
	module_config default_sms m
	module_config docking m
	module_config filedesc m
	module_config hints m
	module_config notify m
	module_config sms m
	module_config desktop_docking m
	use config_wizard && \
		( module_config sound m; module_config config_wizard m )

	if use extramodules; then
		if use !tcltk; then
			ewarn "script_chess depends on module_tcl_scripting;"
			ewarn "It won't be installed."
		fi
	fi

	# Firewall
	if use extramodules; then
		if use !tcltk; then
			ewarn "script_firewall depends on module_tcl_scripting;"
			ewarn "It won't be installed."
		fi
	fi

	use speech && module_config speech m
	use extramodules && module_config autoresponder

	# static modules (disable only, do not compile as .so)
	use ssl && module_config encryption y

	# dynamic modules
	use alsa 	&&	( module_config sound m; module_config alsa_sound m )
	use arts 	&& 	( module_config sound m; module_config arts_sound m )
	use esd 	&&	( module_config sound m; module_config esd_sound m )
	use nas 	&&	( module_config sound m; module_config nas_sound m )
	use voice 	&&	( module_config sound m; module_config voice m )
	use oss 	&&	( module_config sound m; module_config dsp_sound m )
	module_config x11_docking m
	module_config wmaker_docking m

	# Some fixes
	einfo "Fixing modules spec files"
	if use arts; then
	    spec_config arts_sound MODULE_INCLUDES_PATH "\"$(kde-config --prefix)/include $(kde-config --prefix)/include/artsc\""
	    spec_config arts_sound MODULE_LIBS_PATH $(kde-config --prefix)/lib
	fi
	if use amarok; then
	    spec_config amarok MODULE_INCLUDES_PATH $(kde-config --prefix)/include
	    spec_config amarok MODULE_LIBS_PATH $(kde-config --prefix)/lib
	fi

	if use extramodules; then
	    einfo "Changing default firewall log location to user's homedir/.gg/firewall.log"
	    sed ${WORKDIR}/firewall.tcl -i -e \
			's%$module(scriptpath)/firewall.log%$env(HOME)/.gg/firewall.log%g'
	fi

	local myconf
	myconf="${myconf} --enable-modules --enable-dist-info=Gentoo"

	use voice && myconf="${myconf} --enable-dependency-tracing"
	use debug && myconf="${myconf} --enable-debug"

	econf ${myconf} || die
	emake || die
}

src_install() {
	make \
		DESTDIR=${D} \
		install || die

	# Installing additional scripts and plugins
	# Chess and Firewall
	if use extramodules; then
	    if use tcltk; then
		einfo "Installing Chess script"
		insinto /usr/share/kadu/modules/data/tcl_scripting/scripts
		doins ${WORKDIR}/KaduChess/{data,pics,KaduChess.tcl}
		# small fix form author's site
		sed ${D}/usr/share/kadu/modules/data/tcl_scripting/scripts/KaduChess.tcl -i -e \
			's/on chat0 KC_recv KC_recv/on chat0 KC_recv/g'

		einfo "Installing Firewall module"
		doins ${WORKDIR}/firewall{.tcl,.png}
	    fi
	fi

	if use extraicons; then
	    einfo "Installing extra icons"
		for theme in ${THEMES}; do
			insinto /usr/share/kadu/themes/icons/${theme}
			doins ${WORKDIR}/${theme}/{icons.conf,*.png}
		done
	fi
}