stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / recipes / boot / efivar / recipe
blob343182b8bac9b88c81abbd964bb433c22309d25e
1 # Recipe file for efivar.
3 # Copyright (c) 2022 DustDFG, <dfgdust@gmail.com>.
4 # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 #    http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
19 set -e
21 program=efivar
22 version=20220927_dd901c1
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=boot
28 description="
29 Tools and libraries to work with EFI variables.
31 The efivar package provides a simple command-line interface to
32 the UEFI variable facility.
35 homepage=https://github.com/rhboot/efivar/
36 license=LGPLv2.1+
38 tarname=${program}-${version}.tar.lz
40 # Remote source(s)
41 #fetch=https://github.com/rhboot/efivar/releases/download/${version}/$tarname
42 fetch="
43  https://dragora.mirror.garr.it/current/sources/$tarname
44  rsync://rsync.dragora.org/current/sources/$tarname
47 # Source documentation
48 docs="COPYING TODO README.md"
49 docsdir="${docdir}/${program}-${version}"
51 build() {
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     # Apply patches
61 #    patch -Np1 -i "${worktree}/patches/efivar/efivar-efisecdb-atexit.patch"
62     patch -Np1 -i "${worktree}/patches/efivar/efivar-mandoc-groff.patch"
64     make -j${jobs} V=1 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBDIR="/usr/lib${libSuffix}" MANDIR="$mandir"
65     make -j${jobs} DESTDIR="$destdir" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LIBDIR="/usr/lib${libSuffix}" MANDIR="$mandir" install
67     # Compress and link man pages (if needed)
68     if test -d "${destdir}/$mandir"
69     then
70         (
71             cd "${destdir}/$mandir"
72             find . -type f -exec lzip -9 {} +
73             find . -type l | while read -r file
74             do
75                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
76                 rm -- "$file"
77             done
78         )
79     fi
81     # Copy documentation
82     mkdir -p "${destdir}/$docsdir"
83     cp -p $docs "${destdir}/$docsdir"