dbus/dbus.spec

changeset 12
333964c621f1
child 76
11e79e472059
equal deleted inserted replaced
-1:000000000000 0:17b1211b1ac5
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 ##
23
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.1.1
35 Release: 20081126
36
37 # list of sources
38 Source0: http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz
39 Source1: rc.dbus
40 Patch0: dbus.patch
41
42 # build information
43 Prefix: %{l_prefix}
44 BuildRoot: %{l_buildroot}
45 BuildPreReq: OpenPKG, openpkg >= 20040130, pkgconfig, gcc
46 PreReq: OpenPKG, openpkg >= 20040130
47 BuildPreReq: libxml
48 PreReq: libxml
49 AutoReq: no
50 AutoReqProv: no
51
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).
59
60 %track
61 prog dbus = {
62 version = %{version}
63 url = http://dbus.freedesktop.org/releases/dbus/
64 regex = dbus-(__VER__)\.tar\.gz
65 }
66
67 %prep
68 %setup -q
69 %patch -p0
70
71 # adjust filesystem layout
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;dbus;g' \
79 -e 's;\(-I\${libdir}\).*;\1/dbus/include;g' \
80 dbus-1.pc.in
81 %{l_shtool} subst \
82 -e 's;-1\.la;.la;g' \
83 test/name-test/Makefile.in dbus/Makefile.in tools/Makefile.in
84 %{l_shtool} subst \
85 -e 's;/dbus-1\.0;;g' \
86 -e 's;/dbus-1;;g' \
87 dbus/Makefile.in tools/Makefile.in bus/Makefile.in bus/session.conf.in bus/dbus-daemon.1.in
88 %{l_shtool} subst \
89 -e 's;\(\$(localstatedir)/run\)/dbus;\1;g' \
90 bus/Makefile.in
91 %{l_shtool} subst \
92 -e 's;^\(dbusarchincludedir *= *\$(libdir)\)\(/include/dbus\);\1/dbus\2;g' \
93 dbus/Makefile.in
94 %{l_shtool} subst \
95 -e 's;^\(LIBTOOL=.\)[^\ ]*;\1/bin/sh;' \
96 configure
97
98 # platform specific fixes
99 case "%{l_platform -t}" in
100 *-sunos* )
101 %{l_shtool} subst \
102 -e 's;readdir_r;__posix_readdir_r;' \
103 dbus/dbus-sysdeps-util-unix.c
104 %{l_shtool} subst \
105 -e 's;^\(Libs: -L\${libdir} -ldbus[^ ]*\);\1 -lsocket -lnsl;' \
106 dbus-1.pc.in
107 ;;
108 esac
109
110 %build
111 # configure package
112 CC="%{l_cc}" \
113 CFLAGS="%{l_cflags -O} -pthread" \
114 CPPFLAGS="%{l_cppflags}" \
115 LDFLAGS="%{l_ldflags} -pthread" \
116 ./configure \
117 --prefix=%{l_prefix} \
118 --bindir=%{l_prefix}/lib/dbus/bin \
119 --datadir=%{l_prefix}/share/dbus \
120 --sysconfdir=%{l_prefix}/etc/dbus \
121 --localstatedir=%{l_prefix}/var/dbus \
122 --without-x \
123 --disable-qt \
124 --disable-qt3 \
125 --disable-glib \
126 --disable-gtk \
127 --disable-tests \
128 --disable-ansi \
129 --disable-verbose-mode \
130 --disable-asserts \
131 --disable-checks \
132 --disable-xml-docs \
133 --disable-doxygen-docs \
134 --disable-gcov \
135 --disable-abstract-sockets \
136 --disable-gcj \
137 --disable-mono \
138 --disable-mono-docs \
139 --disable-python \
140 --disable-selinux \
141 --disable-dnotify \
142 --disable-shared \
143 --with-xml=libxml \
144 --with-session-socket-dir=%{l_prefix}/var/dbus/run \
145 --with-system-pid-file=%{l_prefix}/var/dbus/run/dbus.pid \
146 --with-system-socket=%{l_prefix}/var/dbus/run/dbus.socket \
147 --with-console-auth-dir=%{l_prefix}/var/dbus/run \
148 --with-dbus-user=%{l_rusr}
149
150 # build package
151 %{l_make} %{l_mflags -O}
152
153 %install
154 # install package
155 rm -rf $RPM_BUILD_ROOT
156 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
157
158 # strip down package
159 strip $RPM_BUILD_ROOT%{l_prefix}/lib/dbus/bin/* >/dev/null 2>&1 || true
160
161 # install run-command script
162 %{l_shtool} mkdir -f -p -m 755 \
163 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
164 %{l_shtool} install -c -m 755 %{l_value -s -a} \
165 %{SOURCE rc.dbus} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
166
167 # determine installation files
168 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
169 %{l_files_std} \
170 '%config %{l_prefix}/etc/dbus/*.conf' \
171 '%config %{l_prefix}/etc/dbus/system.d/*.conf'
172
173 %files -f files
174
175 %clean
176 rm -rf $RPM_BUILD_ROOT
177
178 %pre
179 # save status and stop service before upgrade
180 [ $1 -eq 2 ] || exit 0
181 eval `%{l_rc} dbus status 2>/dev/null | tee %{l_tmpfile}`
182 %{l_rc} dbus stop 2>/dev/null
183 exit 0
184
185 %post
186 if [ $1 -eq 2 ]; then
187 # restore status after upgrade
188 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
189 [ ".$dbus_active" = .yes ] && %{l_rc} dbus start
190 fi
191 exit 0
192
193 %preun
194 # stop service before erase and remove run files
195 [ $1 -eq 0 ] || exit 0
196 %{l_rc} dbus stop 2>/dev/null
197 rm -f $RPM_INSTALL_PREFIX/var/dbus/run/* >/dev/null 2>&1 || true
198 exit 0
199

mercurial