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
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.xz
31 https://github.com/slicer69/sysvinit/releases/download/${version}/$tarname
32 https://download.savannah.nongnu.org/releases/sysvinit/$tarname
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
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}"
56 unpack "${tardir}/$tarname"
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"
81 cd "${destdir}/$mandir"
82 find . -type f -exec lzip -9 {} +
83 find . -type l | while read -r file
85 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
92 mkdir -p "${destdir}/$docsdir"
93 cp -p $docs "${destdir}/$docsdir"