Patch from Ruben Laban <r.laban@ism.nl> to make the Makefiles more packager friendly...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 19 Mar 2009 14:20:07 +0000 (14:20 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 19 Mar 2009 14:20:07 +0000 (14:20 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@704 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/Makefile
scst/src/Makefile
scstadmin/Makefile

index 3b1d698..2478852 100644 (file)
@@ -11,6 +11,7 @@ SUBDIRS := $(shell pwd)
 SCST_INC_DIR := $(SUBDIRS)/../scst/include
 #SCST_DIR := $(SCST_INC_DIR)
 SCST_DIR := $(shell pwd)/../scst/src
+SBINDIR := /usr/local/sbin
 
 ifeq ($(KVER),)
   ifeq ($(KDIR),)
@@ -38,8 +39,8 @@ include/iscsi_scst_itf_ver.h: include/iscsi_scst.h
        echo "\"`sha1sum include/iscsi_scst.h|awk '{printf $$1}'`\"" >>include/iscsi_scst_itf_ver.h
 
 install: all
-       @install -vD usr/iscsi-scstd $(DISTDIR)/usr/local/sbin/iscsi-scstd
-       @install -vD usr/iscsi-scst-adm $(DISTDIR)/usr/local/sbin/iscsi-scst-adm
+       @install -vD usr/iscsi-scstd $(DISTDIR)$(SBINDIR)/iscsi-scstd
+       @install -vD usr/iscsi-scst-adm $(DISTDIR)$(SBINDIR)/iscsi-scst-adm
        if [ -f /etc/debian_version ]; then \
                install -vD -m 755 etc/initd/initd.debian $(DISTDIR)/etc/init.d/iscsi-scst; \
        elif [ -f /etc/redhat-release ]; then \
index 6655754..ce3cd77 100644 (file)
@@ -106,11 +106,11 @@ uninstall:
 endif
 
 ifeq ($(KVER),)
-INSTALL_DIR := /lib/modules/$(shell uname -r)/extra
+INSTALL_DIR := $(DISTDIR)/lib/modules/$(shell uname -r)/extra
 else
-INSTALL_DIR := /lib/modules/$(KVER)/extra
+INSTALL_DIR := $(DISTDIR)/lib/modules/$(KVER)/extra
 endif
-INSTALL_DIR_H := /usr/local/include/scst
+INSTALL_DIR_H := $(DISTDIR)/usr/local/include/scst
 
 EXTRA_CFLAGS += -I$(SCST_INC_DIR) -Wextra -Wno-unused-parameter \
                -Wno-missing-field-initializers
index cc9c2fb..f376ce7 100644 (file)
@@ -1,22 +1,25 @@
 MODULE_VERSION = 0.7.4
 TOOL = scstadmin
 
+SBINDIR := $(PREFIX)/usr/local/sbin
+INITDIR := $(PREFIX)/etc/init.d
+
 all: perl-module
 
 install:
        $(MAKE) -C scst-$(MODULE_VERSION) install
-       install -m 755 $(TOOL) /usr/local/sbin
-       install -m 755 init.d/scst /etc/init.d
-       install -m 755 init.d/qla2x00t /etc/init.d
+       install -m 755 $(TOOL) $(DISTDIR)$(SBINDIR)
+       install -m 755 init.d/scst $(DISTDIR)$(INITDIR)
+       install -m 755 init.d/qla2x00t $(DISTDIR)$(INITDIR)
        /usr/lib/lsb/install_initd scst
        /usr/lib/lsb/install_initd qla2x00t
 
 uninstall:
        -/usr/lib/lsb/remove_initd qla2x00t
        -/usr/lib/lsb/remove_initd scst
-       -rm -f /etc/init.d/qla2x00t
-       -rm -f /etc/init.d/scst
-       -rm -f /usr/local/sbin/$(TOOL)
+       -rm -f $(DISTDIR)$(PATH_INITD)/qla2x00t
+       -rm -f $(DISTDIR)$(PATH_INITD)/scst
+       -rm -f $(DISTDIR)$(PATH_SBIN)/$(TOOL)
        $(MAKE) -C scst-$(MODULE_VERSION) uninstall
 
 perl-module: