[isns-utils/f18] Rebase to 0.93 Make use of systemd rpm macros for scriptlets, BZ 850174

Chris Leech cleech at fedoraproject.org
Mon Sep 10 21:04:33 UTC 2012


commit bca8ecb45345486f8728993bba8e889b4ee64854
Author: Chris Leech <cleech at redhat.com>
Date:   Mon Sep 10 13:27:13 2012 -0700

    Rebase to 0.93
    Make use of systemd rpm macros for scriptlets, BZ 850174

 .gitignore                                        |    2 +-
 isns-utils-fix-non-utf8-chars-in-copying.patch    |   20 --------
 isns-utils-include-limits.patch                   |   33 -------------
 isns-utils-turn-default-dd-on-to-match-msft.patch |   13 -----
 isns-utils-update-isnsadm-man.patch               |   12 -----
 isns-utils.spec                                   |   52 +++++----------------
 isnsd.init                                        |   16 +++++-
 sources                                           |    2 +-
 8 files changed, 27 insertions(+), 123 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 8a142b4..aa54d0c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-open-isns-0.91.tar.bz2
+open-isns-0.93.tar.bz2
diff --git a/isns-utils.spec b/isns-utils.spec
index e2bcad5..dfcebd1 100644
--- a/isns-utils.spec
+++ b/isns-utils.spec
@@ -1,22 +1,15 @@
 Name:           isns-utils
-Version:        0.91
-Release:        8%{?dist}
+Version:        0.93
+Release:        1%{?dist}
 Summary:        The iSNS daemon and utility programs
 
 Group:          System Environment/Daemons
 License:        LGPLv2+
-URL:            http://oss.oracle.com/~okir/open-isns/
-Source0:        http://oss.oracle.com/~okir/open-isns/open-isns-%{version}.tar.bz2
+URL:            http://www.kernel.org/pub/linux/kernel/people/mnc/open-isns
+Source0:        http://www.kernel.org/pub/linux/kernel/people/mnc/open-isns/releases/open-isns-%{version}.tar.bz2
 Source1:        isnsd.service
-Patch0:         isns-utils-turn-default-dd-on-to-match-msft.patch
-Patch1:         isns-utils-update-isnsadm-man.patch
-Patch2:         isns-utils-fix-non-utf8-chars-in-copying.patch
-Patch3:         isns-utils-include-limits.patch
-
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  openssl-devel automake pkgconfig
-#Requires:       /sbin/chkconfig  /sbin/service
 Requires(post): systemd-units
 Requires(preun): systemd-units
 Requires(postun): systemd-units
@@ -30,10 +23,6 @@ Fibre Channel devices (using iFCP gateways) on a TCP/IP network.
 
 %prep
 %setup -q -n open-isns-%{version}
-%patch0 -p1 -b .turn-default-dd-on-to-match-msft
-%patch1 -p1 -b .update-isnsadm-man
-%patch2 -p1 -b .fix-non-utf8-chars-in-copying
-%patch3 -p1 -b .isns-utils-include-limits
 
 
 %build
@@ -50,7 +39,6 @@ autoheader
 
 
 %install
-%{__rm} -rf %{buildroot}
 %{__install} -d %{buildroot}%{_sbindir}
 %{__install} -d %{buildroot}%{_mandir}/man8
 %{__install} -d %{buildroot}%{_mandir}/man5
@@ -64,40 +52,21 @@ autoheader
 %{__install} -p -m 644 etc/isnsadm.conf %{buildroot}%{_sysconfdir}/isns/isnsadm.conf
 
 %{__install} -p -m 755 isnsd isnsdd isnsadm isnssetup %{buildroot}%{_sbindir}
-%{__install} -p -m 0755 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service
+%{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/isnsd.service
 %{__install} -p -m 644 doc/isns_config.5 %{buildroot}/%{_mandir}/man5/
 %{__install} -p -m 644 doc/isnsd.8 doc/isnsdd.8 doc/isnsadm.8 %{buildroot}/%{_mandir}/man8/
 
 
 %post
-#/sbin/chkconfig --add isnsd
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post isnsd.service
 
 
 %postun
-#if [ "$1" = "1" ] ; then
-#     /sbin/service isnsd condrestart > /dev/null 2>&1
-#fi
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart isnsd.service >/dev/null 2>&1 || :
-fi
+%systemd_postun isnsd.service
 
 
 %preun
-#if [ "$1" = "0" ] ; then
-#     /sbin/chkconfig isnsd stop > /dev/null 2>&1
-#     /sbin/chkconfig --del isnsd
-#fi
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable isnsd.service > /dev/null 2>&1 || :
-    /bin/systemctl stop isnsd.service > /dev/null 2>&1 || :
-fi
+%systemd_preun isnsd.service
 
 
 %triggerun -- isns-utils < 0.91-7
@@ -115,7 +84,6 @@ fi
 %{__rm} -rf %{buildroot}
 
 %files
-%defattr(-, root, root, -)
 %doc COPYING README
 %{_sbindir}/isnsd
 %{_sbindir}/isnsadm
@@ -129,6 +97,10 @@ fi
 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/isns/*
 
 %changelog
+* Mon Sep 10 2012 Chris Leech <cleech at redhat.com> - 0.93-1
+- Rebase to 0.93
+- Make use of systemd rpm macros for scriptlets, BZ 850174
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.91-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/isnsd.init b/isnsd.init
index acc8c1b..12a8d41 100644
--- a/isnsd.init
+++ b/isnsd.init
@@ -23,6 +23,8 @@ RETVAL=0
 
 start()
 {
+	[ `id -u` = 0 ] || exit 4
+
 	echo -n "Starting iSNS Server:"
 	daemon isnsd
 	echo
@@ -34,6 +36,8 @@ start()
 
 stop()
 {
+	[ `id -u` = 0 ] || exit 4
+
 	echo -n "Stopping iSNS Server: "
 	if [ ! -f /var/lock/subsys/isnsd ]; then
 		echo
@@ -60,6 +64,12 @@ case "$1" in
 	stop)
 		stop
 		;;
+	reload)
+		exit 3
+		;;
+	force-reload)
+		restart
+		;;
 	restart)
 		restart
 		;;
@@ -67,12 +77,12 @@ case "$1" in
 		status isnsd
 		RETVAL=$?
 		;;
-	condrestart)
+	condrestart|try-restart)
 		[ -f /var/lock/subsys/isnsd ] && restart
 		;;
 	*)
-		echo $"Usage: $0 {start|stop|restart|status|condrestart}"
-		exit 1
+		echo $"Usage: $0 {start|stop|restart|status|force-reload|condrestart|try-restart}"
+		exit 2
 esac
 
 exit $RETVAL
diff --git a/sources b/sources
index 7944f65..321754a 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-27d512380511428409a5438ca789ab0d  open-isns-0.91.tar.bz2
+d89a574090e79073181f0ddf7c6eea04  open-isns-0.93.tar.bz2


More information about the scm-commits mailing list