chiark / gitweb /
Changes to make it appear to work on chiark
[userv-utils.git] / git-daemon / Makefile
index 2d24274af9ae26b2346b7fbffe1b18281938b1b8..1a18f66dbafa9faceba604a2b646df0f4c9622b8 100644 (file)
@@ -9,14 +9,14 @@ include ../settings.make
 
 TARGETS=       git-upload-pack inetd.conf git-daemon git-service
 
 
 TARGETS=       git-upload-pack inetd.conf git-daemon git-service
 
-SUBSTVARS=     libuserv etcuserv
+SUBSTVARS=     libuserv etcuserv varlog
 
 all:           $(TARGETS)
 
 
 all:           $(TARGETS)
 
-sedscript:     Makefile
+sedscript:     Makefile read-urlmap
                echo >$@.new '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )'
                echo >>$@.new '/@@READ_URLMAP@@/c\'
                echo >$@.new '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )'
                echo >>$@.new '/@@READ_URLMAP@@/c\'
-               perl >>$@.new -pe 's/$$/\\/' <read-urlmap
+               perl >>$@.new -pe 's/\\/\\\\/g; s/$$/\\/' <read-urlmap
                mv -f $@.new $@
 
 %:             %.in sedscript
                mv -f $@.new $@
 
 %:             %.in sedscript
@@ -28,8 +28,12 @@ sedscript:   Makefile
 install:       all
                mkdir -p $(libuserv) $(etcuserv) $(services)
                cp git-daemon git-service $(libuserv)
 install:       all
                mkdir -p $(libuserv) $(etcuserv) $(services)
                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
+               set -e; cd $(services); test -f git-upload-pack \
+                       || mv git-upload-pack:new git-upload-pack
+               set -e; cd $(etcuserv); test -f git-urlmap \
+                       || mv git-urlmap:new git-urlmap
 
 clean:
                rm -f $(TARGETS)
 
 clean:
                rm -f $(TARGETS)