recipes: daemons/dbus*: Use the default /var/lib/dbus location for UUID gen
[dragora.git] / recipes / daemons / dbus-x11 / recipe
blobae9c2e3331bf05f264d96818a0d8bad80fec09a8
1 # Build recipe for dbus.
3 # Copyright (C) 2018, MMPG <mmpg@vp.pl>
4 # Copyright (c) 2018-2021 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 # Exit immediately on any error
19 set -e
21 program=dbus
22 version=1.12.20
23 release=6
25 pkgname=dbus-x11
27 # Define a category for the output of the package name
28 pkgcategory=daemons
30 # The installation of this package replaces to
31 replace=dbus
33 tarname=${program}-${version}.tar.gz
35 # Remote source(s)
36 fetch=https://dbus.freedesktop.org/releases/dbus/$tarname
38 description="
39 A system daemon and a per user login session daemon (with X11 support).
41 The message bus is built on top of a general one-to-one message passing
42 framework, which can be used by any two apps to communicate directly
43 (without going through the message bus daemon).
46 homepage=https://www.freedesktop.org/wiki/Software/dbus/
47 license="AFLv2.1 | GPLv2+"
49 # Source documentation
50 docs="AUTHORS COPYING ChangeLog NEWS README"
51 docsdir="${docdir}/${pkgname}-${version}"
53 build()
55     unpack "${tardir}/$tarname"
56     
57     cd "$srcdir"
59     # Apply a patch to allow root to do anything (Thanks to "Slackware Linux").
60     patch -Np1 \
61      -i "${worktree}/patches/dbus/dbus-1.12.x-allow_root_globally.diff"
63     # Set sane permissions
64     chmod -R u+w,go-w,a+rX-s .
65     
66     ./configure CPPFLAGS="$QICPPFLAGS" \
67     CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
68      $configure_args \
69      --libdir=/usr/lib${libSuffix} \
70      --mandir=$mandir \
71      --docdir=$docsdir \
72      --enable-static=no \
73      --enable-shared=yes \
74      --enable-debug=no \
75      --enable-inotify \
76      --enable-x11-autolaunch \
77      --disable-selinux \
78      --disable-doxygen-docs \
79      --with-xml=expat \
80      --with-system-socket=/run/system_bus_socket \
81      --with-system-pid-file=/run/dbus.pid \
82      --with-console-auth-dir=/dev/console \
83      --with-systemduserunitdir=no \
84      --with-systemdsystemunitdir=no \
85      --build="$(gcc -dumpmachine)"
87     make -j${jobs} V=1
88     make -j${jobs} DESTDIR="$destdir" install
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}/etc/dbus-1/system.d"
95     # Compress and link man pages (if needed)
96     if test -d "${destdir}/$mandir"
97     then
98         (
99             cd "${destdir}/$mandir"
100             find . -type f -exec lzip -9 {} +
101             find . -type l | while read -r file
102             do
103                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
104                 rm -- "$file"
105             done
106         )
107     fi
108     
109     # Copy documentation
110     mkdir -p "${destdir}${docsdir}"
111     cp -p $docs "${destdir}${docsdir}"
113     # Install perp service for dbus
115     mkdir -p "${destdir}/etc/perp/dbus"
116     cp -p "${worktree}/archive/dbus/rc.log" \
117           "${worktree}/archive/dbus/rc.main" \
118           "${destdir}/etc/perp/dbus/"
120     chmod 755 "${destdir}"/etc/perp/dbus/rc.*
122     # Be an active service by default
123     chmod +t "${destdir}/etc/perp/dbus"
125     # To handle config file(s)
126     touch "${destdir}/etc/dbus-1/.graft-config" \
127           "${destdir}/etc/perp/dbus/.graft-config"