From 2debac5cedb7591e89afa1f7933de8c026fcc499 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 10 Jun 2011 18:03:06 +0000 Subject: [PATCH] Slackware: Do not suggest the user to run a script to activate /etc/init.d/scst on boot because such a script does not exist on Slackware. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3566 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scstadmin/Makefile | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 4331443bc..4948a1119 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -5,6 +5,21 @@ INITDIR := $(shell if [ -f /etc/slackware-version ]; then \ else \ echo $(PREFIX)/etc/init.d; \ fi) +INSTALL_INITD_CMD := $(shell if [ -f /etc/gentoo-release ]; then \ + echo rc-update add; \ + elif [ -f /etc/slackware-version ]; then \ + echo none; \ + else \ + echo /usr/lib/lsb/install_initd; \ + fi) +INSTALL_INITD_ARGS := $(shell [ -f /etc/gentoo-release ] && echo default) +REMOVE_INITD_CMD := $(shell if [ -f /etc/gentoo-release ]; then \ + echo rc-update del; \ + elif [ -f /etc/slackware-version ]; then \ + echo none; \ + else \ + echo /usr/lib/lsb/remove_initd; \ + fi) DEFAULTDIR := $(PREFIX)/etc/default all: @@ -14,33 +29,37 @@ install: @if ! perl -MExtUtils::MakeMaker -e '' >/dev/null 2>&1; then \ echo Error: the Perl module ExtUtils::MakeMaker must be installed \ first; false; fi - @if [ ! -e /etc/slackware-version -a ! -e /lib/lsb/init-functions ]; \ - then \ - echo "Error: the lsb-core (Debian, Ubuntu), redhat-lsb (RHEL, Fedora) "\ - "or insserv (SLES, openSUSE) package must be installed first"; false; fi + @if [ ! -e /etc/slackware-version -a ! -e /etc/gentoo-release \ + -a ! -e /lib/lsb/init-functions ]; then \ + echo "Error: the lsb-core (Debian, Ubuntu), redhat-lsb (RHEL, CentOS,"\ + "Scientific Linux, Fedora) or insserv (SLES, openSUSE) package must" \ + "be installed first"; false; fi cd $(SCSTADMIN_DIR) && $(MAKE) $@ install -d $(DESTDIR)$(INITDIR) install -m 755 init.d/scst $(DESTDIR)$(INITDIR) if [ ! -e $(DESTDIR)$(DEFAULTDIR)/scst ]; then \ install -m 755 default/scst $(DESTDIR)$(DEFAULTDIR); \ fi - @echo - @echo 'If you want SCST to start automatically at boot time, run' \ - 'the following command:' - @if [ ! -z "$(DESTDIR)" ]; then echo -n "chroot $(DESTDIR) "; fi - @echo '/usr/lib/lsb/install_initd scst' - @echo + @if [ "$(INSTALL_INITD_CMD)" != "none" ]; then \ + echo; \ + echo 'If you want SCST to start automatically at boot time, run' \ + 'the following command:'; \ + if [ ! -z "$(DESTDIR)" ]; then echo -n "chroot $(DESTDIR) "; fi; \ + echo '$(INSTALL_INITD_CMD) scst $(INSTALL_INITD_ARGS)'; \ + echo; \ + fi uninstall: if [ -e $(DESTDIR)$(DEFAULTDIR)/scst ]; then \ mv $(DESTDIR)$(DEFAULTDIR)/scst \ $(DESTDIR)$(DEFAULTDIR)/scst.`date +%F,%T`; \ fi - if [ -e $(DESTDIR)$(INITDIR)/scst ]; then \ + if [ -e $(DESTDIR)$(INITDIR)/scst -a "$(REMOVE_INITD_CMD)" != "none" ];\ + then \ if [ -z "$(DESTDIR)" ]; then \ - /usr/lib/lsb/remove_initd scst; \ + $(REMOVE_INITD_CMD) scst; \ else \ - chroot $(DESTDIR) /usr/lib/lsb/remove_initd scst; \ + chroot $(DESTDIR) $(REMOVE_INITD_CMD) scst; \ fi; \ rm -f $(DESTDIR)$(INITDIR)/scst; \ fi