recipe 3.6 KB

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