recipe 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Build recipe for scron.
  2. #
  3. # Copyright (c) 2017 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=scron
  19. version=0.4
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=daemons
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://dl.2f30.org/releases/$tarname
  26. description="
  27. Clock daemon.
  28. Scron schedules commands to be run at specified dates and times.
  29. "
  30. homepage=https://git.2f30.org/scron
  31. license=MIT/X
  32. # Source documentation
  33. docs="LICENSE README TODO"
  34. docsdir="${docdir}/${program}-${version}"
  35. build()
  36. {
  37. unpack "${tardir}/$tarname"
  38. cd "$srcdir"
  39. # Set sane permissions
  40. chmod -R u+w,go-w,a+rX-s .
  41. make -j${jobs} \
  42. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS -std=c99 -Wall -Wextra -pedantic -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE" \
  43. LDFLAGS="$QILDFLAGS -static" \
  44. PREFIX=/usr \
  45. MANPREFIX=$mandir \
  46. DESTDIR="$destdir" install
  47. # Compress man page and copy the documentation
  48. lzip -9 "${destdir}/${mandir}/man1/scron.1"
  49. ln -s scron.1.lz "${destdir}/${mandir}/man1/cron.1.lz" # Symlink-compatibility.
  50. mkdir -p "${destdir}/$docsdir"
  51. cp -p $docs "${destdir}/$docsdir"
  52. # Create directories adding the crontab file
  53. mkdir -p "${destdir}/etc/cron.hourly" \
  54. "${destdir}/etc/cron.daily" \
  55. "${destdir}/etc/cron.weekly" \
  56. "${destdir}/etc/cron.monthly"
  57. # Incorporate our "run-parts" version for running cron jobs
  58. cp -p "${worktree}/archive/scron/run-parts" "${destdir}/usr/bin/"
  59. chmod 755 "${destdir}/usr/bin/run-parts"
  60. # Add the crontab file
  61. mkdir -p "${destdir}/etc"
  62. cp -p "${worktree}/archive/scron/crontab" "${destdir}/etc/"
  63. chmod 644 "${destdir}/etc/crontab"
  64. # Install scron perp service
  65. mkdir -p "${destdir}/etc/perp/crond"
  66. cp -p "${worktree}/archive/scron/rc.log" \
  67. "${worktree}/archive/scron/rc.main" \
  68. "${destdir}/etc/perp/crond/"
  69. chmod 755 "${destdir}"/etc/perp/crond/rc.*
  70. # Be an active service by default
  71. chmod +t "${destdir}/etc/perp/crond"
  72. # To handle config file(s)
  73. touch "${destdir}/etc/.graft-config" \
  74. "${destdir}/etc/perp/crond/.graft-config"
  75. }