Import spec, changing binary dir to not conflict with stock systems.

Sun, 04 Jan 2009 08:40:58 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 04 Jan 2009 08:40:58 +0100
changeset 12
333964c621f1
parent 11
f6a3aec3e5db
child 13
cb59d6afeb61

Import spec, changing binary dir to not conflict with stock systems.

dbus/dbus.patch file | annotate | diff | comparison | revisions
dbus/dbus.spec file | annotate | diff | comparison | revisions
dbus/rc.dbus file | annotate | diff | comparison | revisions
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dbus/dbus.patch	Sun Jan 04 08:40:58 2009 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +Index: dbus/dbus-internals.c
     1.5 +--- dbus/dbus-internals.c.orig	2006-11-17 20:12:18 +0100
     1.6 ++++ dbus/dbus-internals.c	2006-11-18 12:35:56 +0100
     1.7 +@@ -512,6 +512,14 @@
     1.8 +   uuid->as_uint32s[DBUS_UUID_LENGTH_WORDS - 1] = DBUS_UINT32_TO_BE (now);
     1.9 +   
    1.10 +   _dbus_generate_random_bytes_buffer (uuid->as_bytes, DBUS_UUID_LENGTH_BYTES - 4);
    1.11 ++
    1.12 ++  /* brand UUID as variant DCE 1.1 */
    1.13 ++  uuid->as_bytes[8] &= ~0xc0;
    1.14 ++  uuid->as_bytes[8] |= (0x02 << 6);
    1.15 ++
    1.16 ++  /* brand UUID as version 4 */
    1.17 ++  uuid->as_bytes[6] &= ~0xf0;
    1.18 ++  uuid->as_bytes[6] |= (0x04 << 4);
    1.19 + }
    1.20 + 
    1.21 + /**
    1.22 +Index: dbus/dbus-sysdeps-util-unix.c
    1.23 +--- dbus/dbus-sysdeps-util-unix.c.orig	2006-11-02 20:19:08 +0100
    1.24 ++++ dbus/dbus-sysdeps-util-unix.c	2006-11-18 12:33:22 +0100
    1.25 +@@ -31,6 +31,7 @@
    1.26 + #include "dbus-test.h"
    1.27 + 
    1.28 + #include <sys/types.h>
    1.29 ++#include <sys/param.h>
    1.30 + #include <stdlib.h>
    1.31 + #include <string.h>
    1.32 + #include <signal.h>
    1.33 +@@ -526,6 +527,8 @@
    1.34 + #   else
    1.35 + #       if defined(NAME_MAX)
    1.36 + 	 name_max = NAME_MAX;
    1.37 ++#       elif defined(MAXPATHLEN)
    1.38 ++	 name_max = MAXPATHLEN;
    1.39 + #       else
    1.40 + #           error "buffer size for readdir_r cannot be determined"
    1.41 + #       endif
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/dbus/dbus.spec	Sun Jan 04 08:40:58 2009 +0100
     2.3 @@ -0,0 +1,199 @@
     2.4 +##
     2.5 +##  dbus.spec -- OpenPKG RPM Package Specification
     2.6 +##  Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##
     2.8 +##  Permission to use, copy, modify, and distribute this software for
     2.9 +##  any purpose with or without fee is hereby granted, provided that
    2.10 +##  the above copyright notice and this permission notice appear in all
    2.11 +##  copies.
    2.12 +##
    2.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    2.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    2.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    2.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    2.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    2.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    2.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    2.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    2.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    2.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    2.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    2.24 +##  SUCH DAMAGE.
    2.25 +##
    2.26 +
    2.27 +#   package information
    2.28 +Name:         dbus
    2.29 +Summary:      Message Bus System
    2.30 +URL:          http://www.freedesktop.org/Software/dbus
    2.31 +Vendor:       Freedesktop Project
    2.32 +Packager:     OpenPKG Foundation e.V.
    2.33 +Distribution: OpenPKG Community
    2.34 +Class:        EVAL
    2.35 +Group:        RPC
    2.36 +License:      AFL/GPL
    2.37 +Version:      1.1.1
    2.38 +Release:      20081126
    2.39 +
    2.40 +#   list of sources
    2.41 +Source0:      http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz
    2.42 +Source1:      rc.dbus
    2.43 +Patch0:       dbus.patch
    2.44 +
    2.45 +#   build information
    2.46 +Prefix:       %{l_prefix}
    2.47 +BuildRoot:    %{l_buildroot}
    2.48 +BuildPreReq:  OpenPKG, openpkg >= 20040130, pkgconfig, gcc
    2.49 +PreReq:       OpenPKG, openpkg >= 20040130
    2.50 +BuildPreReq:  libxml
    2.51 +PreReq:       libxml
    2.52 +AutoReq:      no
    2.53 +AutoReqProv:  no
    2.54 +
    2.55 +%description
    2.56 +    D-BUS is a message bus system, a simple way for applications to
    2.57 +    talk to one another. D-BUS supplies both a system daemon and a per
    2.58 +    user login session daemon. Also, the message bus is built on top of
    2.59 +    a general one to one message passing framework, which can be used
    2.60 +    by any two apps to communicate directly (without going through the
    2.61 +    message bus daemon).
    2.62 +
    2.63 +%track
    2.64 +    prog dbus = {
    2.65 +        version   = %{version}
    2.66 +        url       = http://dbus.freedesktop.org/releases/dbus/
    2.67 +        regex     = dbus-(__VER__)\.tar\.gz
    2.68 +    }
    2.69 +
    2.70 +%prep
    2.71 +    %setup -q
    2.72 +    %patch -p0
    2.73 +
    2.74 +    #   adjust filesystem layout
    2.75 +    %{l_shtool} subst \
    2.76 +        -e 's;^\(cat[^|]*|\).*;\1 sed -e "s/\\(<listen>unix:tmpdir=\\)\[^<\]\*/\\1\\/tmp/" | \\;' \
    2.77 +        -e 's;#! /bin/bash;#!%{l_bash};' \
    2.78 +        tools/run-with-tmp-session-bus.sh
    2.79 +    %{l_shtool} subst \
    2.80 +        -e 's;/dbus-1\.0;;g' \
    2.81 +        -e 's;dbus-1;dbus;g' \
    2.82 +        -e 's;\(-I\${libdir}\).*;\1/dbus/include;g' \
    2.83 +        dbus-1.pc.in
    2.84 +    %{l_shtool} subst \
    2.85 +        -e 's;-1\.la;.la;g' \
    2.86 +        test/name-test/Makefile.in dbus/Makefile.in tools/Makefile.in
    2.87 +    %{l_shtool} subst \
    2.88 +        -e 's;/dbus-1\.0;;g' \
    2.89 +        -e 's;/dbus-1;;g' \
    2.90 +        dbus/Makefile.in tools/Makefile.in bus/Makefile.in bus/session.conf.in bus/dbus-daemon.1.in
    2.91 +    %{l_shtool} subst \
    2.92 +        -e 's;\(\$(localstatedir)/run\)/dbus;\1;g' \
    2.93 +        bus/Makefile.in
    2.94 +    %{l_shtool} subst \
    2.95 +        -e 's;^\(dbusarchincludedir *= *\$(libdir)\)\(/include/dbus\);\1/dbus\2;g' \
    2.96 +        dbus/Makefile.in
    2.97 +    %{l_shtool} subst \
    2.98 +        -e 's;^\(LIBTOOL=.\)[^\ ]*;\1/bin/sh;' \
    2.99 +        configure
   2.100 +
   2.101 +    #   platform specific fixes
   2.102 +    case "%{l_platform -t}" in
   2.103 +        *-sunos* )
   2.104 +            %{l_shtool} subst \
   2.105 +                -e 's;readdir_r;__posix_readdir_r;' \
   2.106 +                dbus/dbus-sysdeps-util-unix.c
   2.107 +            %{l_shtool} subst \
   2.108 +                -e 's;^\(Libs: -L\${libdir} -ldbus[^ ]*\);\1 -lsocket -lnsl;' \
   2.109 +                dbus-1.pc.in
   2.110 +            ;;
   2.111 +    esac
   2.112 +
   2.113 +%build
   2.114 +    #   configure package
   2.115 +    CC="%{l_cc}" \
   2.116 +    CFLAGS="%{l_cflags -O} -pthread" \
   2.117 +    CPPFLAGS="%{l_cppflags}" \
   2.118 +    LDFLAGS="%{l_ldflags} -pthread" \
   2.119 +    ./configure \
   2.120 +        --prefix=%{l_prefix} \
   2.121 +        --bindir=%{l_prefix}/lib/dbus/bin \
   2.122 +        --datadir=%{l_prefix}/share/dbus \
   2.123 +        --sysconfdir=%{l_prefix}/etc/dbus \
   2.124 +        --localstatedir=%{l_prefix}/var/dbus \
   2.125 +        --without-x \
   2.126 +        --disable-qt \
   2.127 +        --disable-qt3 \
   2.128 +        --disable-glib \
   2.129 +        --disable-gtk \
   2.130 +        --disable-tests \
   2.131 +        --disable-ansi \
   2.132 +        --disable-verbose-mode \
   2.133 +        --disable-asserts \
   2.134 +        --disable-checks \
   2.135 +        --disable-xml-docs \
   2.136 +        --disable-doxygen-docs \
   2.137 +        --disable-gcov \
   2.138 +        --disable-abstract-sockets \
   2.139 +        --disable-gcj \
   2.140 +        --disable-mono \
   2.141 +        --disable-mono-docs \
   2.142 +        --disable-python \
   2.143 +        --disable-selinux \
   2.144 +        --disable-dnotify \
   2.145 +        --disable-shared \
   2.146 +        --with-xml=libxml \
   2.147 +        --with-session-socket-dir=%{l_prefix}/var/dbus/run \
   2.148 +        --with-system-pid-file=%{l_prefix}/var/dbus/run/dbus.pid \
   2.149 +        --with-system-socket=%{l_prefix}/var/dbus/run/dbus.socket \
   2.150 +        --with-console-auth-dir=%{l_prefix}/var/dbus/run \
   2.151 +        --with-dbus-user=%{l_rusr}
   2.152 +
   2.153 +    #   build package
   2.154 +    %{l_make} %{l_mflags -O}
   2.155 +
   2.156 +%install
   2.157 +    #   install package
   2.158 +    rm -rf $RPM_BUILD_ROOT
   2.159 +    %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   2.160 +
   2.161 +    #   strip down package
   2.162 +    strip $RPM_BUILD_ROOT%{l_prefix}/lib/dbus/bin/* >/dev/null 2>&1 || true
   2.163 +
   2.164 +    #   install run-command script
   2.165 +    %{l_shtool} mkdir -f -p -m 755 \
   2.166 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   2.167 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   2.168 +        %{SOURCE rc.dbus} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   2.169 +
   2.170 +    #   determine installation files
   2.171 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   2.172 +        %{l_files_std} \
   2.173 +        '%config %{l_prefix}/etc/dbus/*.conf' \
   2.174 +        '%config %{l_prefix}/etc/dbus/system.d/*.conf'
   2.175 +
   2.176 +%files -f files
   2.177 +
   2.178 +%clean
   2.179 +    rm -rf $RPM_BUILD_ROOT
   2.180 +
   2.181 +%pre
   2.182 +    #   save status and stop service before upgrade
   2.183 +    [ $1 -eq 2 ] || exit 0
   2.184 +    eval `%{l_rc} dbus status 2>/dev/null | tee %{l_tmpfile}`
   2.185 +    %{l_rc} dbus stop 2>/dev/null
   2.186 +    exit 0
   2.187 +
   2.188 +%post
   2.189 +    if [ $1 -eq 2 ]; then
   2.190 +        #   restore status after upgrade
   2.191 +        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
   2.192 +        [ ".$dbus_active" = .yes ] && %{l_rc} dbus start
   2.193 +    fi
   2.194 +    exit 0
   2.195 +
   2.196 +%preun
   2.197 +    #   stop service before erase and remove run files
   2.198 +    [ $1 -eq 0 ] || exit 0
   2.199 +    %{l_rc} dbus stop 2>/dev/null
   2.200 +    rm -f $RPM_INSTALL_PREFIX/var/dbus/run/* >/dev/null 2>&1 || true
   2.201 +    exit 0
   2.202 +
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/dbus/rc.dbus	Sun Jan 04 08:40:58 2009 +0100
     3.3 @@ -0,0 +1,42 @@
     3.4 +#!@l_prefix@/bin/openpkg rc
     3.5 +##
     3.6 +##  rc.dbus -- Run-Commands
     3.7 +##
     3.8 +
     3.9 +%config
    3.10 +    dbus_enable="$openpkg_rc_def"
    3.11 +    dbus_flags="--system --fork"
    3.12 +
    3.13 +%common
    3.14 +    dbus_pidfile="@l_prefix@/var/dbus/run/dbus.pid"
    3.15 +    dbus_cfgfile="@l_prefix@/etc/dbus/system.conf"
    3.16 +    dbus_signal () {
    3.17 +        [ -f $dbus_pidfile ] && kill -$1 `cat $dbus_pidfile`
    3.18 +    }
    3.19 +
    3.20 +%status -u @l_susr@ -o
    3.21 +    dbus_usable="unknown"
    3.22 +    dbus_active="no"
    3.23 +    rcService dbus enable yes && \
    3.24 +        dbus_signal 0 && dbus_active="yes"
    3.25 +    echo "dbus_enable=\"$dbus_enable\""
    3.26 +    echo "dbus_usable=\"$dbus_usable\""
    3.27 +    echo "dbus_active=\"$dbus_active\""
    3.28 +
    3.29 +%start -u @l_susr@
    3.30 +    rcService dbus enable yes || exit 0
    3.31 +    rcService dbus active yes && exit 0
    3.32 +    @l_prefix@/lib/dbus/bin/dbus-daemon $dbus_flags >/dev/null 2>&1
    3.33 +
    3.34 +%stop -u @l_susr@
    3.35 +    rcService dbus enable yes || exit 0
    3.36 +    rcService dbus active no && exit 0
    3.37 +    dbus_signal TERM
    3.38 +    sleep 2
    3.39 +    rm -f $dbus_pidfile 2>/dev/null || true
    3.40 +
    3.41 +%restart -u @l_susr@
    3.42 +    rcService dbus enable yes || exit 0
    3.43 +    rcService dbus active no && exit 0
    3.44 +    rc dbus stop start
    3.45 +

mercurial