diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -84,6 +84,11 @@ INSTALL_TARGETS += install-man REMOVE_TARGETS += remove-man endif +ifdef EXAMPLESDIR +INSTALL_TARGETS += install-examples +REMOVE_TARGETS += remove-examples +endif + install: all $(INSTALL_TARGETS) install-bin: $(EXECUTABLE) @@ -92,12 +97,30 @@ install-bin: $(EXECUTABLE) install-etc: $(INSTALL) -d $(DESTDIR)$(ETCDIR)/$(EXECUTABLE) - $(INSTALL) -m 755 newfile.sh $(DESTDIR)$(ETCDIR)/$(EXECUTABLE)/ + @ echo "example configurations can be found at $(EXAMPLESDIR)/$(EXECUTABLE)" > $(DESTDIR)$(ETCDIR)/$(EXECUTABLE)/README install-man: manpage $(INSTALL) -d $(DESTDIR)$(MANDIR)/man8/ $(INSTALL) -m 644 doc/rhdropbox.8 $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE).8 +install-examples: + $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE) + $(INSTALL) -m 644 etc/rhdropbox/autostart $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/autostart + @( cd 'etc/rhdropbox/' ; \ + for dir in `ls`; do \ + if [ -d $$dir ]; then \ + echo "install $$dir configuration" ; \ + cd $$dir ; \ + $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/$$dir ; \ + $(INSTALL) -m 644 config $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/$$dir/config ; \ + if [ -e 'newfile.sh' ]; then \ + $(INSTALL) -m 755 newfile.sh $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/$$dir/newfile.sh ; \ + fi ; \ + cd .. ; \ + fi ; \ + done \ + ) + uninstall: remove remove: $(REMOVE_TARGETS) @@ -106,7 +129,9 @@ remove-bin: rm -f $(DESTDIR)$(BINDIR)/$(EXECUTABLE) remove-etc: - rm -f $(DESTDIR)$(ETCDIR)/init.d/$(EXECUTABLE) + +remove-examples: + rm -rf $(DESTDIR)$(EXAMPLESDIR)/$(EXECUTABLE)/ remove-man: rm -f $(DESTDIR)$(MANDIR)/man8/$(EXECUTABLE).8 |