Mon, 17 Sep 2012 19:10:10 +0200
Update to new version of vendor software although Oracle fails to deliver.
More specifically, newer db(3) patch revisions exist but Oracle has
removed them from the canonical download server URI for Berkely DB.
michael@224 | 1 | ## |
michael@224 | 2 | ## jabberd.spec -- OpenPKG RPM Package Specification |
michael@540 | 3 | ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@224 | 4 | ## |
michael@224 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@224 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@224 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@224 | 8 | ## copies. |
michael@224 | 9 | ## |
michael@224 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@224 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@224 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@224 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@224 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@224 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@224 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@224 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@224 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@224 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@224 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@224 | 21 | ## SUCH DAMAGE. |
michael@224 | 22 | ## |
michael@224 | 23 | |
michael@224 | 24 | # package version |
michael@224 | 25 | %define V_major 2.2 |
michael@541 | 26 | %define V_minor 17 |
michael@541 | 27 | %define V_mucon 0.8 |
michael@224 | 28 | |
michael@224 | 29 | # package information |
michael@224 | 30 | Name: jabberd |
michael@224 | 31 | Summary: Jabber Instant Messaging Daemon |
michael@224 | 32 | URL: http://jabberd2.xiaoka.com/ |
michael@224 | 33 | Vendor: Jabber Software Foundation |
michael@224 | 34 | Packager: OpenPKG Foundation e.V. |
michael@224 | 35 | Distribution: OpenPKG Community |
michael@224 | 36 | Class: PLUS |
michael@224 | 37 | Group: InstantMessaging |
michael@224 | 38 | License: JOSL/GPL |
michael@224 | 39 | Version: %{V_major}.%{V_minor} |
michael@541 | 40 | Release: 20120800 |
michael@224 | 41 | |
michael@224 | 42 | # package options |
michael@540 | 43 | %option with_sqlite no |
michael@224 | 44 | %option with_mysql no |
michael@224 | 45 | %option with_pgsql no |
michael@224 | 46 | %option with_pam no |
michael@541 | 47 | %option with_mucon yes |
michael@224 | 48 | |
michael@224 | 49 | # list of sources |
michael@541 | 50 | Source0: http://www.github.com/downloads/Jabberd2/jabberd2/jabberd-%{version}.tar.xz |
michael@541 | 51 | Source1: http://download.gna.org/mu-conference/mu-conference_%{V_mucon}.tar.gz |
michael@540 | 52 | Source1: rc.jabberd |
michael@224 | 53 | Patch0: jabberd.patch |
michael@224 | 54 | |
michael@224 | 55 | # build information |
michael@540 | 56 | BuildPreReq: OpenPKG, openpkg >= 20100101, make |
michael@540 | 57 | PreReq: OpenPKG, openpkg >= 20100101, perl |
michael@224 | 58 | BuildPreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
michael@224 | 59 | PreReq: db, expat, libiconv, libidn, gpg-error, gcrypt, libgsasl, openssl, udns |
michael@224 | 60 | %if "%{with_sqlite}" == "yes" |
michael@224 | 61 | BuildPreReq: sqlite |
michael@224 | 62 | PreReq: sqlite |
michael@224 | 63 | %endif |
michael@224 | 64 | %if "%{with_mysql}" == "yes" |
michael@224 | 65 | BuildPreReq: mysql |
michael@224 | 66 | PreReq: mysql |
michael@224 | 67 | %endif |
michael@224 | 68 | %if "%{with_pgsql}" == "yes" |
michael@224 | 69 | BuildPreReq: postgresql |
michael@224 | 70 | PreReq: postgresql |
michael@224 | 71 | %endif |
michael@224 | 72 | %if "%{with_pam}" == "yes" |
michael@224 | 73 | BuildPreReq: PAM |
michael@224 | 74 | PreReq: PAM |
michael@224 | 75 | %endif |
michael@541 | 76 | %if "%{with_mucon}" == "yes" |
michael@541 | 77 | BuildPreReq: glib, pkgconfig |
michael@541 | 78 | PreReq: glib |
michael@541 | 79 | %endif |
michael@224 | 80 | |
michael@224 | 81 | %description |
michael@224 | 82 | JabberD is the original server implementation for the Jabber instant |
michael@224 | 83 | messaging platform. JabberD 2 is the next generation of the JabberD |
michael@224 | 84 | server. It has been rewritten from the ground up to be scalable, |
michael@224 | 85 | architecturally sound, and to support the latest protocol extensions |
michael@224 | 86 | coming out of the JSF. |
michael@224 | 87 | |
michael@224 | 88 | %track |
michael@224 | 89 | prog jabberd = { |
michael@224 | 90 | version = %{version} |
michael@541 | 91 | url = http://www.github.com/downloads/Jabberd2/jabberd2/ |
michael@541 | 92 | regex = jabberd-(\d+\.\d+(\.\d+)*)\.tar\.xz |
michael@541 | 93 | } |
michael@541 | 94 | prog jabberd:mucon = { |
michael@541 | 95 | version = %{V_mucon} |
michael@541 | 96 | url = http://download.gna.org/mu-conference/ |
michael@541 | 97 | regex = mu-conference_(__VER__)\.tar\.gz |
michael@224 | 98 | } |
michael@224 | 99 | |
michael@224 | 100 | %prep |
michael@224 | 101 | %setup -q -n jabberd-%{version} |
michael@541 | 102 | %setup -q -D -T -a 1 |
michael@224 | 103 | %{l_shtool} subst \ |
michael@224 | 104 | -e 's;exec perl;exec %{l_prefix}/bin/perl;' \ |
michael@224 | 105 | tools/jabberd.in |
michael@541 | 106 | %{l_shtool} subst \ |
michael@541 | 107 | -e 's;\$(initdir);;g' \ |
michael@541 | 108 | etc/Makefile.in |
michael@541 | 109 | %if "%{with_mucon}" == "yes" |
michael@541 | 110 | %{l_shtool} subst \ |
michael@541 | 111 | -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \ |
michael@541 | 112 | -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \ |
michael@541 | 113 | mu-conference_%{V_mucon}/src/Makefile |
michael@541 | 114 | %{l_shtool} subst \ |
michael@541 | 115 | -e 's;mu-conference.log;muc.log;g' \ |
michael@541 | 116 | mu-conference_%{V_mucon}/src/jcomp/jcr_log.c |
michael@541 | 117 | %{l_shtool} subst \ |
michael@541 | 118 | -e 's;<port>[0-9][0-9]*</port>;<port>5347</port>;' \ |
michael@541 | 119 | -e 's;<spool>.*</spool>;<spool>%{l_prefix}/var/jabberd/spool/rooms</spool>;' \ |
michael@541 | 120 | -e 's;<logdir>\./syslogs</logdir>;<logdir>%{l_prefix}/var/jabberd/log</logdir>;' \ |
michael@541 | 121 | -e 's;<logdir>\./logs/</logdir>;<logdir>%{l_prefix}/var/jabberd/spool/logs</logdir>;' \ |
michael@541 | 122 | -e 's;<pidfile>.*</pidfile>;<pidfile>%{l_prefix}/var/jabberd/pid/muc.pid</pidfile>;' \ |
michael@541 | 123 | -e 's;<URL>.*</URL>;<URL>http://name.host.tld/</URL>;' \ |
michael@541 | 124 | -e 's;<stylesheet>.*</stylesheet>;<stylesheet>%{l_prefix}/share/jabberd/style.css</stylesheet>;' \ |
michael@541 | 125 | mu-conference_%{V_mucon}/muc-default.xml |
michael@541 | 126 | echo \ |
michael@541 | 127 | 'muc @sysconfdir@/muc.xml' \ |
michael@541 | 128 | >>etc/jabberd.cfg.dist.in |
michael@541 | 129 | %endif |
michael@224 | 130 | |
michael@224 | 131 | %build |
michael@224 | 132 | # configure program |
michael@540 | 133 | ( echo "ac_cv_func_kqueue=no" |
michael@540 | 134 | ) >config.cache |
michael@224 | 135 | export CC="%{l_cc}" |
michael@224 | 136 | export CFLAGS="%{l_cflags -O}" |
michael@224 | 137 | export CPPFLAGS="%{l_cppflags libidn}" |
michael@224 | 138 | export LDFLAGS="%{l_ldflags}" |
michael@224 | 139 | export LIBS="" |
michael@224 | 140 | case "%{l_platform -t}" in |
michael@224 | 141 | *-linux* ) LIBS="$LIBS -ldl" ;; |
michael@224 | 142 | *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;; |
michael@224 | 143 | esac |
michael@224 | 144 | export JHOME=%{l_prefix}/var/jabberd |
michael@224 | 145 | %if "%{with_mysql}" == "yes" |
michael@224 | 146 | CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}" |
michael@224 | 147 | LDFLAGS="$LDFLAGS %{l_ldflags mysql}" |
michael@224 | 148 | LIBS="$LIBS -lz -lm" |
michael@224 | 149 | %endif |
michael@224 | 150 | %if "%{with_pgsql}" == "yes" |
michael@224 | 151 | CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}" |
michael@224 | 152 | %endif |
michael@224 | 153 | ./configure \ |
michael@540 | 154 | --cache-file=./config.cache \ |
michael@224 | 155 | --prefix=%{l_prefix} \ |
michael@224 | 156 | --sysconfdir=%{l_prefix}/etc/jabberd \ |
michael@224 | 157 | --mandir=%{l_prefix}/man \ |
michael@224 | 158 | --enable-db \ |
michael@224 | 159 | --enable-fs \ |
michael@224 | 160 | --enable-pipe \ |
michael@224 | 161 | --enable-ssl \ |
michael@224 | 162 | --with-sasl=gsasl \ |
michael@224 | 163 | %if "%{with_sqlite}" == "yes" |
michael@224 | 164 | --enable-sqlite \ |
michael@224 | 165 | %else |
michael@224 | 166 | --disable-sqlite \ |
michael@224 | 167 | %endif |
michael@224 | 168 | %if "%{with_mysql}" == "yes" |
michael@224 | 169 | --enable-mysql \ |
michael@224 | 170 | %else |
michael@224 | 171 | --disable-mysql \ |
michael@224 | 172 | %endif |
michael@224 | 173 | %if "%{with_pgsql}" == "yes" |
michael@224 | 174 | --enable-pgsql \ |
michael@224 | 175 | %else |
michael@224 | 176 | --disable-pgsql \ |
michael@224 | 177 | %endif |
michael@224 | 178 | %if "%{with_pam}" == "yes" |
michael@224 | 179 | --enable-pam \ |
michael@224 | 180 | %else |
michael@224 | 181 | --disable-pam \ |
michael@224 | 182 | %endif |
michael@224 | 183 | --disable-oracle \ |
michael@224 | 184 | --enable-static \ |
michael@224 | 185 | --enable-shared |
michael@224 | 186 | |
michael@224 | 187 | # build program |
michael@541 | 188 | %{l_make} %{l_mflags -O} |
michael@541 | 189 | |
michael@541 | 190 | %if "%{with_mucon}" == "yes" |
michael@541 | 191 | loclibs='' |
michael@541 | 192 | case "%{l_platform -t}" in |
michael@541 | 193 | *-sunos* ) |
michael@541 | 194 | loclibs='-lsocket -lnsl' |
michael@541 | 195 | ;; |
michael@541 | 196 | esac |
michael@541 | 197 | ( cd mu-conference_%{V_mucon} |
michael@541 | 198 | %{l_make} %{l_mflags -O} LOCLIBS=$loclibs |
michael@541 | 199 | ) || exit $? |
michael@541 | 200 | %endif |
michael@224 | 201 | |
michael@224 | 202 | %install |
michael@224 | 203 | # create installation filesystem structure |
michael@224 | 204 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@224 | 205 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
michael@224 | 206 | $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \ |
michael@224 | 207 | $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \ |
michael@224 | 208 | $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \ |
michael@224 | 209 | $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \ |
michael@224 | 210 | $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \ |
michael@224 | 211 | $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log |
michael@224 | 212 | |
michael@540 | 213 | # install components |
michael@224 | 214 | %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
michael@224 | 215 | |
michael@541 | 216 | # install optional components |
michael@541 | 217 | %if "%{with_mucon}" == "yes" |
michael@541 | 218 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@541 | 219 | $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \ |
michael@541 | 220 | $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \ |
michael@541 | 221 | $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms |
michael@541 | 222 | %{l_shtool} install -c -m 644 \ |
michael@541 | 223 | mu-conference_%{V_mucon}/muc-default.xml \ |
michael@541 | 224 | $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml |
michael@541 | 225 | %{l_shtool} install -c \ |
michael@541 | 226 | mu-conference_%{V_mucon}/src/mu-conference \ |
michael@541 | 227 | $RPM_BUILD_ROOT%{l_prefix}/bin/ |
michael@541 | 228 | %{l_shtool} install -c \ |
michael@541 | 229 | mu-conference_%{V_mucon}/style.css \ |
michael@541 | 230 | $RPM_BUILD_ROOT%{l_prefix}/share/jabberd |
michael@541 | 231 | %endif |
michael@541 | 232 | |
michael@541 | 233 | # strip installation |
michael@541 | 234 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
michael@541 | 235 | |
michael@224 | 236 | # remove unnecessary files |
michael@224 | 237 | rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist |
michael@224 | 238 | rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist |
michael@224 | 239 | rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a |
michael@224 | 240 | |
michael@541 | 241 | # install runcommand script |
michael@224 | 242 | %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
michael@541 | 243 | %if "%{with_mucon}" == "yes" |
michael@541 | 244 | -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \ |
michael@541 | 245 | %endif |
michael@224 | 246 | %{SOURCE rc.jabberd} \ |
michael@224 | 247 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@224 | 248 | |
michael@224 | 249 | # determine installation files |
michael@224 | 250 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@224 | 251 | %{l_files_std} \ |
michael@224 | 252 | '%config %{l_prefix}/etc/jabberd/*' \ |
michael@224 | 253 | '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \ |
michael@224 | 254 | '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' |
michael@224 | 255 | |
michael@224 | 256 | %files -f files |
michael@224 | 257 | |
michael@224 | 258 | %clean |
michael@224 | 259 | |
michael@224 | 260 | %post |
michael@224 | 261 | # after upgrade, restart service |
michael@224 | 262 | [ $1 -eq 2 ] || exit 0 |
michael@224 | 263 | eval `%{l_rc} jabberd status 2>/dev/null` |
michael@224 | 264 | [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart |
michael@224 | 265 | exit 0 |
michael@224 | 266 | |
michael@224 | 267 | %preun |
michael@224 | 268 | # before erase, stop service and remove log files |
michael@224 | 269 | [ $1 -eq 0 ] || exit 0 |
michael@224 | 270 | %{l_rc} jabberd stop 2>/dev/null |
michael@224 | 271 | rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true |
michael@224 | 272 | exit 0 |
michael@224 | 273 |