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