X-Git-Url: https://git.distorted.org.uk/~mdw/userv-utils/blobdiff_plain/e9fec26ad6b6fdbdf77a2422f7b0bdf2eeb5e07b..1ba0145fe6fe72f63af15e12716c13071523eaa4:/git-daemon/Makefile diff --git a/git-daemon/Makefile b/git-daemon/Makefile index 07969cd..ea76975 100644 --- a/git-daemon/Makefile +++ b/git-daemon/Makefile @@ -1,28 +1,60 @@ # Makefile for userv-git-daemon # -# This was written by Tony Finch +# This was written by Tony Finch and subsequently +# heavily modified by Ian Jackson # You may do anything with it, at your own risk. # http://creativecommons.org/publicdomain/zero/1.0/ include ../settings.make -TARGETS= git-upload-pack inetd.conf +gituser= git +varloggit= $(varlog)/git -SUBSTVARS= libuserv etcuserv -SEDSCRIPT= '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )' +TARGETS= git-upload-pack inetd.conf git-daemon git-service logrotate + +SUBSTVARS= libuserv etcuserv varloggit gituser + +CONFIGS= $(services)/git-upload-pack \ + $(etcuserv)/git-urlmap \ + $(etcdir)/logrotate.d/userv-git-daemon all: $(TARGETS) -%: %.in - sed $(SEDSCRIPT) <$< >$@.new && mv -f $@.new $@ +sedscript: Makefile read-urlmap + echo >$@.new '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )' + echo >>$@.new '/@@READ_URLMAP@@/c\' + perl >>$@.new -pe 's/\\/\\\\/g; s/$$/\\/' $@.new; \ + if test -x $<; then chmod +x $@.new; fi; \ + mv -f $@.new $@ install: all - mkdir -p $(libuserv) $(etcuserv) $(services) + mkdir -p $(libuserv) $(etcuserv) $(services) \ + $(etcdir)/logrotate.d + install -d -o $(gituser) -g adm $(varloggit) cp git-daemon git-service $(libuserv) - cp git-upload-pack $(services) - cp git-urlmap $(etcuserv) + cp git-upload-pack $(services)/git-upload-pack:new + cp git-urlmap $(etcuserv)/git-urlmap:new + cp logrotate $(etcdir)/logrotate.d/userv-git-daemon:new + set -e; for f in $(CONFIGS); do \ + if test -f $$f; then continue; fi; \ + mv $$f:new $$f; \ + done + +mkdocdir: + mkdir -p $(docdir)/userv-git-daemon + +install-docs: mkdocdir + cp README $(docdir)/userv-git-daemon/README + +install-examples: all mkdocdir + cp inetd.conf $(docdir)/userv-git-daemon/inetd.conf -clean: - rm -f $(TARGETS) +distclean clean: + rm -f $(TARGETS) *~ # end