--- isns-2.1-01+dfsg.orig/isnsclient/Makefile +++ isns-2.1-01+dfsg/isnsclient/Makefile @@ -116,7 +116,7 @@ $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ clean : - rm $(PROG1) $(PROG2) $(OBJECTS) isnsc isnsadm + rm -f $(PROG1) $(PROG2) $(OBJECTS) isnsc isnsadm install: install_programs --- isns-2.1-01+dfsg.orig/isnsserver/Makefile +++ isns-2.1-01+dfsg/isnsserver/Makefile @@ -150,7 +150,7 @@ $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ clean : - rm $(OBJECTS) isnsd + rm -f $(OBJECTS) isnsd install: install_programs install_initd --- isns-2.1-01+dfsg.orig/debian/copyright +++ isns-2.1-01+dfsg/debian/copyright @@ -0,0 +1,46 @@ +This package was debianized by Martin Zobel-Helas on +Thu, 1 Nov 2007 16:56:20 +0100. + +It was downloaded from http://sourceforge.net/projects/linuxisns + +Upstream Author: Nishan Systems, Inc. + +Copyright: 2001, Nishan Systems, Inc + +License: +Copyright (c) 2001, Nishan Systems, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + - Neither the name of the Nishan Systems, Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NISHAN SYSTEMS, INC. + OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +On Debian systems, the complete text of the BSD License can be +found in `/usr/share/common-licenses/BSD'. + + +The Debian packaging is (C) 2007, Martin Zobel-Helas and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + --- isns-2.1-01+dfsg.orig/debian/control +++ isns-2.1-01+dfsg/debian/control @@ -0,0 +1,24 @@ +Source: isns +Section: net +Priority: extra +Maintainer: Martin Zobel-Helas +Build-Depends: debhelper (>= 5), libgdbm-dev, quilt (>= 0.40) +Standards-Version: 3.7.2 + +Package: isns +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Internet Storage Naming Service + The internet storage name service (iSNS) is used to register iSCSI and + iFCP storage devices in the network. The iSNS allows dynamic discovery + of available storage targets by storage initiators. + +Package: isns-client +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Internet Storage Naming Service - cli-client + The internet storage name service (iSNS) is used to register iSCSI and + iFCP storage devices in the network. The iSNS allows dynamic discovery + of available storage targets by storage initiators. + . + This package provides a cli-client --- isns-2.1-01+dfsg.orig/debian/preinst +++ isns-2.1-01+dfsg/debian/preinst @@ -0,0 +1,42 @@ +#!/bin/sh +# preinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + upgrade) + ## 2.1-01+dfsg-2 and earlier stored their data in wrong path (see #465782) + if [ -d /var/isns ] + then + mv /var/isns /var/lib/isns/ + fi + ;; + + install|abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- isns-2.1-01+dfsg.orig/debian/postinst +++ isns-2.1-01+dfsg/debian/postinst @@ -0,0 +1,42 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + invoke-rc.d isns restart + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- isns-2.1-01+dfsg.orig/debian/dirs +++ isns-2.1-01+dfsg/debian/dirs @@ -0,0 +1,2 @@ +usr/sbin +var/lib/isns --- isns-2.1-01+dfsg.orig/debian/rules +++ isns-2.1-01+dfsg/debian/rules @@ -0,0 +1,102 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +include /usr/share/quilt/quilt.make + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +#Architecture +build: build-arch + +build-arch: patch build-arch-stamp +build-arch-stamp: configure-stamp + + # Add here commands to compile the arch part of the package. + #$(MAKE) + cd isnsserver && $(MAKE) ; \ + cd .. ; cd isnsclient && $(MAKE) ; + touch $@ + +clean: debclean patchclean + +patchclean: unpatch + +debclean: + dh_testdir + dh_testroot + rm -f build-arch-stamp configure-stamp + + # Add here commands to clean up after the build process. + cd isnsserver; $(MAKE) clean ; \ + cd .. ; cd isnsclient; $(MAKE) clean + dh_clean + +install: install-arch +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Add here commands to install the arch part of the package into + # debian/tmp. + cd isnsserver && $(MAKE) DESTDIR=$(CURDIR)/debian/isns install ; \ + cd .. ; cd isnsclient && $(MAKE) DESTDIR=$(CURDIR)/debian/isns-client install + dh_install -s +# Must not depend on anything. This is to be called by +# binary-arch/binary-indep +# in another 'make' thread. +binary-common: + dh_testdir -A + dh_testroot -A + dh_installchangelogs -A + dh_installdocs -A + dh_installexamples -A + dh_installman -A + dh_installinit + dh_link -A + dh_strip -A + dh_compress -A + dh_fixperms -A + dh_makeshlibs -A + dh_installdeb -A + dh_shlibdeps -A + dh_gencontrol -A + dh_md5sums -A + dh_builddeb -A + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-arch +.PHONY: build clean binary-arch binary install install-arch configure --- isns-2.1-01+dfsg.orig/debian/compat +++ isns-2.1-01+dfsg/debian/compat @@ -0,0 +1 @@ +5 --- isns-2.1-01+dfsg.orig/debian/postrm +++ isns-2.1-01+dfsg/debian/postrm @@ -0,0 +1,46 @@ +#!/bin/sh +# postrm script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + ## clean data from isns + rm -rf /var/lib/isns + ;; + remove) + invoke-rc.d isns stop + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- isns-2.1-01+dfsg.orig/debian/isns.init.d +++ isns-2.1-01+dfsg/debian/isns.init.d @@ -0,0 +1,82 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: isns +# Required-Start: $network +# Required-Stop: $network +# Should-Start: $named +# Should-Stop: $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: iSNS Internet Storage Naming Service +# Description: The internet storage name service (iSNS) is used to +# register iSCSI and iFCP storage devices in the network. +# The iSNS allows dynamic discovery of available storage +# targets by storage initiators. +# +### END INIT INFO + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +PID_FILE=/var/run/isnss.pid +CONFIG_FILE=/etc/isns/isns.conf +DAEMON=/usr/sbin/isnsd +NAME=isnsd +DESC="iSNS Internet Storage Naming Service" + +test -x $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --oknodo --pidfile $PID_FILE \ + --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --oknodo --pidfile $PID_FILE \ + --exec $DAEMON + echo "$NAME." + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # $PID_FILE --exec $DAEMON + #;; + force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart" except that it does nothing if the + # daemon isn't already running. + # check wether $DAEMON is running. If so, restart + start-stop-daemon --stop --test --quiet --oknodo --pidfile \ + $PID_FILE --exec $DAEMON \ + && $0 restart \ + || exit 0 + ;; + restart) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --oknodo --pidfile \ + $PID_FILE --exec $DAEMON + sleep 1 + start-stop-daemon --start --quiet --oknodo --pidfile \ + $PID_FILE --exec $DAEMON -- $DAEMON_OPTS + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac +exit 0 --- isns-2.1-01+dfsg.orig/debian/changelog +++ isns-2.1-01+dfsg/debian/changelog @@ -0,0 +1,38 @@ +isns (2.1-01+dfsg-3) unstable; urgency=medium + + * Acknowledge NMU of Meike and Alex (Closes: #465782) + * Make init script fail-save (Closes: #465781) + * Adjust the pid filename of isnsserver (Closes: #462208) + + -- Martin Zobel-Helas Fri, 23 Jan 2009 10:03:25 +0100 + +isns (2.1-01+dfsg-2.1) unstable; urgency=high + + * NMU: + [ Meike Reichle ] + * created patches/iSNSLinux.c_var_lib.patch and changed + dirs (Closes: #465782) + * Added preinst in order to ensure upgrade path + * urgency high for RC bug fix + + [ Alexander Schmehl ] + * Adding postrm to rm /var/lib/isns on purge as suggested by Pierre Habouzit + * stoping service on removal + * mv files in preinst + * restart service + + -- Meike Reichle Fri, 04 Apr 2008 23:19:37 +0200 + +isns (2.1-01+dfsg-2) unstable; urgency=low + + * Fix location of pid file (Closes: #462006) + Thanks to Vladislav Artemyev. + + -- Martin Zobel-Helas Wed, 23 Jan 2008 08:58:45 +0100 + +isns (2.1-01+dfsg-1) unstable; urgency=low + + * Initial release (Closes: #448879) + + -- Martin Zobel-Helas Thu, 1 Nov 2007 16:56:20 +0100 + --- isns-2.1-01+dfsg.orig/debian/patches/series +++ isns-2.1-01+dfsg/debian/patches/series @@ -0,0 +1,4 @@ +# 01_Makefile.patch +# 02_Makefile.patch +iSNSLinux.c.patch +iSNSLinux.c_var_lib.patch --- isns-2.1-01+dfsg.orig/debian/patches/02_Makefile.patch +++ isns-2.1-01+dfsg/debian/patches/02_Makefile.patch @@ -0,0 +1,26 @@ +--- isns-2.1-01.orig/isnsclient/Makefile ++++ isns-2.1-01/isnsclient/Makefile +@@ -58,7 +58,7 @@ + + DESTDIR ?= + INSTALL = install +-sbindir = $(exec_prefix)/sbin ++bindir = $(exec_prefix)/bin + + PROGRAMS = isnsc isnsadm + +@@ -116,11 +116,11 @@ + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + clean : +- rm $(PROG1) $(PROG2) $(OBJECTS) isnsc isnsadm ++ rm -f $(PROG1) $(PROG2) $(OBJECTS) isnsc isnsadm + + install: install_programs + + install_programs: $(PROGRAMS) +- $(INSTALL) -d $(DESTDIR)$(sbindir) +- $(INSTALL) -m 755 $^ $(DESTDIR)$(sbindir) ++ $(INSTALL) -d $(DESTDIR)$(bindir) ++ $(INSTALL) -m 755 $^ $(DESTDIR)$(bindir) + --- isns-2.1-01+dfsg.orig/debian/patches/01_Makefile.patch +++ isns-2.1-01+dfsg/debian/patches/01_Makefile.patch @@ -0,0 +1,11 @@ +--- isns-2.1-01.orig/isnsserver/Makefile ++++ isns-2.1-01/isnsserver/Makefile +@@ -150,7 +150,7 @@ + $(CC) -I$(INCDIR) $(CFLAGS) -c $< -o $@ + + clean : +- rm $(OBJECTS) isnsd ++ rm -f $(OBJECTS) isnsd + + install: install_programs install_initd + --- isns-2.1-01+dfsg.orig/debian/patches/iSNSLinux.c_var_lib.patch +++ isns-2.1-01+dfsg/debian/patches/iSNSLinux.c_var_lib.patch @@ -0,0 +1,16 @@ +Index: isns-2.1-01+dfsg/isnsserver/src/iSNSLinux.c +=================================================================== +--- isns-2.1-01+dfsg.orig/isnsserver/src/iSNSLinux.c 2008-03-20 14:30:43.000000000 +0100 ++++ isns-2.1-01+dfsg/isnsserver/src/iSNSLinux.c 2008-03-20 14:33:10.000000000 +0100 +@@ -210,8 +210,9 @@ + } + } + +- rc = mkdir("/var/isns",0777); +- rc = chdir("/var/isns"); ++ //rc = mkdir("/var/isns",0777); ++ //In Debian this belongs in /var/lib/isns, created by dh_installdirs ++ rc = chdir("/var/lib/isns"); + + if (daemon_state == TRUE) + { --- isns-2.1-01+dfsg.orig/debian/patches/iSNSLinux.c.patch +++ isns-2.1-01+dfsg/debian/patches/iSNSLinux.c.patch @@ -0,0 +1,21 @@ +--- isns-2.1-01.orig/isnsserver/src/iSNSLinux.c ++++ isns-2.1-01/isnsserver/src/iSNSLinux.c +@@ -149,7 +149,7 @@ + } + + char Usage[] = "\ +-Usage: isnss [options] -i IP -b BROADCAST IP\n\ ++Usage: isnsd [options] -i IP -b BROADCAST IP\n\ + NOTES: IP-Addresses must be in IP dotted notation.\n\ + Options:\n\ + [-a addr] IP-Address for SNSP traffic.\n\ +@@ -229,7 +229,7 @@ + { + int fd_pid; + char buf[64]; +- char *pid_file = "/var/run/isnss.pid"; ++ char *pid_file = "/var/run/isnsd.pid"; + int rc; + + fd_pid = open(pid_file, O_WRONLY | O_CREAT, 0644); +