recipe 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # Build recipe for acpid.
  2. #
  3. # Copyright (c) 2018-2019, 2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=acpid
  19. version=2.0.33
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=daemons
  23. tarname=${program}-${version}.tar.xz
  24. # Remote source(s)
  25. fetch=https://downloads.sourceforge.net/project/acpid2/$tarname
  26. description="
  27. Advanced Configuration and Power Interface event daemon.
  28. The acpid is a completely flexible, totally extensible daemon for
  29. delivering ACPI events. It listens on netlink interface and when
  30. an event occurs, executes programs to handle the event.
  31. "
  32. homepage=https://sourceforge.net/projects/acpid2
  33. license=GPLv2+
  34. # Source documentation
  35. docsdir="${docdir}/${program}-${version}"
  36. build()
  37. {
  38. unpack "${tardir}/$tarname"
  39. cd "$srcdir"
  40. # Set sane permissions
  41. chmod -R u+w,go-w,a+rX-s .
  42. ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  43. $configure_args \
  44. --libdir=/usr/lib${libSuffix} \
  45. --mandir=$mandir \
  46. --docdir=$docsdir \
  47. --build="$(gcc -dumpmachine)"
  48. make -j${jobs} V=1
  49. make -j${jobs} DESTDIR="$destdir" install
  50. # Compress and link man pages (if needed)
  51. if test -d "${destdir}/$mandir"
  52. then
  53. (
  54. cd "${destdir}/$mandir"
  55. find . -type f -exec lzip -9 {} +
  56. find . -type l | while read -r file
  57. do
  58. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  59. rm -- "$file"
  60. done
  61. )
  62. fi
  63. # Add ACPI event files
  64. mkdir -p "${destdir}/etc/acpi/events" "${destdir}/usr/libexec/acpi"
  65. cp -p "${worktree}/archive/acpid/events"/* "${destdir}/etc/acpi/events/" || true;
  66. touch "${destdir}/etc/acpi/events/.graft-config"
  67. cp -p -r "${worktree}/archive/acpid/events/actions"/* \
  68. "${destdir}/usr/libexec/acpi"
  69. # Set up package permissions
  70. find "${destdir}/etc/acpi" -type f -exec chmod 644 '{}' +
  71. find "${destdir}/usr/libexec/acpi" -type f -exec chmod 755 '{}' +
  72. # Install ACPI perp service
  73. mkdir -p "${destdir}/etc/perp/acpid"
  74. cp -p "${worktree}/archive/acpid/rc.log" \
  75. "${worktree}/archive/acpid/rc.main" \
  76. "${destdir}/etc/perp/acpid/"
  77. chmod 755 "${destdir}"/etc/perp/acpid/rc.*
  78. # Be an active service by default
  79. chmod +t "${destdir}/etc/perp/acpid"
  80. touch "${destdir}/etc/perp/acpid/.graft-config"
  81. }