3 # Copyright (c) 2018, 2020 Matias Fonzo, <selk@dragora.org>.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 # Define a category for the output of the package name
24 tarname=${program}_${version}.orig.tar.gz
27 fetch=http://software.calhariz.com/at/$tarname
30 The at package provide delayed job execution and batch processing.
34 at - queues, examines or deletes jobs for later execution.
35 atd - is the daemon that runs jobs queued for later execution.
36 atq - lists the user's pending jobs, or all jobs, if superuser.
37 atrm - deletes jobs, identified by their job number.
38 atrun - runs jobs queued for later execution.
39 batch - script that executes commands when system load levels permit.
42 homepage=http://blog.calhariz.com/tag/at
45 # The source documentation will be auto-installed
46 docsdir="${docdir}/${program}-${version}"
48 # This source does not support parallel jobs
55 unpack "${tardir}/$tarname"
59 # Set sane permissions
60 chmod -R u+w,go-w,a+rX-s .
62 # Update for hosts based on musl
63 cp -f "${worktree}/archive/common/config.guess" config.guess
64 cp -f "${worktree}/archive/common/config.sub" config.sub
66 # Fix Makefile.in so that the documentation directory is
67 # installed in the specified docdir (Thanks to BLFS!)
68 sed -i '/docdir/s/=.*/= @docdir@/' Makefile.in
70 # Apply a patch (from "Void Linux") to solve build issues
71 patch -p0 < "${worktree}/patches/at/flex_isleap.patch"
73 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
74 SENDMAIL=/usr/sbin/sendmail \
78 --with-jobdir=/var/spool/atd \
79 --with-atspool=/var/spool/atd \
80 --with-daemon_username=daemon \
81 --with-daemon_groupname=daemon \
82 --build="$(cc -dumpmachine)"
85 make -j${jobs} IROOT="$destdir" install
87 # Clean up installed file
88 rm -f "${destdir}/var/spool/atd/.SEQ"
90 # Set permissions for the spool directory
91 chmod 770 "${destdir}/var/spool/atd"
93 # Install atd perp service(s)
95 mkdir -p "${destdir}/etc/perp/atd"
97 cp -p "${worktree}/archive/at/rc.log" \
98 "${worktree}/archive/at/rc.main" \
99 "${destdir}/etc/perp/atd/"
101 chmod 755 "${destdir}"/etc/perp/atd/rc.*
103 # THIS SERVICE IS DISABLED BY DEFAULT
104 chmod -t "${destdir}/etc/perp/atd"
106 # Manage (dot) new files via graft(1)
107 touch "${destdir}/etc/.graft-config" \
108 "${destdir}/etc/perp/atd/.graft-config"
110 # Compress and link man pages (if needed)
111 if test -d "${destdir}/$mandir"
114 cd "${destdir}/$mandir"
115 find . -type f -exec lzip -9 '{}' +
116 find . -type l | while read -r file
118 ln -sf "$(readlink -- "$file").lz" "${file}.lz"