jabberd/jabberd.spec

Thu, 04 Oct 2012 20:30:05 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 04 Oct 2012 20:30:05 +0200
changeset 715
c10fb90893b9
parent 693
165d980aa5f1
child 768
70baf26f1088
permissions
-rw-r--r--

Correct out of date build configuration, porting to Solaris 11 network
link infrastructure and new libpcap logic. This additionally allows for
device drivers in subdirectories of /dev. Correct packaged nmap
personalities and signatures to work out of the box. Finally, hack
arpd logic to properly close sockets and quit on TERM by repeating
signaling in the run command script. Sadly, all this fails to correct
the run time behaviour of honeyd which fails to bind to the IP layer.

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@693 43 %option with_sqlite yes
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@693 103 %{l_sed} <%{PATCH0} -e 's;@l_prefix@;%{l_prefix};g' | %{l_patch} -p0 -b
michael@224 104 %{l_shtool} subst \
michael@224 105 -e 's;exec perl;exec %{l_prefix}/bin/perl;' \
michael@224 106 tools/jabberd.in
michael@541 107 %{l_shtool} subst \
michael@541 108 -e 's;\$(initdir);;g' \
michael@541 109 etc/Makefile.in
michael@541 110 %if "%{with_mucon}" == "yes"
michael@541 111 %{l_shtool} subst \
michael@541 112 -e 's;^\(CFLAGS\ *:=.*pkg-config --cflags glib-2.0\);\1 libidn;' \
michael@541 113 -e 's;^\(LIBS\ *:=.*\);\1 $(LOCLIBS);' \
michael@541 114 mu-conference_%{V_mucon}/src/Makefile
michael@541 115 %{l_shtool} subst \
michael@541 116 -e 's;mu-conference.log;muc.log;g' \
michael@541 117 mu-conference_%{V_mucon}/src/jcomp/jcr_log.c
michael@541 118 %{l_shtool} subst \
michael@541 119 -e 's;<port>[0-9][0-9]*</port>;<port>5347</port>;' \
michael@541 120 -e 's;<spool>.*</spool>;<spool>%{l_prefix}/var/jabberd/spool/rooms</spool>;' \
michael@541 121 -e 's;<logdir>\./syslogs</logdir>;<logdir>%{l_prefix}/var/jabberd/log</logdir>;' \
michael@541 122 -e 's;<logdir>\./logs/</logdir>;<logdir>%{l_prefix}/var/jabberd/spool/logs</logdir>;' \
michael@541 123 -e 's;<pidfile>.*</pidfile>;<pidfile>%{l_prefix}/var/jabberd/pid/muc.pid</pidfile>;' \
michael@541 124 -e 's;<URL>.*</URL>;<URL>http://name.host.tld/</URL>;' \
michael@541 125 -e 's;<stylesheet>.*</stylesheet>;<stylesheet>%{l_prefix}/share/jabberd/style.css</stylesheet>;' \
michael@541 126 mu-conference_%{V_mucon}/muc-default.xml
michael@541 127 echo \
michael@541 128 'muc @sysconfdir@/muc.xml' \
michael@541 129 >>etc/jabberd.cfg.dist.in
michael@541 130 %endif
michael@224 131
michael@224 132 %build
michael@224 133 # configure program
michael@540 134 ( echo "ac_cv_func_kqueue=no"
michael@540 135 ) >config.cache
michael@224 136 export CC="%{l_cc}"
michael@224 137 export CFLAGS="%{l_cflags -O}"
michael@224 138 export CPPFLAGS="%{l_cppflags libidn}"
michael@224 139 export LDFLAGS="%{l_ldflags}"
michael@224 140 export LIBS=""
michael@224 141 case "%{l_platform -t}" in
michael@224 142 *-linux* ) LIBS="$LIBS -ldl" ;;
michael@224 143 *-sunos* ) LIBS="$LIBS -lsocket -lnsl -lrt" ;;
michael@224 144 esac
michael@224 145 export JHOME=%{l_prefix}/var/jabberd
michael@224 146 %if "%{with_mysql}" == "yes"
michael@224 147 CPPFLAGS="$CPPFLAGS %{l_cppflags mysql}"
michael@224 148 LDFLAGS="$LDFLAGS %{l_ldflags mysql}"
michael@224 149 LIBS="$LIBS -lz -lm"
michael@224 150 %endif
michael@224 151 %if "%{with_pgsql}" == "yes"
michael@224 152 CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}"
michael@224 153 %endif
michael@224 154 ./configure \
michael@540 155 --cache-file=./config.cache \
michael@224 156 --prefix=%{l_prefix} \
michael@224 157 --sysconfdir=%{l_prefix}/etc/jabberd \
michael@224 158 --mandir=%{l_prefix}/man \
michael@224 159 --enable-db \
michael@224 160 --enable-fs \
michael@224 161 --enable-pipe \
michael@224 162 --enable-ssl \
michael@224 163 --with-sasl=gsasl \
michael@224 164 %if "%{with_sqlite}" == "yes"
michael@224 165 --enable-sqlite \
michael@224 166 %else
michael@224 167 --disable-sqlite \
michael@224 168 %endif
michael@224 169 %if "%{with_mysql}" == "yes"
michael@224 170 --enable-mysql \
michael@224 171 %else
michael@224 172 --disable-mysql \
michael@224 173 %endif
michael@224 174 %if "%{with_pgsql}" == "yes"
michael@224 175 --enable-pgsql \
michael@224 176 %else
michael@224 177 --disable-pgsql \
michael@224 178 %endif
michael@224 179 %if "%{with_pam}" == "yes"
michael@224 180 --enable-pam \
michael@224 181 %else
michael@224 182 --disable-pam \
michael@224 183 %endif
michael@224 184 --disable-oracle \
michael@224 185 --enable-static \
michael@224 186 --enable-shared
michael@224 187
michael@224 188 # build program
michael@541 189 %{l_make} %{l_mflags -O}
michael@541 190
michael@541 191 %if "%{with_mucon}" == "yes"
michael@704 192 #http://www.suramya.com/linux/tutorials/JabberSetup/
michael@541 193 loclibs=''
michael@541 194 case "%{l_platform -t}" in
michael@541 195 *-sunos* )
michael@541 196 loclibs='-lsocket -lnsl'
michael@541 197 ;;
michael@541 198 esac
michael@541 199 ( cd mu-conference_%{V_mucon}
michael@541 200 %{l_make} %{l_mflags -O} LOCLIBS=$loclibs
michael@541 201 ) || exit $?
michael@541 202 %endif
michael@224 203
michael@224 204 %install
michael@224 205 # create installation filesystem structure
michael@224 206 %{l_shtool} mkdir -f -p -m 755 \
michael@224 207 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
michael@224 208 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd \
michael@224 209 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates \
michael@224 210 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd \
michael@224 211 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/db \
michael@224 212 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/pid \
michael@224 213 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/log
michael@224 214
michael@540 215 # install components
michael@224 216 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@224 217
michael@541 218 # install optional components
michael@541 219 %if "%{with_mucon}" == "yes"
michael@541 220 %{l_shtool} mkdir -f -p -m 755 \
michael@541 221 $RPM_BUILD_ROOT%{l_prefix}/share/jabberd \
michael@541 222 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/logs \
michael@541 223 $RPM_BUILD_ROOT%{l_prefix}/var/jabberd/spool/rooms
michael@541 224 %{l_shtool} install -c -m 644 \
michael@541 225 mu-conference_%{V_mucon}/muc-default.xml \
michael@541 226 $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/muc.xml
michael@541 227 %{l_shtool} install -c \
michael@541 228 mu-conference_%{V_mucon}/src/mu-conference \
michael@541 229 $RPM_BUILD_ROOT%{l_prefix}/bin/
michael@541 230 %{l_shtool} install -c \
michael@541 231 mu-conference_%{V_mucon}/style.css \
michael@541 232 $RPM_BUILD_ROOT%{l_prefix}/share/jabberd
michael@541 233 %endif
michael@541 234
michael@541 235 # strip installation
michael@541 236 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@541 237
michael@224 238 # remove unnecessary files
michael@224 239 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/*.dist
michael@224 240 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/jabberd/templates/*.dist
michael@224 241 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/jabberd/*.a
michael@224 242
michael@541 243 # install runcommand script
michael@224 244 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@541 245 %if "%{with_mucon}" == "yes"
michael@541 246 -e 's;\(jabberd_daemons\s*=.*\)\s\s*\(\w\w*\);\1 mucon\2;' \
michael@541 247 %endif
michael@224 248 %{SOURCE rc.jabberd} \
michael@224 249 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@224 250
michael@224 251 # determine installation files
michael@224 252 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@224 253 %{l_files_std} \
michael@704 254 '%config %attr(0640,%{l_mgrp},%{l_ngrp}) %{l_prefix}/etc/jabberd/*' \
michael@224 255 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd' \
michael@704 256 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*' \
michael@704 257 '%dir %attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/jabberd/*/*'
michael@224 258
michael@224 259 %files -f files
michael@224 260
michael@224 261 %clean
michael@224 262
michael@224 263 %post
michael@224 264 # after upgrade, restart service
michael@224 265 [ $1 -eq 2 ] || exit 0
michael@224 266 eval `%{l_rc} jabberd status 2>/dev/null`
michael@224 267 [ ".$jabberd_active" = .yes ] && %{l_rc} jabberd restart
michael@224 268 exit 0
michael@224 269
michael@224 270 %preun
michael@224 271 # before erase, stop service and remove log files
michael@224 272 [ $1 -eq 0 ] || exit 0
michael@224 273 %{l_rc} jabberd stop 2>/dev/null
michael@224 274 rm -f $RPM_INSTALL_PREFIX/var/jabberd/*.log* >/dev/null 2>&1 || true
michael@224 275 exit 0
michael@224 276

mercurial