|
1 #!/usr/bin/env make -f |
|
2 |
|
3 PREFIX=/usr/local/share |
|
4 LIBDIR=$(PREFIX)/mercurial-server |
|
5 DOCDIR=$(PREFIX)/doc/mercurial-server |
|
6 ETCDIR=/etc/mercurial-server |
|
7 NEWUSER=hg |
|
8 |
|
9 INSTALL=install |
|
10 |
|
11 setup-adduser: installfiles adduser inituser |
|
12 |
|
13 # WARNING: this is experimental |
|
14 setup-useradd: installfiles useradd inituser |
|
15 |
|
16 installetc: |
|
17 $(INSTALL) -d $(ETCDIR) |
|
18 $(INSTALL) -m 644 -t $(ETCDIR) \ |
|
19 src/init/conf/remote-hgrc src/init/conf/access.conf |
|
20 $(INSTALL) -d $(ETCDIR)/keys/root |
|
21 $(INSTALL) -d $(ETCDIR)/keys/user |
|
22 |
|
23 installdoc: build/html/index.html |
|
24 $(INSTALL) -d $(DOCDIR) |
|
25 $(INSTALL) -m 644 -t $(DOCDIR) README build/html/index.html |
|
26 |
|
27 build/html/index.html: doc/manual.docbook |
|
28 xsltproc -o $@ /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl $^ |
|
29 |
|
30 pythonbuild: |
|
31 python setup.py build |
|
32 |
|
33 build: build/html/index.html pythonbuild |
|
34 |
|
35 pythoninstall: |
|
36 python setup.py install \ |
|
37 --install-purelib=$(LIBDIR) \ |
|
38 --install-platlib=$(LIBDIR) \ |
|
39 --install-scripts=$(LIBDIR) \ |
|
40 --install-data=$(LIBDIR) |
|
41 |
|
42 installfiles: installetc installdoc pythoninstall |
|
43 |
|
44 adduser: |
|
45 adduser --system --shell /bin/sh --group --disabled-password \ |
|
46 --home /var/lib/mercurial-server \ |
|
47 --gecos "Mercurial repositories" $(NEWUSER) |
|
48 |
|
49 # WARNING: this is experimental |
|
50 useradd: |
|
51 useradd --system --shell /bin/sh \ |
|
52 --home /var/lib/mercurial-server --create-home \ |
|
53 --comment "Mercurial repositories" $(NEWUSER) |
|
54 |
|
55 inituser: |
|
56 su -l -c "$(LIBDIR)/init/hginit $(LIBDIR)" $(NEWUSER) |
|
57 |