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

35 lines
1.1 KiB
Bash

# Template file for 'tgt'
pkgname=tgt
version=1.0.80
revision=1
build_style=gnu-makefile
make_install_args="sbindir=/usr/bin"
conf_files="/etc/tgt/targets.conf"
make_dirs="/etc/tgt/conf.d 0755 root root"
hostmakedepends="libxslt docbook-xsl"
depends="perl-Config-General"
short_desc="Linux SCSI target framework"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-only"
homepage="http://stgt.sourceforge.net/"
distfiles="https://github.com/fujita/tgt/archive/v${version}.tar.gz"
checksum=e2255482f1a2797c115a6d545c37428b10a4ba6276a2af787da5378fa4e34e75
post_extract() {
sed -i 's/CFLAGS/MYCFLAGS/; s/\$(MYCFLAGS)/& $(CFLAGS) -Wno-error=stringop-truncation/g' usr/Makefile
sed -i '/^LDFLAGS/d; /CC.*-o/s/$/ $(LDFLAGS)/' usr/Makefile
sed -i '1i#include <sys/user.h>' usr/tgtd.h usr/util.h
sed -i '1i#include <fcntl.h>' usr/libssc.c
sed -i '1i#include <sys/sysmacros.h>' usr/bs_sg.c
sed -i 's/__always_inline/inline/g' usr/util.h
}
post_install() {
for f in ${DESTDIR}/etc/tgt/examples/*; do
vsconf $f
rm $f
done
vman doc/manpages/targets.conf.5
rm -rf ${DESTDIR}/usr/share/doc/tgt/html
}