void-packages/srcpkgs/nvme-cli/template
Đoàn Trần Công Danh 65749575ab srcpkgs/n*: 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

29 lines
994 B
Bash

# Template file for 'nvme-cli'
pkgname=nvme-cli
version=1.13
revision=2
build_style=gnu-makefile
# yeah, it must be 0 to enable
make_build_args="LIBUUID=0"
make_install_args="SBINDIR=/usr/bin UDEVDIR=/usr/lib/udev"
make_install_target="install-spec"
makedepends="libuuid-devel"
short_desc="NVMe management command line interface"
maintainer="Peter Froehlich <peter.hans.froehlich@gmail.com>"
license="GPL-2.0-only"
homepage="http://nvmexpress.org"
distfiles="https://github.com/linux-nvme/nvme-cli/archive/v${version}.tar.gz"
checksum=03f4875f3e68d326b0280e16df2f027ca6b086cfa148c34e8569df61319b4b85
conf_files="/etc/nvme/*.conf"
post_install() {
# these files are touch'd by install, remove so they aren't registered
# by the package (which would cause trouble during removal)
rm -f "${DESTDIR}/etc/nvme/hostnqn"
rm -f "${DESTDIR}/etc/nvme/hostid"
rm -rf "${DESTDIR}/etc/udev/rules.d"
rm -f "${DESTDIR}/usr/sbin/nvme"
# no need for systemd files
rm -rf "${DESTDIR}/usr/lib/systemd"
}