Start mass upgrade
[dragora.git] / recipes / daemons / sysklogd / recipe
blob863da67907f1d6c4cf474193db2757ecf117ff05
1 # Build recipe for sysklogd.
3 # Copyright (c) 2021-2022 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 # Exit immediately on any error
18 set -e
20 program=sysklogd
21 version=2.3.0
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=daemons
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://github.com/troglobit/sysklogd/releases/download/v${version}/$tarname
32 description="
33 Logging system.
35 The sysklogd package contains programs for logging system messages,
36 such as those given by the kernel when unusual things happen.
39 homepage=https://github.com/troglobit/sysklogd
40 license="BSD 3-clause"
42 # Source documentation
43 docsdir="${docdir}/${program}-${version}"
45 build()
47     unpack "${tardir}/$tarname"
49     cd "$srcdir"
51     # Set sane permissions
52     chmod -R u+w,go-w,a+rX-s .
54     ./configure CPPFLAGS="$QICPPFLAGS" \
55     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
56      $configure_args \
57      --libdir=/usr/lib${libSuffix} \
58      --mandir=$mandir \
59      --docdir=$docsdir \
60      --without-logger \
61      --build="$(gcc -dumpmachine)"
63     make -j${jobs} V=1
64     make -j${jobs} DESTDIR="$destdir" install
66     # Set up configuration file
68     mkdir -p "${destdir}/etc/syslog.d"
69     cp -p "${worktree}/archive/sysklogd/syslog.conf" "${destdir}/etc"
70     chmod 644 "${destdir}/etc/syslog.conf"
72     # Set up file for logrotate
74     mkdir -p "${destdir}/etc/logrotate.d"
75     cp -p "${worktree}/archive/sysklogd/syslogd.logrotate" \
76           "${destdir}/etc/logrotate.d"
77     chmod 644 "${destdir}/etc/logrotate.d/syslogd.logrotate"
79     # Install inetd perp service
81     mkdir -p "${destdir}/etc/perp/syslogd"
83     cp -p "${worktree}/archive/sysklogd/rc.log" \
84           "${worktree}/archive/sysklogd/rc.main" \
85           "${destdir}/etc/perp/syslogd/"
87     chmod 755 "${destdir}"/etc/perp/syslogd/rc.*
89     # THIS SERVICE IS ENABLED BY DEFAULT
90     chmod +t "${destdir}/etc/perp/syslogd"
92     # To handle dot .new file(s)
93     touch "${destdir}/etc/.graft-config" \
94           "${destdir}/etc/logrotate.d/.graft-config" \
95           "${destdir}/etc/perp/syslogd/.graft-config"
97     # Compress and link man pages (if needed)
98     if test -d "${destdir}/$mandir"
99     then
100         (
101             cd "${destdir}/$mandir"
102             find . -type f -exec lzip -9 {} +
103             find . -type l | while read -r file
104             do
105                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
106                 rm -- "$file"
107             done
108         )
109     fi