--- a/core-iscsi/Makefile +++ b/core-iscsi/Makefile @@ -10,6 +10,7 @@ MKNOD = mknod RM = rm LN = ln +MKDIR = mkdir OS:=$(shell uname) ARCH:=$(shell uname -m) @@ -73,139 +74,154 @@ $(MKNOD) $(DESTDIR)/dev/iscsi1 c 10 203 install: check-dest all devpts + $(MKDIR) -p $(DESTDIR)$(sbindir) + $(MKDIR) -p $(DESTDIR)$(mandir) $(RM) -f $(DESTDIR)$(sbindir)/$(EXECUTABLES) localinstall: all - $(RM) -f /sbin/initiator-authd - install initiator_authd /sbin/initiator-authd - $(RM) -f /sbin/initiator-ctl - install initiator_ctl /sbin/initiator-ctl + $(MKDIR) -p $(DESTDIR)$(sbindir) + $(MKDIR) -p $(DESTDIR)$(mandir) + $(RM) -f $(DESTDIR)/sbin/initiator-authd + install initiator_authd $(DESTDIR)/sbin/initiator-authd + $(RM) -f $(DESTDIR)/sbin/initiator-ctl + install initiator_ctl $(DESTDIR)/sbin/initiator-ctl initiator_install: all - $(RM) -f /sbin/initiator-authd - install initiator_authd /sbin/initiator-authd - $(RM) -f /sbin/initiator-ctl - install initiator_ctl /sbin/initiator-ctl - install initiator_iname /sbin/initiator-iname - install man/initiator-ctl.1 /usr/share/man/man1 - install man/initiator.5 /usr/share/man/man5 - install man/initiator_auth.5 /usr/share/man/man5 - install man/iscsi_device_maps.5 /usr/share/man/man5 + $(MKDIR) -p $(DESTDIR)$(sbindir) + $(MKDIR) -p $(DESTDIR)$(mandir) + $(RM) -f $(DESTDIR)/sbin/initiator-authd + install initiator_authd $(DESTDIR)/sbin/initiator-authd + $(RM) -f $(DESTDIR)/sbin/initiator-ctl + install initiator_ctl $(DESTDIR)/sbin/initiator-ctl + install initiator_iname $(DESTDIR)/sbin/initiator-iname + install man/initiator-ctl.1 $(DESTDIR)/usr/share/man/man1 + install man/initiator.5 $(DESTDIR)/usr/share/man/man5 + install man/initiator_auth.5 $(DESTDIR)/usr/share/man/man5 + install man/iscsi_device_maps.5 $(DESTDIR)/usr/share/man/man5 - if [ ! -d /etc/iscsi ]; then \ - mkdir -p /etc/iscsi; \ + if [ ! -d $(DESTDIR)/etc/iscsi ]; then \ + mkdir -p $(DESTDIR)/etc/iscsi; \ fi - if [ ! -d /etc/sysconfig ]; then \ - mkdir -p /etc/sysconfig; \ + if [ ! -d $(DESTDIR)/etc/sysconfig ]; then \ + mkdir -p $(DESTDIR)/etc/sysconfig; \ fi - if [ ! -d /etc/rc.d/init.d ]; then \ - mkdir -p /etc/rc.d/init.d; \ + if [ ! -d $(DESTDIR)/etc/rc.d/init.d ]; then \ + mkdir -p $(DESTDIR)/etc/rc.d/init.d; \ fi - install -c -m 755 scripts/install.channel /etc/iscsi/install.channel - if [ ! -f /etc/sysconfig/initiator ]; then \ - install -c -m 644 conf/initiator-sysconfig /etc/sysconfig/initiator; \ + install -c -m 755 scripts/install.channel $(DESTDIR)/etc/iscsi/install.channel + if [ ! -f $(DESTDIR)/etc/sysconfig/initiator ]; then \ + install -c -m 644 conf/initiator-sysconfig $(DESTDIR)/etc/sysconfig/initiator; \ fi - if [ ! -f /etc/sysconfig/iscsi_device_maps ]; then \ - install -c -m 644 conf/devicemaps-sysconfig /etc/sysconfig/iscsi_device_maps; \ + if [ ! -f $(DESTDIR)/etc/sysconfig/iscsi_device_maps ]; then \ + install -c -m 644 conf/devicemaps-sysconfig $(DESTDIR)/etc/sysconfig/iscsi_device_maps; \ fi - if [ ! -f /etc/sysconfig/initiator_auth ]; then \ - install -c -m 600 conf/initiator_auth-sysconfig /etc/sysconfig/initiator_auth; \ + if [ ! -f $(DESTDIR)/etc/sysconfig/initiator_auth ]; then \ + install -c -m 600 conf/initiator_auth-sysconfig $(DESTDIR)/etc/sysconfig/initiator_auth; \ fi - install -c -m 755 scripts/rc.initiator /etc/rc.d/init.d/initiator - install -c -m 755 scripts/proc.iscsi-map-channel /sbin/proc.iscsi-map-channel - install -c -m 755 scripts/sysfs.iscsi-map-channel /sbin/sysfs.iscsi-map-channel - install -c -m 755 scripts/iscsi-map-channel /sbin/iscsi-map-channel - install -c -m 755 scripts/proc.iscsi-unmap-channel /sbin/proc.iscsi-unmap-channel - install -c -m 755 scripts/sysfs.iscsi-unmap-channel /sbin/sysfs.iscsi-unmap-channel - install -c -m 755 scripts/iscsi-unmap-channel /sbin/iscsi-unmap-channel - install -c -m 755 scripts/iscsi-remap-channel /sbin/iscsi-remap-channel - install -c -m 755 scripts/iscsi-mount /sbin/iscsi-mount - install -c -m 755 scripts/iscsi-umount /sbin/iscsi-umount + install -c -m 755 scripts/rc.initiator $(DESTDIR)/etc/rc.d/init.d/initiator + install -c -m 755 scripts/proc.iscsi-map-channel $(DESTDIR)/sbin/proc.iscsi-map-channel + install -c -m 755 scripts/sysfs.iscsi-map-channel $(DESTDIR)/sbin/sysfs.iscsi-map-channel + install -c -m 755 scripts/iscsi-map-channel $(DESTDIR)/sbin/iscsi-map-channel + install -c -m 755 scripts/proc.iscsi-unmap-channel $(DESTDIR)/sbin/proc.iscsi-unmap-channel + install -c -m 755 scripts/sysfs.iscsi-unmap-channel $(DESTDIR)/sbin/sysfs.iscsi-unmap-channel + install -c -m 755 scripts/iscsi-unmap-channel $(DESTDIR)/sbin/iscsi-unmap-channel + install -c -m 755 scripts/iscsi-remap-channel $(DESTDIR)/sbin/iscsi-remap-channel + install -c -m 755 scripts/iscsi-mount $(DESTDIR)/sbin/iscsi-mount + install -c -m 755 scripts/iscsi-umount $(DESTDIR)/sbin/iscsi-umount uninstall: - rm -rf /sbin/initiator-authd - rm -rf /sbin/initiator-ctl - rm -rf /usr/share/man/man1/initiator-ctl.1 - rm -rf /usr/share/man/man5/initiator.5 - rm -rf /usr/share/man/man5/initiator_auth.5 - rm -rf /usr/share/man/man5/iscsi_device_maps.5 - rm -rf /etc/rc.d/init.d/initiator - rm -rf /sbin/proc.iscsi-map-channel - rm -rf /sbin/sysfs.iscsi-map-channel - rm -rf /sbin/iscsi-map-channel - rm -rf /sbin/proc.iscsi-unmap-channel - rm -rf /sbin/sysfs.iscsi-unmap-channel - rm -rf /sbin/iscsi-unmap-channel - rm -rf /sbin/iscsi-remap-channel - rm -rf /sbin/iscsi-mount - rm -rf /sbin/iscsi-umount + rm -rf $(DESTDIR)/sbin/initiator-authd + rm -rf $(DESTDIR)/sbin/initiator-ctl + rm -rf $(DESTDIR)/usr/share/man/man1/initiator-ctl.1 + rm -rf $(DESTDIR)/usr/share/man/man5/initiator.5 + rm -rf $(DESTDIR)/usr/share/man/man5/initiator_auth.5 + rm -rf $(DESTDIR)/usr/share/man/man5/iscsi_device_maps.5 + rm -rf $(DESTDIR)/etc/rc.d/init.d/initiator + rm -rf $(DESTDIR)/sbin/proc.iscsi-map-channel + rm -rf $(DESTDIR)/sbin/sysfs.iscsi-map-channel + rm -rf $(DESTDIR)/sbin/iscsi-map-channel + rm -rf $(DESTDIR)/sbin/proc.iscsi-unmap-channel + rm -rf $(DESTDIR)/sbin/sysfs.iscsi-unmap-channel + rm -rf $(DESTDIR)/sbin/iscsi-unmap-channel + rm -rf $(DESTDIR)/sbin/iscsi-remap-channel + rm -rf $(DESTDIR)/sbin/iscsi-mount + rm -rf $(DESTDIR)/sbin/iscsi-umount initiator_install_config: all - $(RM) -f /sbin/initiator-authd - install initiator_authd /sbin/initiator-authd - $(RM) -f /sbin/initiator-ctl - install initiator_ctl /sbin/initiator-ctl - install initiator_iname /sbin/initiator-iname - install man/initiator-ctl.1 /usr/share/man/man1 + $(RM) -f $(DESTDIR)/sbin/initiator-authd + install initiator_authd $(DESTDIR)/sbin/initiator-authd + $(RM) -f $(DESTDIR)/sbin/initiator-ctl + install initiator_ctl $(DESTDIR)/sbin/initiator-ctl + install initiator_iname $(DESTDIR)/sbin/initiator-iname + install man/initiator-ctl.1 $(DESTDIR)/usr/share/man/man1 - if [ ! -d /etc/iscsi ]; then \ - mkdir -p /etc/iscsi; \ + if [ ! -d $(DESTDIR)/etc/iscsi ]; then \ + mkdir -p $(DESTDIR)/etc/iscsi; \ fi - if [ ! -d /etc/sysconfig ]; then \ - mkdir -p /etc/sysconfig; \ + if [ ! -d $(DESTDIR)/etc/sysconfig ]; then \ + mkdir -p $(DESTDIR)/etc/sysconfig; \ fi - if [ ! -d /etc/rc.d/init.d ]; then \ - mkdir -p /etc/rc.d/init.d; \ + if [ ! -d $(DESTDIR)/etc/rc.d/init.d ]; then \ + mkdir -p $(DESTDIR)/etc/rc.d/init.d; \ fi - install -c -m 755 scripts/install.channel /etc/iscsi/install.channel - if [ -f /etc/sysconfig/initiator ]; then \ - cp /etc/sysconfig/initiator /etc/sysconfig/initiator.old; \ + install -c -m 755 scripts/install.channel $(DESTDIR)/etc/iscsi/install.channel + if [ -f $(DESTDIR)/etc/sysconfig/initiator ]; then \ + cp /etc/sysconfig/initiator $(DESTDIR)/etc/sysconfig/initiator.old; \ fi - install -c -m 644 conf/initiator-sysconfig /etc/sysconfig/initiator; - if [ -f /etc/sysconfig/iscsi_device_maps ]; then \ - cp /etc/sysconfig/iscsi_device_maps /etc/sysconfig/iscsi_device_maps.old; \ + install -c -m 644 conf/initiator-sysconfig $(DESTDIR)/etc/sysconfig/initiator; + if [ -f $(DESTDIR)/etc/sysconfig/iscsi_device_maps ]; then \ + cp $(DESTDIR)/etc/sysconfig/iscsi_device_maps \ + $(DESTDIR)/etc/sysconfig/iscsi_device_maps.old; \ fi - install -c -m 644 conf/devicemaps-sysconfig /etc/sysconfig/iscsi_device_maps; - if [ -f /etc/sysconfig/initiator_auth ]; then \ - cp /etc/sysconfig/initiator_auth /etc/sysconfig/initiator_auth.old; \ + install -c -m 644 conf/devicemaps-sysconfig $(DESTDIR)/etc/sysconfig/iscsi_device_maps; + if [ -f $(DESTDIR)/etc/sysconfig/initiator_auth ]; then \ + cp $(DESTDIR)/etc/sysconfig/initiator_auth \ + $(DESTDIR)/etc/sysconfig/initiator_auth.old; \ fi - install -c -m 600 conf/initiator_auth-sysconfig /etc/sysconfig/initiator_auth; + install -c -m 600 conf/initiator_auth-sysconfig $(DESTDIR)/etc/sysconfig/initiator_auth; - install -c -m 755 scripts/rc.initiator /etc/rc.d/init.d/initiator - install -c -m 755 scripts/proc.iscsi-map-channel /sbin/proc.iscsi-map-channel - install -c -m 755 scripts/sysfs.iscsi-map-channel /sbin/sysfs.iscsi-map-channel - install -c -m 755 scripts/iscsi-map-channel /sbin/iscsi-map-channel - install -c -m 755 scripts/proc.iscsi-unmap-channel /sbin/proc.iscsi-unmap-channel - install -c -m 755 scripts/sysfs.iscsi-unmap-channel /sbin/sysfs.iscsi-unmap-channel - install -c -m 755 scripts/iscsi-unmap-channel /sbin/iscsi-unmap-channel - install -c -m 755 scripts/iscsi-mount /sbin/iscsi-mount - install -c -m 755 scripts/iscsi-umount /sbin/iscsi-umount + install -c -m 755 scripts/rc.initiator $(DESTDIR)/etc/rc.d/init.d/initiator + install -c -m 755 scripts/proc.iscsi-map-channel $(DESTDIR)/sbin/proc.iscsi-map-channel + install -c -m 755 scripts/sysfs.iscsi-map-channel $(DESTDIR)/sbin/sysfs.iscsi-map-channel + install -c -m 755 scripts/iscsi-map-channel $(DESTDIR)/sbin/iscsi-map-channel + install -c -m 755 scripts/proc.iscsi-unmap-channel $(DESTDIR)/sbin/proc.iscsi-unmap-channel + install -c -m 755 scripts/sysfs.iscsi-unmap-channel $(DESTDIR)/sbin/sysfs.iscsi-unmap-channel + install -c -m 755 scripts/iscsi-unmap-channel $(DESTDIR)/sbin/iscsi-unmap-channel + install -c -m 755 scripts/iscsi-mount $(DESTDIR)/sbin/iscsi-mount + install -c -m 755 scripts/iscsi-umount $(DESTDIR)/sbin/iscsi-umount add_initd: - if [ -d /etc/rc.d/rc0.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc0.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc0.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc0.d/K02initiator; \ fi - if [ -d /etc/rc.d/rc1.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc1.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc1.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc1.d/K02initiator; \ fi - if [ -d /etc/rc.d/rc2.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc2.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc2.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc2.d/K02initiator; \ fi - if [ -d /etc/rc.d/rc3.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc3.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc3.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc3.d/K02initiator; \ fi - if [ -d /etc/rc.d/rc4.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc4.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc4.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc4.d/K02initiator; \ fi - if [ -d /etc/rc.d/rc5.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc5.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc5.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc5.d/K02initiator; \ fi - if [ -d /etc/rc.d/rc6.d ]; then \ - ln -s /etc/rc.d/init.d/initiator /etc/rc.d/rc6.d/K02initiator; \ + if [ -d $(DESTDIR)/etc/rc.d/rc6.d ]; then \ + ln -s $(DESTDIR)/etc/rc.d/init.d/initiator \ + $(DESTDIR)/etc/rc.d/rc6.d/K02initiator; \ fi clean: --- a/isnsclient-v1.8/Makefile +++ b/isnsclient-v1.8/Makefile @@ -90,10 +90,10 @@ $(CC) -I$(INCDIR) $(CFLAGS) -lpthread -o isnsc $(SRCS) install: all - /bin/cp isnsc /sbin/ - /bin/cp scripts/* /sbin/ - if [ ! -f /var/spool/isns ]; then \ - mkdir -p /var/spool/isns; \ + /bin/cp isnsc $(DESTDIR)/sbin/ + /bin/cp scripts/* $(DESTDIR)/sbin/ + if [ ! -f $(DESTDIR)/var/spool/isns ]; then \ + mkdir -p $(DESTDIR)/var/spool/isns; \ fi tarball :