From 4472423175c398c664af727f03bdb69a9bed0802 Mon Sep 17 00:00:00 2001 From: Guillaume Bougard Date: Tue, 19 Feb 2019 11:58:44 +0100 Subject: [PATCH] fix: Don't depend on GNU install during 'make install' Closes #637 --- Changes | 2 ++ Makefile.PL | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Changes b/Changes index b8bf397c4f..fa6b3e31ee 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ Revision history for FusionInventory agent core: * fix some cases where a file handle was not closed * win32: fix a handle leak case when agent was running as service +* Fix #637: Don't depend on GNU install during "make install" to support + more Unix systems inventory: * win32 antivirus support update: diff --git a/Makefile.PL b/Makefile.PL index 4264987b28..c68759c1fb 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -239,24 +239,22 @@ sub install { $install .= <<'EOF'; config_install : pure_install - install -d -m 755 $(DESTDIR)$(SYSCONFDIR) - if [ -f $(DESTDIR)/$(SYSCONFDIR)/agent.cfg ]; then \ - install -m 644 etc/agent.cfg $(DESTDIR)$(SYSCONFDIR)/agent.cfg.new; \ + $(MKPATH) $(DESTDIR)$(SYSCONFDIR) + $(NOECHO) $(CHMOD) $(PERM_DIR) $(DESTDIR)$(SYSCONFDIR) + if $(TEST_F) $(DESTDIR)/$(SYSCONFDIR)/agent.cfg; then \ + $(RM_F) $(DESTDIR)$(SYSCONFDIR)/agent.cfg.new; \ + $(CP) etc/agent.cfg $(DESTDIR)$(SYSCONFDIR)/agent.cfg.new; \ + $(CHMOD) $(PERM_RW) $(DESTDIR)$(SYSCONFDIR)/agent.cfg.new; \ else \ - install -m 644 etc/agent.cfg $(DESTDIR)$(SYSCONFDIR)/agent.cfg; \ + $(CP) etc/agent.cfg $(DESTDIR)$(SYSCONFDIR)/agent.cfg; \ + $(CHMOD) $(PERM_RW) $(DESTDIR)$(SYSCONFDIR)/agent.cfg; \ fi $(ABSPERLRUN) -pi \ -e "s|=> undef, # SYSCONFDIR.*|=> '$(SYSCONFDIR)',|;" \ $(DESTDIR)$(DATADIR)/lib/FusionInventory/Agent/Config.pm data_install : pure_install - install -d -m 755 $(DESTDIR)$(DATADIR) - install -m 644 share/pci.ids $(DESTDIR)$(DATADIR)/ - install -m 644 share/usb.ids $(DESTDIR)$(DATADIR)/ - install -m 644 share/sysobject.ids $(DESTDIR)$(DATADIR)/ - install -m 644 share/edid.ids $(DESTDIR)$(DATADIR)/ - install -d -m 755 $(DESTDIR)$(DATADIR)/html - install -m 644 share/html/* $(DESTDIR)$(DATADIR)/html + $(MOD_INSTALL) "share" "$(DESTDIR)$(DATADIR)" setup_install : pure_install # Cleanup setup file to only really needed hash during install