dbus/dbus.spec

Thu, 08 Jan 2009 18:28:40 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 08 Jan 2009 18:28:40 +0100
changeset 45
d2954f86e9e6
child 76
11e79e472059
permissions
-rw-r--r--

Depend on sed, grep, and binutils, because libtool hard codes values.
This unfortunate dependency change is necessary because the main
program script calls helper tools from hard coded paths. Please
see /pfx/bin/libtool:77 for the example SED="/pfx/bin/sed".

michael@12 1 ##
michael@12 2 ## dbus.spec -- OpenPKG RPM Package Specification
michael@12 3 ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@12 4 ##
michael@12 5 ## Permission to use, copy, modify, and distribute this software for
michael@12 6 ## any purpose with or without fee is hereby granted, provided that
michael@12 7 ## the above copyright notice and this permission notice appear in all
michael@12 8 ## copies.
michael@12 9 ##
michael@12 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@12 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@12 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@12 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@12 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@12 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@12 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@12 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@12 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@12 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@12 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@12 21 ## SUCH DAMAGE.
michael@12 22 ##
michael@12 23
michael@12 24 # package information
michael@12 25 Name: dbus
michael@12 26 Summary: Message Bus System
michael@12 27 URL: http://www.freedesktop.org/Software/dbus
michael@12 28 Vendor: Freedesktop Project
michael@12 29 Packager: OpenPKG Foundation e.V.
michael@12 30 Distribution: OpenPKG Community
michael@12 31 Class: EVAL
michael@12 32 Group: RPC
michael@12 33 License: AFL/GPL
michael@12 34 Version: 1.1.1
michael@12 35 Release: 20081126
michael@12 36
michael@12 37 # list of sources
michael@12 38 Source0: http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz
michael@12 39 Source1: rc.dbus
michael@12 40 Patch0: dbus.patch
michael@12 41
michael@12 42 # build information
michael@12 43 Prefix: %{l_prefix}
michael@12 44 BuildRoot: %{l_buildroot}
michael@12 45 BuildPreReq: OpenPKG, openpkg >= 20040130, pkgconfig, gcc
michael@12 46 PreReq: OpenPKG, openpkg >= 20040130
michael@12 47 BuildPreReq: libxml
michael@12 48 PreReq: libxml
michael@12 49 AutoReq: no
michael@12 50 AutoReqProv: no
michael@12 51
michael@12 52 %description
michael@12 53 D-BUS is a message bus system, a simple way for applications to
michael@12 54 talk to one another. D-BUS supplies both a system daemon and a per
michael@12 55 user login session daemon. Also, the message bus is built on top of
michael@12 56 a general one to one message passing framework, which can be used
michael@12 57 by any two apps to communicate directly (without going through the
michael@12 58 message bus daemon).
michael@12 59
michael@12 60 %track
michael@12 61 prog dbus = {
michael@12 62 version = %{version}
michael@12 63 url = http://dbus.freedesktop.org/releases/dbus/
michael@12 64 regex = dbus-(__VER__)\.tar\.gz
michael@12 65 }
michael@12 66
michael@12 67 %prep
michael@12 68 %setup -q
michael@12 69 %patch -p0
michael@12 70
michael@12 71 # adjust filesystem layout
michael@12 72 %{l_shtool} subst \
michael@12 73 -e 's;^\(cat[^|]*|\).*;\1 sed -e "s/\\(<listen>unix:tmpdir=\\)\[^<\]\*/\\1\\/tmp/" | \\;' \
michael@12 74 -e 's;#! /bin/bash;#!%{l_bash};' \
michael@12 75 tools/run-with-tmp-session-bus.sh
michael@12 76 %{l_shtool} subst \
michael@12 77 -e 's;/dbus-1\.0;;g' \
michael@12 78 -e 's;dbus-1;dbus;g' \
michael@12 79 -e 's;\(-I\${libdir}\).*;\1/dbus/include;g' \
michael@12 80 dbus-1.pc.in
michael@12 81 %{l_shtool} subst \
michael@12 82 -e 's;-1\.la;.la;g' \
michael@12 83 test/name-test/Makefile.in dbus/Makefile.in tools/Makefile.in
michael@12 84 %{l_shtool} subst \
michael@12 85 -e 's;/dbus-1\.0;;g' \
michael@12 86 -e 's;/dbus-1;;g' \
michael@12 87 dbus/Makefile.in tools/Makefile.in bus/Makefile.in bus/session.conf.in bus/dbus-daemon.1.in
michael@12 88 %{l_shtool} subst \
michael@12 89 -e 's;\(\$(localstatedir)/run\)/dbus;\1;g' \
michael@12 90 bus/Makefile.in
michael@12 91 %{l_shtool} subst \
michael@12 92 -e 's;^\(dbusarchincludedir *= *\$(libdir)\)\(/include/dbus\);\1/dbus\2;g' \
michael@12 93 dbus/Makefile.in
michael@12 94 %{l_shtool} subst \
michael@12 95 -e 's;^\(LIBTOOL=.\)[^\ ]*;\1/bin/sh;' \
michael@12 96 configure
michael@12 97
michael@12 98 # platform specific fixes
michael@12 99 case "%{l_platform -t}" in
michael@12 100 *-sunos* )
michael@12 101 %{l_shtool} subst \
michael@12 102 -e 's;readdir_r;__posix_readdir_r;' \
michael@12 103 dbus/dbus-sysdeps-util-unix.c
michael@12 104 %{l_shtool} subst \
michael@12 105 -e 's;^\(Libs: -L\${libdir} -ldbus[^ ]*\);\1 -lsocket -lnsl;' \
michael@12 106 dbus-1.pc.in
michael@12 107 ;;
michael@12 108 esac
michael@12 109
michael@12 110 %build
michael@12 111 # configure package
michael@12 112 CC="%{l_cc}" \
michael@12 113 CFLAGS="%{l_cflags -O} -pthread" \
michael@12 114 CPPFLAGS="%{l_cppflags}" \
michael@12 115 LDFLAGS="%{l_ldflags} -pthread" \
michael@12 116 ./configure \
michael@12 117 --prefix=%{l_prefix} \
michael@12 118 --bindir=%{l_prefix}/lib/dbus/bin \
michael@12 119 --datadir=%{l_prefix}/share/dbus \
michael@12 120 --sysconfdir=%{l_prefix}/etc/dbus \
michael@12 121 --localstatedir=%{l_prefix}/var/dbus \
michael@12 122 --without-x \
michael@12 123 --disable-qt \
michael@12 124 --disable-qt3 \
michael@12 125 --disable-glib \
michael@12 126 --disable-gtk \
michael@12 127 --disable-tests \
michael@12 128 --disable-ansi \
michael@12 129 --disable-verbose-mode \
michael@12 130 --disable-asserts \
michael@12 131 --disable-checks \
michael@12 132 --disable-xml-docs \
michael@12 133 --disable-doxygen-docs \
michael@12 134 --disable-gcov \
michael@12 135 --disable-abstract-sockets \
michael@12 136 --disable-gcj \
michael@12 137 --disable-mono \
michael@12 138 --disable-mono-docs \
michael@12 139 --disable-python \
michael@12 140 --disable-selinux \
michael@12 141 --disable-dnotify \
michael@12 142 --disable-shared \
michael@12 143 --with-xml=libxml \
michael@12 144 --with-session-socket-dir=%{l_prefix}/var/dbus/run \
michael@12 145 --with-system-pid-file=%{l_prefix}/var/dbus/run/dbus.pid \
michael@12 146 --with-system-socket=%{l_prefix}/var/dbus/run/dbus.socket \
michael@12 147 --with-console-auth-dir=%{l_prefix}/var/dbus/run \
michael@12 148 --with-dbus-user=%{l_rusr}
michael@12 149
michael@12 150 # build package
michael@12 151 %{l_make} %{l_mflags -O}
michael@12 152
michael@12 153 %install
michael@12 154 # install package
michael@12 155 rm -rf $RPM_BUILD_ROOT
michael@12 156 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@12 157
michael@12 158 # strip down package
michael@12 159 strip $RPM_BUILD_ROOT%{l_prefix}/lib/dbus/bin/* >/dev/null 2>&1 || true
michael@12 160
michael@12 161 # install run-command script
michael@12 162 %{l_shtool} mkdir -f -p -m 755 \
michael@12 163 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@12 164 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@12 165 %{SOURCE rc.dbus} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@12 166
michael@12 167 # determine installation files
michael@12 168 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@12 169 %{l_files_std} \
michael@12 170 '%config %{l_prefix}/etc/dbus/*.conf' \
michael@12 171 '%config %{l_prefix}/etc/dbus/system.d/*.conf'
michael@12 172
michael@12 173 %files -f files
michael@12 174
michael@12 175 %clean
michael@12 176 rm -rf $RPM_BUILD_ROOT
michael@12 177
michael@12 178 %pre
michael@12 179 # save status and stop service before upgrade
michael@12 180 [ $1 -eq 2 ] || exit 0
michael@12 181 eval `%{l_rc} dbus status 2>/dev/null | tee %{l_tmpfile}`
michael@12 182 %{l_rc} dbus stop 2>/dev/null
michael@12 183 exit 0
michael@12 184
michael@12 185 %post
michael@12 186 if [ $1 -eq 2 ]; then
michael@12 187 # restore status after upgrade
michael@12 188 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
michael@12 189 [ ".$dbus_active" = .yes ] && %{l_rc} dbus start
michael@12 190 fi
michael@12 191 exit 0
michael@12 192
michael@12 193 %preun
michael@12 194 # stop service before erase and remove run files
michael@12 195 [ $1 -eq 0 ] || exit 0
michael@12 196 %{l_rc} dbus stop 2>/dev/null
michael@12 197 rm -f $RPM_INSTALL_PREFIX/var/dbus/run/* >/dev/null 2>&1 || true
michael@12 198 exit 0
michael@12 199

mercurial