jabberd/jabberd.spec

changeset 540
6becb64fe77d
parent 363
641cacc76b02
child 541
869d6847b13e
equal deleted inserted replaced
4:e334decbd9ef 5:5ca81af9e2d9
1 ## 1 ##
2 ## jabberd.spec -- OpenPKG RPM Package Specification 2 ## jabberd.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ## 4 ##
5 ## Permission to use, copy, modify, and distribute this software for 5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that 6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all 7 ## the above copyright notice and this permission notice appear in all
8 ## copies. 8 ## copies.
22 ## 22 ##
23 23
24 # package version 24 # package version
25 %define V_major 2.2 25 %define V_major 2.2
26 %define V_minor 14 26 %define V_minor 14
27 %define V_mucon 0.8
28 27
29 # package information 28 # package information
30 Name: jabberd 29 Name: jabberd
31 Summary: Jabber Instant Messaging Daemon 30 Summary: Jabber Instant Messaging Daemon
32 URL: http://jabberd2.xiaoka.com/ 31 URL: http://jabberd2.xiaoka.com/
35 Distribution: OpenPKG Community 34 Distribution: OpenPKG Community
36 Class: PLUS 35 Class: PLUS
37 Group: InstantMessaging 36 Group: InstantMessaging
38 License: JOSL/GPL 37 License: JOSL/GPL
39 Version: %{V_major}.%{V_minor} 38 Version: %{V_major}.%{V_minor}
40 Release: 20110914 39 Release: 20110602
41 40
42 # package options 41 # package options
43 %option with_mucon yes 42 %option with_sqlite no
44 %option with_sqlite yes
45 %option with_mysql no 43 %option with_mysql no
46 %option with_pgsql no 44 %option with_pgsql no
47 %option with_pam no 45 %option with_pam no
48 46
49 # list of sources 47 # list of sources
50 Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz 48 Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz
51 Source1: http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz 49 Source1: rc.jabberd
52 Source2: rc.jabberd
53 Patch0: jabberd.patch 50 Patch0: jabberd.patch
54 51
55 # build information 52 # build information
56 Prefix: %{l_prefix} 53 BuildPreReq: OpenPKG, openpkg >= 20100101, make
57 BuildRoot: %{l_buildroot} 54 PreReq: OpenPKG, openpkg >= 20100101, perl
58 BuildPreReq: OpenPKG, openpkg >= 20060823, make
59 PreReq: OpenPKG, openpkg >= 20060823, perl
60 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns 55 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
61 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns 56 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns
62 %if "%{with_mucon}" == "yes"
63 BuildPreReq: glib2
64 PreReq: glib2
65 %endif
66 %if "%{with_sqlite}" == "yes" 57 %if "%{with_sqlite}" == "yes"
67 BuildPreReq: sqlite 58 BuildPreReq: sqlite
68 PreReq: sqlite 59 PreReq: sqlite
69 %endif 60 %endif
70 %if "%{with_mysql}" == "yes" 61 %if "%{with_mysql}" == "yes"
77 %endif 68 %endif
78 %if "%{with_pam}" == "yes" 69 %if "%{with_pam}" == "yes"
79 BuildPreReq: PAM 70 BuildPreReq: PAM
80 PreReq: PAM 71 PreReq: PAM
81 %endif 72 %endif
82 AutoReq: no
83 AutoReqProv: no
84 73
85 %description 74 %description
86 JabberD is the original server implementation for the Jabber instant 75 JabberD is the original server implementation for the Jabber instant
87 messaging platform. JabberD 2 is the next generation of the JabberD 76 messaging platform. JabberD 2 is the next generation of the JabberD
88 server. It has been rewritten from the ground up to be scalable, 77 server. It has been rewritten from the ground up to be scalable,
93 prog jabberd = { 82 prog jabberd = {
94 version = %{version} 83 version = %{version}
95 url = http://codex.xiaoka.com/pub/jabberd2/releases/ 84 url = http://codex.xiaoka.com/pub/jabberd2/releases/
96 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz 85 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz
97 } 86 }
98 prog jabberd:mucon = {
99 version = %{V_mucon}
100 url = http://download.gna.org/mu-conference/
101 regex = mu-conference_(__VER__)\.tar\.gz
102 }
103 87
104 %prep 88 %prep
105 %setup -q -n jabberd-%{version} 89 %setup -q -n jabberd-%{version}
106 %setup -q -D -T -a 1
107 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b 90 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
108 %{l_shtool} subst \ 91 %{l_shtool} subst \
109 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ 92 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
110 tools/jabberd.in 93 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
132 94
133 %build 95 %build
134 # configure program 96 # configure program
97 ( echo "ac_cv_func_kqueue=no"
98 ) >config.cache
135 export CC="%{l_cc}" 99 export CC="%{l_cc}"
136 export CFLAGS="%{l_cflags -O}" 100 export CFLAGS="%{l_cflags -O}"
137 export CPPFLAGS="%{l_cppflags libidn}" 101 export CPPFLAGS="%{l_cppflags libidn}"
138 export LDFLAGS="%{l_ldflags}" 102 export LDFLAGS="%{l_ldflags}"
139 export LIBS="" 103 export LIBS=""
149 %endif 113 %endif
150 %if "%{with_pgsql}" == "yes" 114 %if "%{with_pgsql}" == "yes"
151 CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}" 115 CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
152 %endif 116 %endif
153 ./configure \ 117 ./configure \
118 --cache-file=./config.cache \
154 --prefix=%{l_prefix} \ 119 --prefix=%{l_prefix} \
155 --sysconfdir=%{l_prefix}/etc/jabberd \ 120 --sysconfdir=%{l_prefix}/etc/jabberd \
156 --mandir=%{l_prefix}/man \ 121 --mandir=%{l_prefix}/man \
157 --enable-db \ 122 --enable-db \
158 --enable-fs \ 123 --enable-fs \
159 --enable-pipe \ 124 --enable-pipe \
160 --enable-ssl \ 125 --enable-ssl \
161 --enable-debug \
162 --with-sasl=gsasl \ 126 --with-sasl=gsasl \
163 %if "%{with_sqlite}" == "yes" 127 %if "%{with_sqlite}" == "yes"
164 --enable-sqlite \ 128 --enable-sqlite \
165 %else 129 %else
166 --disable-sqlite \ 130 --disable-sqlite \
183 --disable-oracle \ 147 --disable-oracle \
184 --enable-static \ 148 --enable-static \
185 --enable-shared 149 --enable-shared
186 150
187 # build program 151 # build program
188 %{l_make} %{l_mflags -O} 152 %{l_make} %{l_mflags}
189
190 %if "%{with_mucon}" == "yes"
191 loclibs=''
192 case "%{l_platform -t}" in
193 *-sunos* )
194 loclibs='-lsocket -lnsl'
195 ;;
196 esac
197 ( cd mu-conference_%{V_mucon}
198 %{l_make} %{l_mflags -O} LOCLIBS=$loclibs
199 ) || exit $?
200 %endif
201 153
202 %install 154 %install
203 # create installation filesystem structure 155 # create installation filesystem structure
204 rm -rf $RPM_BUILD_ROOT
205 %{l_shtool} mkdir -f -p -m 755 \ 156 %{l_shtool} mkdir -f -p -m 755 \
206 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ 157 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
207 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \ 158 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
208 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \ 159 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
209 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \ 160 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
210 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \ 161 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
211 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ 162 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
212 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log 163 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
213 164
214 # install required components 165 # install components
215 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 166 %{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
236 167
237 # remove unnecessary files 168 # remove unnecessary files
238 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist 169 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
239 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist 170 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
240 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a 171 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
241 172
242 # install run-command script 173 # install run-command script
243 %{l_shtool} install -c -m 755 %{l_value -s -a} \ 174 %{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
247 %{SOURCE rc.jabberd} \ 175 %{SOURCE rc.jabberd} \
248 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 176 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
249 177
250 # determine installation files 178 # determine installation files
251 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 179 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
255 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' 183 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*'
256 184
257 %files -f files 185 %files -f files
258 186
259 %clean 187 %clean
260 rm -rf $RPM_BUILD_ROOT
261 188
262 %post 189 %post
263 # after upgrade, restart service 190 # after upgrade, restart service
264 [ $1 -eq 2 ] || exit 0 191 [ $1 -eq 2 ] || exit 0
265 eval `%{l_rc} jabberd status 2>/dev/null` 192 eval `%{l_rc} jabberd status 2>/dev/null`

mercurial