qi: Bump to release 2.12
[dragora.git] / recipes / boot / sysvinit / recipe
bloba00186f794688fa40039d7d31bc7d841b40692b2
1 # Build recipe for sysvinit.
3 # Copyright (c) 2018-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=sysvinit
21 version=3.06
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=boot
27 tarname=${program}-${version}.tar.xz
29 # Remote source(s)
30 fetch="
31  https://github.com/slicer69/sysvinit/releases/download/${version}/$tarname
32  https://download.savannah.nongnu.org/releases/sysvinit/$tarname
35 description="
36 The System V init (version $version).
38 The sysvinit package contains programs for controlling the startup,
39 running, and shutdown of the system.
41 System V init was originally written by Miquel van Smoorenburg.
44 homepage=https://savannah.nongnu.org/projects/sysvinit
45 license=GPLv2+
47 # Source documentation
48 docs="COPYING COPYRIGHT README doc/Changelog doc/Propaganda"
49 docsdir="${docdir}/${program}"
51 # Limit package name to the program name
52 full_pkgname="${program}@${pkgcategory}"
54 build()
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     # Adjust some (rc) script paths for Dragora 3+
64     patch -p0 < "${worktree}/patches/sysvinit/sysvinit-adjust_paths.h.diff"
66     # Remove several programs installed by other packages
67     patch -p1 < "${worktree}/patches/sysvinit/sysvinit-3.06-dragora_consolidated-1.patch"
69     make -j${jobs} CPPFLAGS="$QICPPFLAGS -D_FORTIFY_SOURCE=1" CFLAGS="$QICFLAGS" STATIC="-static"
70     make -j${jobs} ROOT="$destdir" install
72     strip --strip-unneeded "${destdir}/sbin"/* 2> /dev/null || true
74     # Remove empty directories
75     rmdir "${destdir}/bin" "${destdir}/usr/bin" || true
77     # Compress and link man pages (if needed)
78     if test -d "${destdir}/$mandir"
79     then
80         (
81             cd "${destdir}/$mandir"
82             find . -type f -exec lzip -9 {} +
83             find . -type l | while read -r file
84             do
85                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
86                 rm -- "$file"
87             done
88         )
89     fi
91     # Copy documentation
92     mkdir -p "${destdir}/$docsdir"
93     cp -p $docs "${destdir}/$docsdir"