recipe 2.7 KB

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