Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 ##
2 ## dbus.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2008 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 ##
24 # package information
25 Name: dbus
26 Summary: Message Bus System
27 URL: http://www.freedesktop.org/Software/dbus
28 Vendor: Freedesktop Project
29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community
31 Class: EVAL
32 Group: RPC
33 License: AFL/GPL
34 Version: 1.2.12
35 Release: 20090106
37 # list of sources
38 Source0: http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz
39 Source1: rc.dbus
40 Patch0: dbus.patch
42 # build information
43 Prefix: %{l_prefix}
44 BuildRoot: %{l_buildroot}
45 BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, pkgconfig
46 PreReq: OpenPKG, openpkg >= 20040130
47 BuildPreReq: libxml
48 PreReq: libxml
49 AutoReq: no
50 AutoReqProv: no
52 %description
53 D-BUS is a message bus system, a simple way for applications to
54 talk to one another. D-BUS supplies both a system daemon and a per
55 user login session daemon. Also, the message bus is built on top of
56 a general one to one message passing framework, which can be used
57 by any two apps to communicate directly (without going through the
58 message bus daemon).
60 %track
61 prog dbus = {
62 version = %{version}
63 url = http://dbus.freedesktop.org/releases/dbus/
64 regex = dbus-(__VER__)\.tar\.gz
65 }
67 %prep
68 %setup -q
69 %patch -p0
71 # correct build configuration logic
72 %{l_shtool} subst \
73 -e 's;^\(cat[^|]*|\).*;\1 sed -e "s/\\(<listen>unix:tmpdir=\\)\[^<\]\*/\\1\\/tmp/" | \\;' \
74 -e 's;#! /bin/bash;#!%{l_bash};' \
75 tools/run-with-tmp-session-bus.sh
76 %{l_shtool} subst \
77 -e 's;/dbus-1\.0;;g' \
78 -e 's;/dbus-1;;g' \
79 -e 's;dbus-1;dbus;g' \
80 -e 's;\(-I\${libdir}\).*;\1/dbus/include;g' \
81 -e 's;\(-I\${includedir}\);\1/dbus;g' \
82 dbus-1.pc.in
83 %{l_shtool} subst \
84 -e 's;/dbus-1\.0;;g' \
85 dbus/Makefile.in
86 %{l_shtool} subst \
87 -e 's;-1\.la;.la;g' \
88 dbus/Makefile.in tools/Makefile.in
89 %{l_shtool} subst \
90 -e 's;/dbus-1;;g' \
91 configure
92 %{l_shtool} subst \
93 -e 's;/*dbus-1;;g' \
94 dbus/Makefile.in \
95 tools/Makefile.in \
96 bus/Makefile.in \
97 bus/dbus-daemon.1.in \
98 bus/config-parser.c \
99 dbus/dbus-sysdeps-unix.c
100 %{l_shtool} subst \
101 -e 's;\(\$(localstatedir)/run\)/dbus;\1;g' \
102 bus/Makefile.in
103 %{l_shtool} subst \
104 -e 's;^\(dbusarchincludedir *= *\$(libdir)\)\(/include/dbus\);\1/dbus\2;g' \
105 dbus/Makefile.in
107 # platform specific fixes
108 case "%{l_platform -t}" in
109 *-sunos* )
110 %{l_shtool} subst \
111 -e 's;^\(Libs: -L\${libdir} -ldbus[^ ]*\);\1 -lbsm -lsocket -lnsl;' \
112 dbus-1.pc.in
113 ;;
114 esac
116 %build
117 # configure package
118 CC="%{l_cc}" \
119 CFLAGS="%{l_cflags -O} -pthread" \
120 CPPFLAGS="%{l_cppflags}" \
121 LDFLAGS="%{l_ldflags} -pthread" \
122 ./configure \
123 --prefix=%{l_prefix} \
124 --bindir=%{l_prefix}/lib/dbus/bin \
125 --datadir=%{l_prefix}/share/dbus \
126 --sysconfdir=%{l_prefix}/etc/dbus \
127 --localstatedir=%{l_prefix}/var/dbus \
128 --without-x \
129 --disable-qt \
130 --disable-qt3 \
131 --disable-glib \
132 --disable-gtk \
133 --disable-tests \
134 --disable-ansi \
135 --disable-verbose-mode \
136 --disable-asserts \
137 --disable-checks \
138 --disable-xml-docs \
139 --disable-doxygen-docs \
140 --disable-gcov \
141 --disable-abstract-sockets \
142 --disable-gcj \
143 --disable-mono \
144 --disable-mono-docs \
145 --disable-python \
146 --disable-selinux \
147 --disable-dnotify \
148 --disable-shared \
149 --with-xml=libxml \
150 --with-session-socket-dir=%{l_prefix}/var/dbus/run \
151 --with-system-pid-file=%{l_prefix}/var/dbus/run/dbus.pid \
152 --with-system-socket=%{l_prefix}/var/dbus/run/dbus.socket \
153 --with-console-auth-dir=%{l_prefix}/var/dbus/run \
154 --with-dbus-user=%{l_rusr}
156 # build package
157 %{l_make} %{l_mflags -O}
159 %install
160 # install package
161 rm -rf $RPM_BUILD_ROOT
162 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
164 # strip binaries of symbols
165 strip $RPM_BUILD_ROOT%{l_prefix}/lib/dbus/bin/* >/dev/null 2>&1 || true
166 strip $RPM_BUILD_ROOT%{l_prefix}/libexec/dbus/bin/* >/dev/null 2>&1 || true
168 # correct the installation hierarchy
169 mv $RPM_BUILD_ROOT%{l_prefix}/share/man \
170 $RPM_BUILD_ROOT%{l_prefix}/
171 rm -rf $RPM_BUILD_ROOT%{l_prefix}/share
173 # install runcommand script
174 %{l_shtool} mkdir -f -p -m 755 \
175 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
176 %{l_shtool} install -c -m 755 %{l_value -s -a} \
177 %{SOURCE rc.dbus} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
179 # determine installation files
180 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
181 %{l_files_std} \
182 '%config %{l_prefix}/etc/dbus/*.conf' \
183 '%config %{l_prefix}/etc/dbus/system.d/*.conf' \
184 '%not %dir %{l_prefix}/lib/pkgconfig'
186 %files -f files
188 %clean
189 rm -rf $RPM_BUILD_ROOT
191 %pre
192 # save status and stop service before upgrade
193 [ $1 -eq 2 ] || exit 0
194 eval `%{l_rc} dbus status 2>/dev/null | tee %{l_tmpfile}`
195 %{l_rc} dbus stop 2>/dev/null
196 exit 0
198 %post
199 if [ $1 -eq 2 ]; then
200 # restore status after upgrade
201 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
202 [ ".$dbus_active" = .yes ] && %{l_rc} dbus start
203 fi
204 exit 0
206 %preun
207 # stop service before erase and remove run files
208 [ $1 -eq 0 ] || exit 0
209 %{l_rc} dbus stop 2>/dev/null
210 rm -f $RPM_INSTALL_PREFIX/var/dbus/run/* >/dev/null 2>&1 || true
211 exit 0