void-packages/srcpkgs/masterpassword-cli/template
Đoàn Trần Công Danh 765e304c4b srcpkgs/m*: 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

36 lines
1.2 KiB
Bash

# Template file for 'masterpassword-cli'
pkgname=masterpassword-cli
version=2.6
revision=6
wrksrc=MasterPassword-${version}-cli-3
build_wrksrc=platform-independent/cli-c
build_style=cmake
cmake_builddir=cmake
hostmakedepends="libsodium-devel json-c-devel ncurses-devel"
makedepends="libsodium-devel json-c-devel ncurses-devel"
short_desc="CLI version of Master Password"
maintainer="SolitudeSF <solitudesf@protonmail.com>"
license="GPL-3.0-or-later, Apache-1.0, ISC, BSD-4-Clause"
homepage="https://ssl.masterpasswordapp.com/"
distfiles="https://github.com/Lyndir/MasterPassword/archive/${version}-cli-3.tar.gz"
checksum=35dc64bc74c04b534824c21da96e4a10fc7978da376fcc036d7ec08fd800ab7a
# Apache-1.0 is incompatible with GPL-3+
restricted=yes
pre_configure() {
echo "${version}-cli" > ${wrksrc}/${build_wrksrc}/VERSION
}
do_install() {
cat mpw.completion.bash | tail -n +3 >> bashcomplib
vinstall bashcomplib 644 usr/share/bash-completion/completions mpw
vbin ${cmake_builddir}/mpw
sed -n '5,31p' cli/blf.h >blowfish.4BSD
vlicense blowfish.4BSD
sed -n '4,17p' cli/bcrypt.h >bcrypt.ISC
vlicense bcrypt.ISC
head -55 core/base64.c >base64.license
vlicense base64.license
}