void-packages/srcpkgs/keyutils/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

48 lines
1.3 KiB
Bash

# Template file for 'keyutils'
pkgname=keyutils
version=1.6.3
revision=1
short_desc="Linux Key Management Utilities"
maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://www.kernel.org"
distfiles="https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/snapshot/${pkgname}-${version}.tar.gz"
checksum=a61d5706136ae4c05bd48f86186bcfdbd88dd8bd5107e3e195c924cfc1b39bb4
conf_files="/etc/request-key.conf"
pre_build() {
# Fix musl build - doesn't hurt glibc either
sed -e "/#include <stdlib.h>/a #include <limits.h>" \
-i key.dns_resolver.c
}
do_build() {
make CFLAGS="${CFLAGS} -fPIC" LDFLAGS="${LDFLAGS}" SBINDIR='/usr/bin' \
LIBDIR='/usr/lib' USRLIBDIR='/usr/lib' \
BINDIR='/usr/bin' ${makejobs}
}
do_install() {
make DESTDIR=${DESTDIR} CFLAGS="${CFLAGS} -fPIC" LDFLAGS="${LDFLAGS}" \
LIBDIR='/usr/lib' USRLIBDIR='/usr/lib' SBINDIR='/usr/bin' \
BINDIR='/usr/bin' install
}
libkeyutils_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove "usr/lib/*.so.*"
}
}
keyutils-devel_package() {
depends="libkeyutils>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/*.so"
vmove usr/share/man/man3
vmove usr/lib/pkgconfig
}
}