recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / daemons / at / recipe
blob13fa80d635e9dbdad6e5151bfaa8599d12da9f02
1 # Build recipe for at.
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.
17 program=at
18 version=3.2.1
19 release=1
21 # Define a category for the output of the package name
22 pkgcategory=daemons
24 tarname=${program}_${version}.orig.tar.gz
26 # Remote source(s)
27 fetch=http://software.calhariz.com/at/$tarname
29 description="
30 The at package provide delayed job execution and batch processing.
32 It includes:
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
43 license=GPLv2+
45 # The source documentation will be auto-installed
46 docsdir="${docdir}/${program}-${version}"
48 # This source does not support parallel jobs
49 jobs=1
51 build()
53     set -e
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
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 \
75      $configure_args \
76      --mandir=$mandir \
77      --docdir=$docsdir \
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)"
84     make -j${jobs} V=1
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"
112     then
113         (
114             cd "${destdir}/$mandir"
115             find . -type f -exec lzip -9 '{}' +
116             find . -type l | while read -r file
117             do
118                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
119                 rm -- "$file"
120             done
121         )
122     fi