recipe 3.6 KB

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