From 535c716da4fbd4a83244ca20003a58eee2c64894 Mon Sep 17 00:00:00 2001 From: Qiang Wei Date: Fri, 9 Dec 2022 14:19:40 +0800 Subject: [PATCH] Rename controll compile variable name Signed-off-by: Qiang Wei (cherry picked from commit cfe7581a76ede901297678734c85df59a805da9a) --- scsi-target-utils.spec | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/scsi-target-utils.spec b/scsi-target-utils.spec index f5fa270..9b72c32 100644 --- a/scsi-target-utils.spec +++ b/scsi-target-utils.spec @@ -1,12 +1,13 @@ +%bcond_without rbd +%bcond_without rdma +%bcond_without gluster + %global oname tgt -%global with_rdma 1 -%global with_rbd 1 -%global with_glfs 1 Summary: The SCSI target daemon and utility programs Name: scsi-target-utils Version: 1.0.79 -Release: 4 +Release: 5 License: GPLv2 URL: http://stgt.sourceforge.net/ Source0: https://github.com/fujita/tgt/archive/v%{version}/tgt-v%{version}.tar.gz @@ -22,7 +23,7 @@ Patch3: tgt-1.0.79-Adapt-to-glusterfs-api-7.6.3.patch BuildRequires: docbook-style-xsl gcc libaio-devel libxslt perl-generators pkgconfig systemd-devel systemd-units BuildRequires: libgfapi0 BuildRequires: chrpath -%if 0%{?with_rdma} +%if %{with rdma} BuildRequires: libibverbs-devel librdmacm-devel Requires: libibverbs librdmacm %endif @@ -33,7 +34,7 @@ Requires(post): systemd-units The SCSI target package contains the daemon and tools to setup a SCSI targets. Currently, software iSCSI targets are supported. -%if 0%{?with_rbd} +%if %{with rbd} %package rbd Summary: Support for the Ceph rbd backstore to scsi-target-utils BuildRequires: librbd-devel @@ -43,7 +44,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Adds support for the Ceph rbd backstore to scsi-target-utils. %endif -%if 0%{?with_glfs} +%if %{with gluster} %package gluster Summary: Support for the Gluster backstore to scsi-target-utils BuildRequires: glusterfs-api-devel @@ -60,7 +61,12 @@ Adds support for the Gluster glfs backstore to scsi-target-utils. %build %{__sed} -i -e 's|-g -O2 -fno-strict-aliasing|%{optflags} -fcommon|' -e 's| -Werror | |' usr/Makefile -%{__make} %{?_smp_mflags} %{?with_rdma:ISCSI_RDMA=1} %{?with_rbd:CEPH_RBD=1} %{?with_glfs:GLFS_BD=1} SD_NOTIFY=1 libdir=%{_libdir}/tgt +%{__make} %{?_smp_mflags} \ + %{?with_rdma:ISCSI_RDMA=1} \ + %{?with_rbd:CEPH_RBD=1} \ + %{?with_gluster:GLFS_BD=1} \ + SD_NOTIFY=1 \ + libdir=%{_libdir}/tgt %install install -D -p -m 0755 scripts/tgt-setup-lun %{buildroot}%{_sbindir}/tgt-setup-lun @@ -76,7 +82,15 @@ install -D -p -m 0600 %{SOURCE4} %{buildroot}%{_sysconfdir}/tgt/conf.d/sample.co install -p -m 0600 %{SOURCE5} %{buildroot}%{_sysconfdir}/tgt/tgtd.conf pushd usr -%{__make} install %{?with_rdma:ISCSI_RDMA=1} %{?with_rbd:CEPH_RBD=1} %{?with_glfs:GLFS_BD=1} SD_NOTIFY=1 DESTDIR=%{buildroot} sbindir=%{_sbindir} libdir=%{_libdir}/tgt +%{__make} install \ + %{?with_rdma:ISCSI_RDMA=1} \ + %{?with_rbd:CEPH_RBD=1} \ + %{?with_gluster:GLFS_BD=1} \ + SD_NOTIFY=1 \ + DESTDIR=%{buildroot} \ + sbindir=%{_sbindir} \ + libdir=%{_libdir}/tgt + chrpath -d %{buildroot}/%{_sbindir}/tgtd mkdir -p %{buildroot}/etc/ld.so.conf.d echo "%{_sbindir}/tgtd" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf @@ -107,13 +121,13 @@ echo "%{_sbindir}/tgtd" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/tgt/tgtd.conf %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/tgt/conf.d/sample.conf -%if 0%{?with_rbd} +%if %{with rbd} %files rbd %{_libdir}/tgt/backing-store/bs_rbd.so %doc doc/README.rbd %endif -%if 0%{?with_glfs} +%if %{with gluster} %files gluster %{_libdir}/tgt/backing-store/bs_glfs.so %doc doc/README.glfs @@ -124,6 +138,9 @@ echo "%{_sbindir}/tgtd" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf %{_mandir}/man8/* %changelog +* Fri Dec 9 2022 Qiang Wei - 1.0.79-5 +- Make Ceph rbd, rdma, glusterfs support optional + * Fri Mar 4 2022 xigaoxinyan - 1.0.79-4 - Remove rpath