- install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
- $(CP) -a templates/* $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
+ install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
+ for dir in `cd underlays && find . -follow -type d ! -regex '.*\.svn.*'`; do \
+ install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
+ for file in `find underlays/$$dir -follow -maxdepth 1 -type f`; do \
+ cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null || \
+ install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
+ done; \
+ done
+
+ # The directive docs become their own special underlay.
+ install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive
+ for file in doc/ikiwiki/directive/*; do \
+ if [ -f "$$file" ]; then \
+ install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \
+ fi \
+ done
+
+ # Install example sites.
+ for dir in `cd doc/examples; find . -type d ! -regex '.*\.svn.*'`; do \
+ install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \
+ done
+ for file in `cd doc/examples; find . -type f ! -regex '.*\.svn.*'`; do \
+ cp -aL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null || \
+ install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
+ done