void-packages/srcpkgs/kexec-tools/template
Đoàn Trần Công Danh dd9d4a1979 srcpkgs/k*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

36 lines
1.1 KiB
Bash

# Template file for 'kexec-tools'
pkgname=kexec-tools
version=2.0.22
revision=1
create_wrksrc=yes
build_style=gnu-configure
hostmakedepends="tar xz"
makedepends="zlib-devel liblzma-devel"
short_desc="Tools to support fast kexec reboots"
maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
license="GPL-2.0-only"
homepage="http://kernel.org/pub/linux/utils/kernel/kexec/"
distfiles="${KERNEL_SITE}/utils/kernel/kexec/${pkgname}-${version}.tar.xz"
checksum=96c97f49ed86049f8b72722cb53e7fe3693e5a4f31e78a3a6249e3d18dac49c2
skip_extraction="${pkgname}-${version}.tar.xz"
CFLAGS="-fcommon"
case "$XBPS_TARGET_MACHINE" in
ppc-musl) nopie=yes;; # textrels not supported
esac
do_extract() {
# bsdtar fails to extract version 2.0.20 tarball which
# contains (buggy) hard links from files to themselves.
tar --strip-components 1 --no-same-owner --extract --file \
${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname}-${version}.tar.xz \
--directory ${wrksrc}
}
pre_build() {
rm ${XBPS_WRAPPERDIR}/strip
case "$XBPS_TARGET_MACHINE" in
i686*) vsed -i '/compat_x86_64.S/d' purgatory/arch/i386/Makefile;;
esac
}