move /sbin to /usr/sbin

use rpm macros in install rules
This commit is contained in:
Chris Leech 2013-09-15 10:13:03 -07:00
parent 31786f0fda
commit 974636d303

View File

@ -4,7 +4,7 @@
Summary: iSCSI daemon and utility programs Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils Name: iscsi-initiator-utils
Version: 6.%{open_iscsi_version}.%{open_iscsi_build} Version: 6.%{open_iscsi_version}.%{open_iscsi_build}
Release: 14%{?dist} Release: 15%{?dist}
Group: System Environment/Daemons Group: System Environment/Daemons
License: GPLv2+ License: GPLv2+
URL: http://www.open-iscsi.org URL: http://www.open-iscsi.org
@ -147,20 +147,22 @@ developing applications that use %{name}.
# version string # version string
%patch99 -p1 %patch99 -p1
# change exec_prefix, there's no easy way to override
%{__sed} -i -e 's|^exec_prefix = /$|exec_prefix = %{_exec_prefix}|' Makefile
%build %build
# configure sub-packages from here # configure sub-packages from here
# letting the top level Makefile do it will lose setting from rpm # letting the top level Makefile do it will lose setting from rpm
cd iscsiuio cd iscsiuio
chmod +x configure %{__chmod} +x configure
%{configure} %{configure}
cd .. cd ..
cd utils/open-isns cd utils/open-isns
%{configure} %{configure}
cd ../.. cd ../..
make OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod" %{__make} OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod"
pushd libiscsi pushd libiscsi
python setup.py build python setup.py build
touch -r libiscsi.doxy html/* touch -r libiscsi.doxy html/*
@ -168,53 +170,53 @@ popd
%install %install
make DESTDIR=%{?buildroot} install_programs install_doc install_etc %{__make} DESTDIR=%{?buildroot} install_programs install_doc install_etc
# upstream makefile doesn't get everything the way we like it # upstream makefile doesn't get everything the way we like it
rm $RPM_BUILD_ROOT/sbin/iscsi_discovery rm $RPM_BUILD_ROOT%{_sbindir}/iscsi_discovery
rm $RPM_BUILD_ROOT%{_mandir}/man8/iscsi_discovery.8 rm $RPM_BUILD_ROOT%{_mandir}/man8/iscsi_discovery.8
install -pm 755 usr/iscsistart $RPM_BUILD_ROOT/sbin %{__install} -pm 755 usr/iscsistart $RPM_BUILD_ROOT%{_sbindir}
install -pm 644 doc/iscsistart.8 $RPM_BUILD_ROOT%{_mandir}/man8 %{__install} -pm 644 doc/iscsistart.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -pm 644 doc/iscsi-iname.8 $RPM_BUILD_ROOT%{_mandir}/man8 %{__install} -pm 644 doc/iscsi-iname.8 $RPM_BUILD_ROOT%{_mandir}/man8
install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d %{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -pm 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d %{__install} -pm 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/nodes %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/nodes
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/send_targets %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/send_targets
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/static %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/static
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/isns %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/isns
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/slp %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/slp
install -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/ifaces %{__install} -d $RPM_BUILD_ROOT%{_sharedstatedir}/iscsi/ifaces
# for %%ghost # for %%ghost
install -d $RPM_BUILD_ROOT/var/lock/iscsi %{__install} -d $RPM_BUILD_ROOT/var/lock/iscsi
touch $RPM_BUILD_ROOT/var/lock/iscsi/lock touch $RPM_BUILD_ROOT/var/lock/iscsi/lock
install -d $RPM_BUILD_ROOT%{_unitdir} %{__install} -d $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir}
install -pm 644 etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{_unitdir} %{__install} -pm 644 etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{_unitdir}
install -d $RPM_BUILD_ROOT%{_libexecdir} %{__install} -d $RPM_BUILD_ROOT%{_libexecdir}
install -pm 755 etc/systemd/iscsi-mark-root-nodes $RPM_BUILD_ROOT%{_libexecdir} %{__install} -pm 755 etc/systemd/iscsi-mark-root-nodes $RPM_BUILD_ROOT%{_libexecdir}
install -d $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d %{__install} -d $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
install -pm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d %{__install} -pm 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
install -d $RPM_BUILD_ROOT%{_tmpfilesdir} %{__install} -d $RPM_BUILD_ROOT%{_tmpfilesdir}
install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_tmpfilesdir}/iscsi.conf %{__install} -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_tmpfilesdir}/iscsi.conf
install -d $RPM_BUILD_ROOT%{_libdir} %{__install} -d $RPM_BUILD_ROOT%{_libdir}
install -pm 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir} %{__install} -pm 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}
ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so %{__ln_s} libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so
install -d $RPM_BUILD_ROOT%{_includedir} %{__install} -d $RPM_BUILD_ROOT%{_includedir}
install -pm 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir} %{__install} -pm 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir}
install -d $RPM_BUILD_ROOT%{python_sitearch} %{__install} -d $RPM_BUILD_ROOT%{python_sitearch}
install -pm 755 libiscsi/build/lib.linux-*/libiscsimodule.so \ %{__install} -pm 755 libiscsi/build/lib.linux-*/libiscsimodule.so \
$RPM_BUILD_ROOT%{python_sitearch} $RPM_BUILD_ROOT%{python_sitearch}
@ -225,7 +227,7 @@ install -pm 755 libiscsi/build/lib.linux-*/libiscsimodule.so \
if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then
echo "InitiatorName=`/sbin/iscsi-iname`" > %{_sysconfdir}/iscsi/initiatorname.iscsi echo "InitiatorName=`/usr/sbin/iscsi-iname`" > %{_sysconfdir}/iscsi/initiatorname.iscsi
fi fi
# enable socket activation and persistant session startup by default # enable socket activation and persistant session startup by default
/bin/systemctl enable iscsi.service >/dev/null 2>&1 || : /bin/systemctl enable iscsi.service >/dev/null 2>&1 || :
@ -279,7 +281,7 @@ fi
%{_tmpfilesdir}/iscsi.conf %{_tmpfilesdir}/iscsi.conf
%dir %{_sysconfdir}/iscsi %dir %{_sysconfdir}/iscsi
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf
/sbin/* %{_sbindir}/*
%{_libdir}/libiscsi.so.0 %{_libdir}/libiscsi.so.0
%{python_sitearch}/libiscsimodule.so %{python_sitearch}/libiscsimodule.so
%{_mandir}/man8/* %{_mandir}/man8/*
@ -291,6 +293,10 @@ fi
%{_includedir}/libiscsi.h %{_includedir}/libiscsi.h
%changelog %changelog
* Sun Sep 15 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-15
- move /sbin to /usr/sbin
- use rpm macros in install rules
* Fri Sep 13 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-14 * Fri Sep 13 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-14
- fix iscsiuio hardened build and other compiler flags - fix iscsiuio hardened build and other compiler flags