michael@12: ## michael@12: ## dbus.spec -- OpenPKG RPM Package Specification michael@12: ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. michael@12: ## michael@12: ## Permission to use, copy, modify, and distribute this software for michael@12: ## any purpose with or without fee is hereby granted, provided that michael@12: ## the above copyright notice and this permission notice appear in all michael@12: ## copies. michael@12: ## michael@12: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@12: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@12: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@12: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@12: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@12: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@12: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@12: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@12: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@12: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@12: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@12: ## SUCH DAMAGE. michael@12: ## michael@12: michael@12: # package information michael@12: Name: dbus michael@12: Summary: Message Bus System michael@12: URL: http://www.freedesktop.org/Software/dbus michael@12: Vendor: Freedesktop Project michael@12: Packager: OpenPKG Foundation e.V. michael@12: Distribution: OpenPKG Community michael@12: Class: EVAL michael@12: Group: RPC michael@12: License: AFL/GPL michael@76: Version: 1.2.12 michael@76: Release: 20090106 michael@12: michael@12: # list of sources michael@12: Source0: http://dbus.freedesktop.org/releases/dbus/dbus-%{version}.tar.gz michael@12: Source1: rc.dbus michael@12: Patch0: dbus.patch michael@12: michael@12: # build information michael@12: Prefix: %{l_prefix} michael@12: BuildRoot: %{l_buildroot} michael@85: BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc, pkgconfig michael@12: PreReq: OpenPKG, openpkg >= 20040130 michael@12: BuildPreReq: libxml michael@12: PreReq: libxml michael@12: AutoReq: no michael@12: AutoReqProv: no michael@12: michael@12: %description michael@12: D-BUS is a message bus system, a simple way for applications to michael@12: talk to one another. D-BUS supplies both a system daemon and a per michael@12: user login session daemon. Also, the message bus is built on top of michael@12: a general one to one message passing framework, which can be used michael@12: by any two apps to communicate directly (without going through the michael@12: message bus daemon). michael@12: michael@12: %track michael@12: prog dbus = { michael@12: version = %{version} michael@12: url = http://dbus.freedesktop.org/releases/dbus/ michael@12: regex = dbus-(__VER__)\.tar\.gz michael@12: } michael@12: michael@12: %prep michael@12: %setup -q michael@12: %patch -p0 michael@12: michael@76: # correct build configuration logic michael@12: %{l_shtool} subst \ michael@12: -e 's;^\(cat[^|]*|\).*;\1 sed -e "s/\\(unix:tmpdir=\\)\[^<\]\*/\\1\\/tmp/" | \\;' \ michael@12: -e 's;#! /bin/bash;#!%{l_bash};' \ michael@12: tools/run-with-tmp-session-bus.sh michael@12: %{l_shtool} subst \ michael@12: -e 's;/dbus-1\.0;;g' \ michael@76: -e 's;/dbus-1;;g' \ michael@12: -e 's;dbus-1;dbus;g' \ michael@12: -e 's;\(-I\${libdir}\).*;\1/dbus/include;g' \ michael@79: -e 's;\(-I\${includedir}\);\1/dbus;g' \ michael@12: dbus-1.pc.in michael@12: %{l_shtool} subst \ michael@76: -e 's;/dbus-1\.0;;g' \ michael@76: dbus/Makefile.in michael@76: %{l_shtool} subst \ michael@12: -e 's;-1\.la;.la;g' \ michael@76: dbus/Makefile.in tools/Makefile.in michael@12: %{l_shtool} subst \ michael@12: -e 's;/dbus-1;;g' \ michael@76: configure michael@76: %{l_shtool} subst \ michael@76: -e 's;/*dbus-1;;g' \ michael@76: dbus/Makefile.in \ michael@76: tools/Makefile.in \ michael@76: bus/Makefile.in \ michael@76: bus/dbus-daemon.1.in \ michael@76: bus/config-parser.c \ michael@76: dbus/dbus-sysdeps-unix.c michael@12: %{l_shtool} subst \ michael@12: -e 's;\(\$(localstatedir)/run\)/dbus;\1;g' \ michael@12: bus/Makefile.in michael@12: %{l_shtool} subst \ michael@12: -e 's;^\(dbusarchincludedir *= *\$(libdir)\)\(/include/dbus\);\1/dbus\2;g' \ michael@12: dbus/Makefile.in michael@12: michael@12: # platform specific fixes michael@12: case "%{l_platform -t}" in michael@12: *-sunos* ) michael@12: %{l_shtool} subst \ michael@80: -e 's;^\(Libs: -L\${libdir} -ldbus[^ ]*\);\1 -lbsm -lsocket -lnsl;' \ michael@12: dbus-1.pc.in michael@12: ;; michael@12: esac michael@12: michael@12: %build michael@12: # configure package michael@12: CC="%{l_cc}" \ michael@12: CFLAGS="%{l_cflags -O} -pthread" \ michael@12: CPPFLAGS="%{l_cppflags}" \ michael@12: LDFLAGS="%{l_ldflags} -pthread" \ michael@12: ./configure \ michael@12: --prefix=%{l_prefix} \ michael@12: --bindir=%{l_prefix}/lib/dbus/bin \ michael@12: --datadir=%{l_prefix}/share/dbus \ michael@12: --sysconfdir=%{l_prefix}/etc/dbus \ michael@12: --localstatedir=%{l_prefix}/var/dbus \ michael@12: --without-x \ michael@12: --disable-qt \ michael@12: --disable-qt3 \ michael@12: --disable-glib \ michael@12: --disable-gtk \ michael@12: --disable-tests \ michael@12: --disable-ansi \ michael@12: --disable-verbose-mode \ michael@12: --disable-asserts \ michael@12: --disable-checks \ michael@12: --disable-xml-docs \ michael@12: --disable-doxygen-docs \ michael@12: --disable-gcov \ michael@12: --disable-abstract-sockets \ michael@12: --disable-gcj \ michael@12: --disable-mono \ michael@12: --disable-mono-docs \ michael@12: --disable-python \ michael@12: --disable-selinux \ michael@12: --disable-dnotify \ michael@12: --disable-shared \ michael@12: --with-xml=libxml \ michael@12: --with-session-socket-dir=%{l_prefix}/var/dbus/run \ michael@12: --with-system-pid-file=%{l_prefix}/var/dbus/run/dbus.pid \ michael@12: --with-system-socket=%{l_prefix}/var/dbus/run/dbus.socket \ michael@12: --with-console-auth-dir=%{l_prefix}/var/dbus/run \ michael@12: --with-dbus-user=%{l_rusr} michael@12: michael@12: # build package michael@12: %{l_make} %{l_mflags -O} michael@12: michael@12: %install michael@12: # install package michael@12: rm -rf $RPM_BUILD_ROOT michael@76: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@12: michael@76: # strip binaries of symbols michael@12: strip $RPM_BUILD_ROOT%{l_prefix}/lib/dbus/bin/* >/dev/null 2>&1 || true michael@76: strip $RPM_BUILD_ROOT%{l_prefix}/libexec/dbus/bin/* >/dev/null 2>&1 || true michael@12: michael@76: # correct the installation hierarchy michael@76: mv $RPM_BUILD_ROOT%{l_prefix}/share/man \ michael@76: $RPM_BUILD_ROOT%{l_prefix}/ michael@76: rm -rf $RPM_BUILD_ROOT%{l_prefix}/share michael@76: michael@76: # install runcommand script michael@12: %{l_shtool} mkdir -f -p -m 755 \ michael@12: $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d michael@12: %{l_shtool} install -c -m 755 %{l_value -s -a} \ michael@12: %{SOURCE rc.dbus} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ michael@12: michael@12: # determine installation files michael@12: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@12: %{l_files_std} \ michael@12: '%config %{l_prefix}/etc/dbus/*.conf' \ michael@77: '%config %{l_prefix}/etc/dbus/system.d/*.conf' \ michael@77: '%not %dir %{l_prefix}/lib/pkgconfig' michael@12: michael@12: %files -f files michael@12: michael@12: %clean michael@12: rm -rf $RPM_BUILD_ROOT michael@12: michael@12: %pre michael@12: # save status and stop service before upgrade michael@12: [ $1 -eq 2 ] || exit 0 michael@12: eval `%{l_rc} dbus status 2>/dev/null | tee %{l_tmpfile}` michael@12: %{l_rc} dbus stop 2>/dev/null michael@12: exit 0 michael@12: michael@12: %post michael@12: if [ $1 -eq 2 ]; then michael@12: # restore status after upgrade michael@12: eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} michael@12: [ ".$dbus_active" = .yes ] && %{l_rc} dbus start michael@12: fi michael@12: exit 0 michael@12: michael@12: %preun michael@12: # stop service before erase and remove run files michael@12: [ $1 -eq 0 ] || exit 0 michael@12: %{l_rc} dbus stop 2>/dev/null michael@12: rm -f $RPM_INSTALL_PREFIX/var/dbus/run/* >/dev/null 2>&1 || true michael@12: exit 0 michael@12: