recipes: daemons/dbus_x11: Reconfigured
[dragora.git] / recipes / daemons / dbus_x11 / recipe
blob1494fd4b25bf8b2e83e1d0f4df962ce8ac44fc28
1 # Build recipe for dbus (with X11 support).
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (c) 2018-2020 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 program=dbus
19 version=1.12.16
20 release=2
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/daemons"
25 pkgname=dbus_x11
27 # The installation of this package replaces to
28 replace=dbus
30 tarname=${program}-${version}.tar.gz
32 # Remote source(s)
33 fetch=http://dbus.freedesktop.org/releases/dbus/$tarname
35 description="
36 A system daemon and a per user login session daemon (with X11 support).
38 The message bus is built on top of a general one-to-one message passing
39 framework, which can be used by any two apps to communicate directly
40 (without going through the message bus daemon).
43 homepage=http://www.freedesktop.org/wiki/Software/dbus/
44 license="AFLv2.1 | GPLv2+"
46 # Source documentation
47 docs="AUTHORS COPYING ChangeLog NEWS README"
48 docsdir="${docdir}/${program}-${version}"
50 build()
52     set -e
54     unpack "${tardir}/$tarname"
55     
56     cd "$srcdir"
58     # Apply a patch to allow root to do anything (thanks to "Slackware Linux").
59     patch -Np1 \
60      -i "${worktree}/patches/dbus/dbus-1.12.x-allow_root_globally.diff"
62     # Set sane permissions
63     chmod -R u+w,go-w,a+rX-s .
64     
65     ./configure \
66     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
67      $configure_args \
68      --libdir=/usr/lib${libSuffix} \
69      --mandir=$mandir \
70      --docdir=$docsdir \
71      --runstatedir=/run \
72      --enable-static=no \
73      --enable-shared=yes \
74      --enable-debug=no \
75      --enable-inotify \
76      --enable-x11-autolaunch \
77      --disable-systemd \
78      --disable-selinux \
79      --disable-doxygen-docs \
80      --with-xml=expat \
81      --with-dbus-user=messagebus \
82      --with-console-auth-dir=/run/console \
83      --with-system-pid-file=/run/dbus/pid \
84      --with-system-socket=/run/dbus/system_bus_socket \
85      --build="$(cc -dumpmachine)"
86     
87     make -j${jobs} V=1
88     make -j${jobs} DESTDIR="$destdir" install-strip
90     chown root:messagebus "${destdir}/usr/libexec/dbus-daemon-launch-helper"
91     chmod 4750 "${destdir}/usr/libexec/dbus-daemon-launch-helper"
93     mkdir -p "${destdir}/var/lib/dbus"
94     chown messagebus "${destdir}/var/lib/dbus"
96     # Compress and link man pages (if needed)
97     if test -d "${destdir}/$mandir"
98     then
99         (
100             cd "${destdir}/$mandir"
101             find . -type f -exec lzip -9 '{}' +
102             find . -type l | while read -r file
103             do
104                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105                 rm -- "$file"
106             done
107         )
108     fi
109     
110     # Copy documentation
111     mkdir -p "${destdir}${docsdir}"
112     cp -p $docs "${destdir}${docsdir}/"
114     # Install perp service for dbus
116     mkdir -p "${destdir}/etc/perp/dbus"
118     cp -p "${worktree}/archive/dbus/rc.log" \
119           "${worktree}/archive/dbus/rc.main" \
120           "${destdir}/etc/perp/dbus/"
122     chmod 755 "${destdir}"/etc/perp/dbus/rc.*
124     # Be an active service by default
125     chmod +t "${destdir}/etc/perp/dbus"
127     # To handle config file(s)
128     touch "${destdir}/etc/dbus-1/.graft-config" \
129           "${destdir}/etc/perp/dbus/.graft-config"