void-packages/srcpkgs/sloccount/template
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: 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

22 lines
699 B
Bash

# Template file for 'sloccount'
pkgname=sloccount
version=2.26
revision=5
build_style=gnu-makefile
hostmakedepends="flex"
makedepends="perl"
depends="perl"
short_desc="Tool to count physical source lines of code in many languages"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://dwheeler.com/sloccount/"
distfiles="https://dwheeler.com/sloccount/sloccount-${version}.tar.gz"
checksum=fa7fa2bbf2f627dd2d0fdb958bd8ec4527231254c120a8b4322405d8a4e3d12b
do_install() {
vmkdir usr/bin
make PREFIX=${DESTDIR}/usr install
mv ${DESTDIR}/usr/share/doc/${pkgname}-${version}-1 ${DESTDIR}/usr/share/doc/${pkgname}
chmod 644 ${DESTDIR}/usr/share/doc/${pkgname}/*
}