void-packages/srcpkgs/open-iscsi/template

59 lines
1.9 KiB
Bash

# Template file for 'open-iscsi'
pkgname=open-iscsi
version=2.1.10
revision=1
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/open-iscsi/open-iscsi/archive/${version}.tar.gz"
checksum=12c19f65f9136b87ac11bf5bbe5eb3e23de4e7f1ee07eecda830da53a2316113
case "$XBPS_TARGET_MACHINE" in
*-musl) CFLAGS+=" -DGLOB_ONLYDIR=0 -D_LINUX_IF_ETHER_H";;
esac
post_extract() {
vsed -i -e '/CC.*-o/s/$/ $(LDFLAGS)/' utils/Makefile usr/Makefile
vsed -i -e 's/lib64/lib/g' libopeniscsiusr/Makefile
vsed -i -e 's,<linux/if_ether.h>,<netinet/if_ether.h>,g' usr/iscsi_net_util.c
vsed -i -e '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" \
WARNFLAGS="-Wall -Wextra -Wstrict-prototypes -fno-common" \
OPTFLAGS="$CFLAGS $(pkg-config --cflags libkmod) -pthread -DNO_SYSTEMD" \
LDFLAGS="$LDFLAGS $(pkg-config --libs libkmod) -pthread" NO_SYSTEMD=1
}
do_install() {
make install exec_prefix=/usr SBINDIR=/usr/bin RULESDIR=/usr/lib/udev/rules.d DESTDIR="$DESTDIR"
vsv iscsid
rm -rf ${DESTDIR}/usr/lib/systemd
true >${DESTDIR}/etc/iscsi/initiatorname.iscsi
vsconf ${DESTDIR}/etc/iscsi/ifaces/iface.example
rm ${DESTDIR}/etc/iscsi/ifaces/iface.example
}
open-iscsi-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/*.so
vmove usr/lib/pkgconfig
vmove usr/share/man/man3
}
}