REAMDE, copyright: Correct locations for GPL, and contact info.
[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
c6106de8
IJ
10gituser= git
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\'
70b9d2e0 26 perl >>$@.new -pe 's/\\/\\\\/g; s/$$/\\/' <read-urlmap
d36c5f7b
IJ
27 mv -f $@.new $@
28
29%: %.in sedscript
30 set -e; \
31 sed -f sedscript <$< >$@.new; \
32 if test -x $<; then chmod +x $@.new; fi; \
33 mv -f $@.new $@
e9fec26a
TF
34
35install: all
c6106de8
IJ
36 mkdir -p $(libuserv) $(etcuserv) $(services) \
37 $(etcdir)/logrotate.d
38 install -d -o $(gituser) -g adm $(varloggit)
e9fec26a 39 cp git-daemon git-service $(libuserv)
70b9d2e0
IJ
40 cp git-upload-pack $(services)/git-upload-pack:new
41 cp git-urlmap $(etcuserv)/git-urlmap:new
c6106de8
IJ
42 cp logrotate $(etcdir)/logrotate.d/userv-git-daemon:new
43 set -e; for f in $(CONFIGS); do \
44 if test -f $$f; then continue; fi; \
45 mv $$f:new $$f; \
46 done
e9fec26a 47
4063cda3
IJ
48mkdocdir:
49 mkdir -p $(docdir)/userv-git-daemon
50
51install-docs: mkdocdir
52 cp README $(docdir)/userv-git-daemon/README
53
54install-examples: all mkdocdir
55 cp inetd.conf $(docdir)/userv-git-daemon/inetd.conf
56
03e9a8cd
IJ
57distclean clean:
58 rm -f $(TARGETS) *~
e9fec26a
TF
59
60# end