recipe 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. # Build recipe for at.
  2. #
  3. # Copyright (c) 2018, 2020-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=at
  19. version=3.2.2
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=daemons
  23. tarname=${program}_${version}.orig.tar.gz
  24. # Remote source(s)
  25. fetch=http://software.calhariz.com/at/$tarname
  26. description="
  27. The at package provide delayed job execution and batch processing.
  28. It includes:
  29. at - queues, examines or deletes jobs for later execution.
  30. atd - is the daemon that runs jobs queued for later execution.
  31. atq - lists the user's pending jobs, or all jobs, if superuser.
  32. atrm - deletes jobs, identified by their job number.
  33. atrun - runs jobs queued for later execution.
  34. batch - script that executes commands when system load levels permit.
  35. "
  36. homepage=https://blog.calhariz.com/tag/at
  37. license=GPLv2+
  38. # The source documentation will be auto-installed
  39. docsdir="${docdir}/${program}-${version}"
  40. # This source does not support parallel jobs
  41. jobs=1
  42. build()
  43. {
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. # Update for hosts based on musl
  49. cp -f "${worktree}/archive/common/config.guess" config.guess
  50. cp -f "${worktree}/archive/common/config.sub" config.sub
  51. # Fix Makefile.in so that the documentation directory is
  52. # installed in the specified docdir (Thanks to BLFS!)
  53. sed -i '/docdir/s/=.*/= @docdir@/' Makefile.in
  54. # Apply a patch (from "Void Linux") to solve build issues
  55. patch -p0 < "${worktree}/patches/at/flex_isleap.patch"
  56. ./configure CPPFLAGS="$QICPPFLAGS" \
  57. CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
  58. SENDMAIL=/usr/sbin/sendmail \
  59. $configure_args \
  60. --mandir=$mandir \
  61. --docdir=$docsdir \
  62. --with-jobdir=/var/spool/atd \
  63. --with-atspool=/var/spool/atd \
  64. --with-daemon_username=daemon \
  65. --with-daemon_groupname=daemon \
  66. --build="$(gcc -dumpmachine)"
  67. make -j${jobs} V=1
  68. make -j${jobs} IROOT="$destdir" install
  69. # Clean up installed file
  70. rm -f "${destdir}/var/spool/atd/.SEQ"
  71. # Set permissions for the spool directory
  72. chmod 770 "${destdir}/var/spool/atd"
  73. # Install atd perp service(s)
  74. mkdir -p "${destdir}/etc/perp/atd"
  75. cp -p "${worktree}/archive/at/rc.log" \
  76. "${worktree}/archive/at/rc.main" \
  77. "${destdir}/etc/perp/atd/"
  78. chmod 755 "${destdir}"/etc/perp/atd/rc.*
  79. # THIS SERVICE IS DISABLED BY DEFAULT
  80. chmod -t "${destdir}/etc/perp/atd"
  81. # Manage (dot) new files via graft(1)
  82. touch "${destdir}/etc/.graft-config" \
  83. "${destdir}/etc/perp/atd/.graft-config"
  84. # Compress and link man pages (if needed)
  85. if test -d "${destdir}/$mandir"
  86. then
  87. (
  88. cd "${destdir}/$mandir"
  89. find . -type f -exec lzip -9 {} +
  90. find . -type l | while read -r file
  91. do
  92. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  93. rm -- "$file"
  94. done
  95. )
  96. fi
  97. }