ipif: "include" looks for the file in the directory where "include" appears
[userv-utils] / git-daemon / Makefile
CommitLineData
e9fec26a
TF
1# Makefile for userv-git-daemon
2#
d36c5f7b
IJ
3# This was written by Tony Finch <dot@dotat.at> and subsequently
4# heavily modified by Ian Jackson <ijackson@chiark.greenend.org.uk>
e9fec26a
TF
5# You may do anything with it, at your own risk.
6# http://creativecommons.org/publicdomain/zero/1.0/
7
8include ../settings.make
9
f07baecf 10gituser= userv-git
c6106de8 11varloggit= $(varlog)/git
e9fec26a 12
c6106de8
IJ
13TARGETS= git-upload-pack inetd.conf git-daemon git-service logrotate
14
15SUBSTVARS= libuserv etcuserv varloggit gituser
16
17CONFIGS= $(services)/git-upload-pack \
18 $(etcuserv)/git-urlmap \
19 $(etcdir)/logrotate.d/userv-git-daemon
e9fec26a
TF
20
21all: $(TARGETS)
22
70b9d2e0 23sedscript: Makefile read-urlmap
d36c5f7b
IJ
24 echo >$@.new '$(foreach f, $(SUBSTVARS), s,@$f@,$($f),g; )'
25 echo >>$@.new '/@@READ_URLMAP@@/c\'
f34db0d4 26 @#'
70b9d2e0 27 perl >>$@.new -pe 's/\\/\\\\/g; s/$$/\\/' <read-urlmap
d36c5f7b
IJ
28 mv -f $@.new $@
29
30%: %.in sedscript
31 set -e; \
32 sed -f sedscript <$< >$@.new; \
33 if test -x $<; then chmod +x $@.new; fi; \
34 mv -f $@.new $@
e9fec26a
TF
35
36install: all
c6106de8
IJ
37 mkdir -p $(libuserv) $(etcuserv) $(services) \
38 $(etcdir)/logrotate.d
39 install -d -o $(gituser) -g adm $(varloggit)
e9fec26a 40 cp git-daemon git-service $(libuserv)
70b9d2e0
IJ
41 cp git-upload-pack $(services)/git-upload-pack:new
42 cp git-urlmap $(etcuserv)/git-urlmap:new
c6106de8
IJ
43 cp logrotate $(etcdir)/logrotate.d/userv-git-daemon:new
44 set -e; for f in $(CONFIGS); do \
45 if test -f $$f; then continue; fi; \
46 mv $$f:new $$f; \
47 done
e9fec26a 48
4063cda3
IJ
49mkdocdir:
50 mkdir -p $(docdir)/userv-git-daemon
51
52install-docs: mkdocdir
53 cp README $(docdir)/userv-git-daemon/README
54
55install-examples: all mkdocdir
56 cp inetd.conf $(docdir)/userv-git-daemon/inetd.conf
57
03e9a8cd
IJ
58distclean clean:
59 rm -f $(TARGETS) *~
e9fec26a
TF
60
61# end