void-packages/srcpkgs/cpulimit/template
Đoàn Trần Công Danh c987560802 srcpkgs/c*: 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

21 lines
583 B
Bash

# Template file for 'cpulimit'
pkgname=cpulimit
version=0.2
revision=3
build_style=gnu-makefile
short_desc="Tool to limit the CPU usage of a process"
maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
license="GPL-2.0-or-later"
homepage="https://github.com/opsengine/cpulimit"
distfiles="https://github.com/opsengine/${pkgname}/archive/v${version}.tar.gz"
checksum=64312f9ac569ddcadb615593cd002c94b76e93a0d4625d3ce1abb49e08e2c2da
pre_build() {
export CFLAGS="$CFLAGS $LDFLAGS"
vsed -i -e "s;<sys/sysctl.h>;<linux/sysctl.h>;" src/cpulimit.c
}
do_install() {
vbin src/cpulimit
}