dbus.spec 6.5 KB

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