void-packages/srcpkgs/libgsm/template
Đoàn Trần Công Danh 861ac185a6 srcpkgs/l*: 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

47 lines
1.1 KiB
Bash

# Template file for 'libgsm'
pkgname=libgsm
version=1.0.18
revision=1
wrksrc="gsm-1.0-pl18"
homepage="http://www.quut.com/gsm/"
distfiles="http://www.quut.com/gsm/gsm-${version}.tar.gz"
short_desc="GSM 06.10 lossy speech compression"
maintainer="Orphaned <orphan@voidlinux.org>"
license="custom"
checksum=04f68087c3348bf156b78d59f4d8aff545da7f6e14f33be8f47d33f4efae2a10
do_build() {
make CC=$CC LD=$CC AR=$AR CCFLAGS="$CFLAGS -c -DNeedFunctionPrototypes=1"
}
do_install() {
vmkdir usr/bin
vmkdir usr/lib
vmkdir usr/include/gsm
vmkdir usr/share/man/man3
vmkdir usr/share/man/man1
install -m755 bin/* ${DESTDIR}/usr/bin
install -m644 lib/*.a ${DESTDIR}/usr/lib
install -m644 inc/* ${DESTDIR}/usr/include/gsm
vinstall lib/libgsm.so.1.0.13 755 usr/lib
vcopy lib/libgsm.so usr/lib
vcopy lib/libgsm.so.1 usr/lib
rm -f ${DESTDIR}/usr/include/gsm/*.orig
ln -sfr ${DESTDIR}/usr/include/gsm/gsm.h ${DESTDIR}/usr/include/gsm.h
vlicense COPYRIGHT
}
libgsm-devel_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/*.a
vmove usr/lib/*.so
}
}