summaryrefslogtreecommitdiffstats
path: root/userspace
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2010-03-16 13:00:37 +0000
committerBart De Schuymer <bdschuym@pandora.be>2010-03-16 13:00:37 +0000
commitbc89021aa53b109c69bf32a28cc00b22e9accbf4 (patch)
tree61bf39a8c63fbf119df89882226efabadb22b6dc /userspace
parentff6c1866de5c1bdc50bad47af4a374ac9ea6f90a (diff)
Create directories if they don't exist (INITDIR and SYSCONFIGDIR are only created if DESTDIR is specified)
Based on patch by Peter Volkov
Diffstat (limited to 'userspace')
-rw-r--r--userspace/ebtables2/Makefile15
1 files changed, 9 insertions, 6 deletions
diff --git a/userspace/ebtables2/Makefile b/userspace/ebtables2/Makefile
index 7e149a1..fc63616 100644
--- a/userspace/ebtables2/Makefile
+++ b/userspace/ebtables2/Makefile
@@ -154,11 +154,14 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
.PHONY: scripts
scripts: ebtables-save ebtables.sysv ebtables-config
cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
+ mkdir -p $(DESTDIR)$(BINDIR)
install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
- install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables
+ if [ $(DESTDIR) != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
+ if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
- install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config
+ if [ $(DESTDIR) != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi
+ if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
$(MANDIR)/man8/ebtables.8: ebtables.8
@@ -167,9 +170,9 @@ $(MANDIR)/man8/ebtables.8: ebtables.8
install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
rm -f ebtables.8_
-$(ETHERTYPESFILE): ethertypes
- mkdir -p $(DESTDIR)$(@D)
- install -m 0644 -o root -g root $< $(DESTDIR)$@
+$(DESTDIR)$(ETHERTYPESFILE): ethertypes
+ mkdir -p $(@D)
+ install -m 0644 -o root -g root $< $@
.PHONY: exec
exec: ebtables ebtables-restore
@@ -178,7 +181,7 @@ exec: ebtables ebtables-restore
install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
.PHONY: install
-install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts
+install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts
mkdir -p $(DESTDIR)$(LIBDIR)
install -m 0755 extensions/*.so $(DESTDIR)$(LIBDIR)
install -m 0755 *.so $(DESTDIR)$(LIBDIR)