34 Distribution: OpenPKG Community |
35 Distribution: OpenPKG Community |
35 Class: PLUS |
36 Class: PLUS |
36 Group: InstantMessaging |
37 Group: InstantMessaging |
37 License: JOSL/GPL |
38 License: JOSL/GPL |
38 Version: %{V_major}.%{V_minor} |
39 Version: %{V_major}.%{V_minor} |
39 Release: 20090707 |
40 Release: 20091028 |
40 |
41 |
41 # package options |
42 # package options |
42 %option with_sqlite no |
43 %option with_mucon yes |
|
44 %option with_sqlite yes |
43 %option with_mysql no |
45 %option with_mysql no |
44 %option with_pgsql no |
46 %option with_pgsql no |
45 %option with_pam no |
47 %option with_pam no |
46 |
48 |
47 # list of sources |
49 # list of sources |
48 Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz |
50 Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz |
49 Source1: rc.jabberd |
51 Source1: http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz |
|
52 Source2: rc.jabberd |
50 Patch0: jabberd.patch |
53 Patch0: jabberd.patch |
51 |
54 |
52 # build information |
55 # build information |
53 Prefix: %{l_prefix} |
56 Prefix: %{l_prefix} |
54 BuildRoot: %{l_buildroot} |
57 BuildRoot: %{l_buildroot} |
55 BuildPreReq: OpenPKG, openpkg >= 20060823, make |
58 BuildPreReq: OpenPKG, openpkg >= 20060823, make |
56 PreReq: OpenPKG, openpkg >= 20060823, perl |
59 PreReq: OpenPKG, openpkg >= 20060823, perl |
57 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
60 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
58 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
61 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
|
62 %if "%{with_mucon}" == "yes" |
|
63 BuildPreReq: glib2 |
|
64 PreReq: glib2 |
|
65 %endif |
59 %if "%{with_sqlite}" == "yes" |
66 %if "%{with_sqlite}" == "yes" |
60 BuildPreReq: sqlite |
67 BuildPreReq: sqlite |
61 PreReq: sqlite |
68 PreReq: sqlite |
62 %endif |
69 %endif |
63 %if "%{with_mysql}" == "yes" |
70 %if "%{with_mysql}" == "yes" |
86 prog jabberd = { |
93 prog jabberd = { |
87 version = %{version} |
94 version = %{version} |
88 url = http://codex.xiaoka.com/pub/jabberd2/releases/ |
95 url = http://codex.xiaoka.com/pub/jabberd2/releases/ |
89 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz |
96 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz |
90 } |
97 } |
|
98 prog jabberd:mucon = { |
|
99 version = %{V_mucon} |
|
100 url = http://download.gna.org/mu-conference/ |
|
101 regex = mu-conference_(__VER__)\.tar\.gz |
|
102 } |
91 |
103 |
92 %prep |
104 %prep |
93 %setup -q -n jabberd-%{version} |
105 %setup -q -n jabberd-%{version} |
|
106 %setup -q -D -T -a 1 |
94 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b |
107 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b |
95 %{l_shtool} subst \ |
108 %{l_shtool} subst \ |
96 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ |
109 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ |
97 tools/jabberd.in |
110 tools/jabberd.in |
|
111 %if "%{with_mucon}" == "yes" |
|
112 %{l_shtool} subst \ |
|
113 -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \ |
|
114 -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \ |
|
115 mu-conference_%{V_mucon}/src/Makefile |
|
116 %{l_shtool} subst \ |
|
117 -e 's;mu-conference.log;muc.log;g' \ |
|
118 mu-conference_%{V_mucon}/src/jcomp/jcr_log.c |
|
119 %{l_shtool} subst \ |
|
120 -e 's;<port>[0-9][0-9]*</port>;<port>5347</port>;' \ |
|
121 -e 's;<spool>.*</spool>;<spool>%{l_prefix}/var/jabberd/spool/rooms</spool>;' \ |
|
122 -e 's;<logdir>\./syslogs</logdir>;<logdir>%{l_prefix}/var/jabberd/log</logdir>;' \ |
|
123 -e 's;<logdir>\./logs/</logdir>;<logdir>%{l_prefix}/var/jabberd/spool/logs</logdir>;' \ |
|
124 -e 's;<pidfile>.*</pidfile>;<pidfile>%{l_prefix}/var/jabberd/pid/muc.pid</pidfile>;' \ |
|
125 -e 's;<URL>.*</URL>;<URL>http://name.host.tld/</URL>;' \ |
|
126 -e 's;<stylesheet>.*</stylesheet>;<stylesheet>%{l_prefix}/share/jabberd/style.css</stylesheet>;' \ |
|
127 mu-conference_%{V_mucon}/muc-default.xml |
|
128 echo \ |
|
129 'muc @sysconfdir@/muc.xml' \ |
|
130 >>etc/jabberd.cfg.dist.in |
|
131 %endif |
98 |
132 |
99 %build |
133 %build |
100 # configure program |
134 # configure program |
101 export CC="%{l_cc}" |
135 export CC="%{l_cc}" |
102 export CFLAGS="%{l_cflags -O}" |
136 export CFLAGS="%{l_cflags -O}" |
162 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \ |
209 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \ |
163 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \ |
210 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \ |
164 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ |
211 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ |
165 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log |
212 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log |
166 |
213 |
167 # install components |
214 # install required components |
168 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
215 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
|
216 |
|
217 # install optional components |
|
218 %if "%{with_mucon}" == "yes" |
|
219 %{l_shtool} mkdir -f -p -m 755 \ |
|
220 $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \ |
|
221 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \ |
|
222 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms |
|
223 %{l_shtool} install -c -m 644 \ |
|
224 mu-conference_%{V_mucon}/muc-default.xml \ |
|
225 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml |
|
226 %{l_shtool} install -c \ |
|
227 mu-conference_%{V_mucon}/src/mu-conference \ |
|
228 $RPM_BUILD_ROOT%{l_prefix}/bin/ |
|
229 %{l_shtool} install -c \ |
|
230 mu-conference_%{V_mucon}/style.css \ |
|
231 $RPM_BUILD_ROOT%{l_prefix}/share/jabberd |
|
232 %endif |
|
233 |
|
234 # strip installation |
|
235 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
169 |
236 |
170 # remove unnecessary files |
237 # remove unnecessary files |
171 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist |
238 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist |
172 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist |
239 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist |
173 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a |
240 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a |
174 |
241 |
175 # install run-command script |
242 # install run-command script |
176 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
243 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
244 %if "%{with_mucon}" == "yes" |
|
245 -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \ |
|
246 %endif |
177 %{SOURCE rc.jabberd} \ |
247 %{SOURCE rc.jabberd} \ |
178 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
248 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
179 |
249 |
180 # determine installation files |
250 # determine installation files |
181 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
251 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
182 %{l_files_std} \ |
252 %{l_files_std} \ |
183 '%config %{l_prefix}/etc/jabberd/*' \ |
253 '%config %{l_prefix}/etc/jabberd/*' \ |
|
254 '%config %{l_prefix}/var/jabberd/db/*' \ |
184 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ |
255 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ |
185 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' |
256 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' |
186 |
257 |
187 %files -f files |
258 %files -f files |
188 |
259 |