summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2009-12-19 16:20:01 (GMT)
committerChristian Pointner <equinox@helsinki.at>2009-12-19 16:20:01 (GMT)
commitd3ffc8927ec89893fee9671c1aa1398847035b54 (patch)
treea2a547f74229005538383dd4a67ae62a4546d76d /Makefile
parent3f70847018870884d611fa86a1d9643c7e2a9816 (diff)
fixed manpage problem
added install examples target
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 27 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b3bf3fd..02dc4a1 100644
--- a/Makefile
+++ b/Makefile
@@ -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