void-packages/srcpkgs/dracut-crypt-ssh/template
Đoàn Trần Công Danh b6bcd8cd34 srcpkgs/d*: convert patches to -Np1
* daemontools and dmraid is kept at -Np0

```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
1.1 KiB
Bash

# Template file for 'dracut-crypt-ssh'
pkgname=dracut-crypt-ssh
version=1.0.7
revision=3
build_style=gnu-configure
hostmakedepends="dracut which"
makedepends="libblkid-devel"
depends="dracut-network dropbear openssh"
short_desc="New initramfs infrastructure - enter LUKS passphrase remotely"
maintainer="tastytea <tastytea@tastytea.de>"
license="GPL-2.0-or-later"
homepage="https://github.com/dracut-crypt-ssh/dracut-crypt-ssh"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=c50b57b16d4aea3707e1f3e86777fafdb1b3551f2f4b6c4de5576eeb3b2f6bbc
pre_configure() {
sed -i '111s/^/#/' configure
sed -i 's/gcc -lblkid/gcc -lblkid $(CFLAGS)/' modules/60crypt-ssh/helper/Makefile
sed -i 's/gcc/$(CC)/' modules/60crypt-ssh/helper/Makefile
sed -i "s|CFLAGS=|CFLAGS=${CFLAGS} ${LDFLAGS} |" modules/60crypt-ssh/helper/Makefile
sed -i 's|/lib64/libnss_files.so.2||' modules/60crypt-ssh/module-setup.sh
sed -i '107s|$|\n [ -f /lib/libnss_files.so.2 ] \&\& dracut_install /lib/libnss_files.so.2|' \
modules/60crypt-ssh/module-setup.sh
}
post_install() {
vmkdir usr/lib/dracut/dracut.conf.d
mv ${DESTDIR}/etc/dracut.conf.d/* ${DESTDIR}/usr/lib/dracut/dracut.conf.d
}