65 lines
2.1 KiB
Bash
65 lines
2.1 KiB
Bash
# Template file for 'sbsigntool'
|
|
pkgname=sbsigntool
|
|
version=0.9.4
|
|
revision=3
|
|
archs="x86_64* i686* aarch64* arm*"
|
|
wrksrc=sbsigntools-$version
|
|
build_style=gnu-configure
|
|
hostmakedepends="autoconf automake pkg-config help2man"
|
|
makedepends="binutils-devel libressl-devel libuuid-devel gnu-efi-libs"
|
|
short_desc="Signing utility for UEFI secure boot"
|
|
maintainer="Đoàn Trần Công Danh <congdanhqx@gmail.com>"
|
|
license="GPL-3.0-or-later"
|
|
homepage="https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/"
|
|
# sbsigntool depends on ccan, pull it from old release
|
|
# Pull from https://git.ozlabs.org/?p=ccan;a=snapshot;h=b1f28e17;sf=tgz
|
|
# is OK if you'd like to resolve cross-compile issues.
|
|
# I don't want to waste time on that.
|
|
distfiles="$homepage/snapshot/sbsigntools-$version.tar.gz
|
|
$DEBIAN_SITE/main/s/sbsigntool/sbsigntool_0.9.2.orig.tar.gz"
|
|
checksum="eddb7d21263ee2b07be8f0ed93b6ba021c3f943964730b2d86f44736fa1924d5
|
|
1dc1e1de5f2dda50dbd2e6a83355fe7ae38ca0f79daeb404026421af70606653"
|
|
patch_args="-Np1"
|
|
skip_extraction="sbsigntool_0.9.2.orig.tar.gz"
|
|
conf_files="/etc/default/sbsigntool-kernel-hook"
|
|
|
|
post_extract() {
|
|
bsdtar -xzf $XBPS_SRCDISTDIR/$pkgname-$version/sbsigntool_0.9.2.orig.tar.gz
|
|
mv sbsigntool-0.9.2/lib/ccan lib
|
|
}
|
|
|
|
post_patch() {
|
|
[ ! "$CROSS_BUILD" ] && return
|
|
|
|
case "${XBPS_TARGET_MACHINE}" in
|
|
arm*) _ARCH=arm ;;
|
|
i686*) _ARCH=ia32 ;;
|
|
*) _ARCH="${XBPS_TARGET_MACHINE%-musl}" ;;
|
|
esac
|
|
vsed -i -e "/^EFI_ARCH=/s/=.*/=${_ARCH}/" \
|
|
-e "/^for path in .*lib/s,in ,in ${XBPS_CROSS_BASE}/usr/lib ," \
|
|
-e "/^EFI_CPPFLAGS=/s,I\(/usr/include\),I${XBPS_CROSS_BASE}\1,g" \
|
|
configure.ac
|
|
vsed -i -e "/^man/s/=.*/=/" docs/Makefile.am
|
|
}
|
|
|
|
pre_configure() {
|
|
touch AUTHORS ChangeLog
|
|
aclocal
|
|
autoheader
|
|
autoconf
|
|
automake --add-missing -Wno-portability
|
|
}
|
|
|
|
post_install() {
|
|
vmkdir etc/
|
|
vinstall "${FILESDIR}/sbsigntool-kernel-hook.conf" 644 \
|
|
etc/default sbsigntool-kernel-hook
|
|
# grub is 50, I don't use grub
|
|
# and I'm not sure about their interaction
|
|
vinstall ${FILESDIR}/kernel.d/sbsigntool.post-install 744 \
|
|
etc/kernel.d/post-install 40-sbsigntool
|
|
vinstall ${FILESDIR}/kernel.d/sbsigntool.post-remove 744 \
|
|
etc/kernel.d/post-remove 40-sbsigntool
|
|
}
|