|
1 ## |
|
2 ## jabberd.spec -- OpenPKG RPM Package Specification |
|
3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> |
|
4 ## |
|
5 ## Permission to use, copy, modify, and distribute this software for |
|
6 ## any purpose with or without fee is hereby granted, provided that |
|
7 ## the above copyright notice and this permission notice appear in all |
|
8 ## copies. |
|
9 ## |
|
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
|
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
|
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
|
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
|
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
21 ## SUCH DAMAGE. |
|
22 ## |
|
23 |
|
24 # package version |
|
25 %define V_major 2.2 |
|
26 %define V_minor 9 |
|
27 |
|
28 # package information |
|
29 Name: jabberd |
|
30 Summary: Jabber Instant Messaging Daemon |
|
31 URL: http://jabberd2.xiaoka.com/ |
|
32 Vendor: Jabber Software Foundation |
|
33 Packager: OpenPKG Foundation e.V. |
|
34 Distribution: OpenPKG Community |
|
35 Class: PLUS |
|
36 Group: InstantMessaging |
|
37 License: JOSL/GPL |
|
38 Version: %{V_major}.%{V_minor} |
|
39 Release: 20090707 |
|
40 |
|
41 # package options |
|
42 %option with_sqlite no |
|
43 %option with_mysql no |
|
44 %option with_pgsql no |
|
45 %option with_pam no |
|
46 |
|
47 # list of sources |
|
48 Source0: http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-%{version}.tar.gz |
|
49 Source1: rc.jabberd |
|
50 Patch0: jabberd.patch |
|
51 |
|
52 # build information |
|
53 Prefix: %{l_prefix} |
|
54 BuildRoot: %{l_buildroot} |
|
55 BuildPreReq: OpenPKG, openpkg >= 20060823, make |
|
56 PreReq: OpenPKG, openpkg >= 20060823, perl |
|
57 BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
|
58 PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
|
59 %if "%{with_sqlite}" == "yes" |
|
60 BuildPreReq: sqlite |
|
61 PreReq: sqlite |
|
62 %endif |
|
63 %if "%{with_mysql}" == "yes" |
|
64 BuildPreReq: mysql |
|
65 PreReq: mysql |
|
66 %endif |
|
67 %if "%{with_pgsql}" == "yes" |
|
68 BuildPreReq: postgresql |
|
69 PreReq: postgresql |
|
70 %endif |
|
71 %if "%{with_pam}" == "yes" |
|
72 BuildPreReq: PAM |
|
73 PreReq: PAM |
|
74 %endif |
|
75 AutoReq: no |
|
76 AutoReqProv: no |
|
77 |
|
78 %description |
|
79 JabberD is the original server implementation for the Jabber instant |
|
80 messaging platform. JabberD 2 is the next generation of the JabberD |
|
81 server. It has been rewritten from the ground up to be scalable, |
|
82 architecturally sound, and to support the latest protocol extensions |
|
83 coming out of the JSF. |
|
84 |
|
85 %track |
|
86 prog jabberd = { |
|
87 version = %{version} |
|
88 url = http://codex.xiaoka.com/pub/jabberd2/releases/ |
|
89 regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.gz |
|
90 } |
|
91 |
|
92 %prep |
|
93 %setup -q -n jabberd-%{version} |
|
94 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b |
|
95 %{l_shtool} subst \ |
|
96 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ |
|
97 tools/jabberd.in |
|
98 |
|
99 %build |
|
100 # configure program |
|
101 export CC="%{l_cc}" |
|
102 export CFLAGS="%{l_cflags -O}" |
|
103 export CPPFLAGS="%{l_cppflags libidn}" |
|
104 export LDFLAGS="%{l_ldflags}" |
|
105 export LIBS="" |
|
106 case "%{l_platform -t}" in |
|
107 *-linux* ) LIBS="$LIBS -ldl" ;; |
|
108 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;; |
|
109 esac |
|
110 export JHOME=%{l_prefix}/var/jabberd |
|
111 %if "%{with_mysql}" == "yes" |
|
112 CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}" |
|
113 LDFLAGS="$LDFLAGS %{l_ldflags mysql}" |
|
114 LIBS="$LIBS -lz -lm" |
|
115 %endif |
|
116 %if "%{with_pgsql}" == "yes" |
|
117 CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}" |
|
118 %endif |
|
119 ./configure \ |
|
120 --prefix=%{l_prefix} \ |
|
121 --sysconfdir=%{l_prefix}/etc/jabberd \ |
|
122 --mandir=%{l_prefix}/man \ |
|
123 --enable-db \ |
|
124 --enable-fs \ |
|
125 --enable-pipe \ |
|
126 --enable-ssl \ |
|
127 --with-sasl=gsasl \ |
|
128 %if "%{with_sqlite}" == "yes" |
|
129 --enable-sqlite \ |
|
130 %else |
|
131 --disable-sqlite \ |
|
132 %endif |
|
133 %if "%{with_mysql}" == "yes" |
|
134 --enable-mysql \ |
|
135 %else |
|
136 --disable-mysql \ |
|
137 %endif |
|
138 %if "%{with_pgsql}" == "yes" |
|
139 --enable-pgsql \ |
|
140 %else |
|
141 --disable-pgsql \ |
|
142 %endif |
|
143 %if "%{with_pam}" == "yes" |
|
144 --enable-pam \ |
|
145 %else |
|
146 --disable-pam \ |
|
147 %endif |
|
148 --disable-oracle \ |
|
149 --enable-static \ |
|
150 --enable-shared |
|
151 |
|
152 # build program |
|
153 %{l_make} %{l_mflags} |
|
154 |
|
155 %install |
|
156 # create installation filesystem structure |
|
157 rm -rf $RPM_BUILD_ROOT |
|
158 %{l_shtool} mkdir -f -p -m 755 \ |
|
159 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
|
160 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \ |
|
161 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \ |
|
162 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \ |
|
163 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \ |
|
164 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ |
|
165 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log |
|
166 |
|
167 # install components |
|
168 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
|
169 |
|
170 # remove unnecessary files |
|
171 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist |
|
172 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist |
|
173 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a |
|
174 |
|
175 # install run-command script |
|
176 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
177 %{SOURCE rc.jabberd} \ |
|
178 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
179 |
|
180 # determine installation files |
|
181 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
|
182 %{l_files_std} \ |
|
183 '%config %{l_prefix}/etc/jabberd/*' \ |
|
184 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ |
|
185 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' |
|
186 |
|
187 %files -f files |
|
188 |
|
189 %clean |
|
190 rm -rf $RPM_BUILD_ROOT |
|
191 |
|
192 %post |
|
193 # after upgrade, restart service |
|
194 [ $1 -eq 2 ] || exit 0 |
|
195 eval `%{l_rc} jabberd status 2>/dev/null` |
|
196 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart |
|
197 exit 0 |
|
198 |
|
199 %preun |
|
200 # before erase, stop service and remove log files |
|
201 [ $1 -eq 0 ] || exit 0 |
|
202 %{l_rc} jabberd stop 2>/dev/null |
|
203 rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true |
|
204 exit 0 |
|
205 |