void-packages/srcpkgs/open-iscsi/template
Đoàn Trần Công Danh 2fd8d4df94 srcpkgs/o*: 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

48 lines
1.7 KiB
Bash

# Template file for 'open-iscsi'
pkgname=open-iscsi
version=2.1.3
revision=2
conf_files="/etc/iscsi/iscsid.conf /etc/iscsi/initiatorname.iscsi"
build_style=gnu-configure
hostmakedepends="automake libtool pkg-config"
makedepends="libisns-devel libkmod-devel libmount-devel openssl-devel"
short_desc="Open-iSCSI userland tools"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
homepage="http://www.open-iscsi.com/"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/${version}.tar.gz"
checksum=5410474b23552016220d04aa181903cb50ae988f29e99cb03f3e2de86a109be4
case "$XBPS_TARGET_MACHINE" in
*-musl) CFLAGS+="-D_LINUX_IF_ETHER_H -Wno-error=format -Wno-error=cpp";;
esac
post_extract() {
sed -i '1i#include <fcntl.h>' usr/idbm.c
sed -i 's/(__compar_fn_t)//' utils/fwparam_ibft/fwparam_ppc.c
sed -i '/CC.*-o/s/$/ $(LDFLAGS)/' utils/Makefile usr/Makefile
sed -i 's/lib64/lib/g' libopeniscsiusr/Makefile
sed -i 's,<linux/if_ether.h>,<netinet/if_ether.h>,g' usr/iscsi_net_util.c
sed -i '1i#include <netinet/if_ether.h>' iscsiuio/src/unix/libs/bnx2x.c libopeniscsiusr/misc.c
}
do_configure() {
( cd iscsiuio && autoreconf -fi && ./configure ${configure_args} CFLAGS="-DNO_SYSTEMD" )
}
do_build() {
make ${makejobs} CC="$CC" \
OPTFLAGS="$CFLAGS $(pkg-config --cflags libkmod) -DNO_SYSTEMD" \
LDFLAGS="$LDFLAGS $(pkg-config --libs libkmod)" NO_SYSTEMD=1
}
do_install() {
make install exec_prefix=/usr sbindir=/usr/bin DESTDIR="$DESTDIR"
vbin usr/iscsistart
for m in doc/*.8; do
vman $m
done
true >${DESTDIR}/etc/iscsi/initiatorname.iscsi
vsconf ${DESTDIR}/etc/iscsi/ifaces/iface.example
rm ${DESTDIR}/etc/iscsi/ifaces/iface.example
sed -i 's,/sbin/iscsid,/usr/bin/iscsid,' ${DESTDIR}/etc/iscsi/iscsid.conf
}