3 PREFIX=/usr/local/share |
3 PREFIX=/usr/local/share |
4 LIBDIR=$(PREFIX)/mercurial-server |
4 LIBDIR=$(PREFIX)/mercurial-server |
5 DOCDIR=$(PREFIX)/doc/mercurial-server |
5 DOCDIR=$(PREFIX)/doc/mercurial-server |
6 ETCDIR=/etc/mercurial-server |
6 ETCDIR=/etc/mercurial-server |
7 NEWUSER=hg |
7 NEWUSER=hg |
|
8 HOMEDIR=/var/lib/mercurial-server |
8 DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/nwalsh |
9 DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/nwalsh |
9 |
10 |
10 INSTALL=install |
11 INSTALL=install |
11 |
12 |
12 build: build/html/index.html pythonbuild |
13 build: build/html/index.html pythonbuild |
|
14 |
|
15 setup-freebsd: installetc pythoninstall bsduseradd inituser |
13 |
16 |
14 setup-adduser: installfiles adduser inituser |
17 setup-adduser: installfiles adduser inituser |
15 |
18 |
16 # WARNING: this is experimental |
19 # WARNING: this is experimental |
17 setup-useradd: installfiles useradd inituser |
20 setup-useradd: installfiles useradd inituser |
18 |
21 |
19 installetc: |
22 installetc: |
20 $(INSTALL) -d $(DESTDIR)$(ETCDIR) |
23 $(INSTALL) -d $(DESTDIR)$(ETCDIR) |
21 $(INSTALL) -m 644 -t $(DESTDIR)$(ETCDIR) \ |
24 $(INSTALL) -m 644 src/init/conf/access.conf \ |
22 src/init/conf/access.conf |
25 $(DESTDIR)$(ETCDIR) |
23 $(INSTALL) -d $(DESTDIR)$(ETCDIR)/remote-hgrc.d |
26 $(INSTALL) -d $(DESTDIR)$(ETCDIR)/remote-hgrc.d |
24 $(INSTALL) -m 644 -t $(DESTDIR)$(ETCDIR)/remote-hgrc.d \ |
27 $(INSTALL) -m 644 \ |
25 src/init/conf/remote-hgrc.d/access.rc \ |
28 src/init/conf/remote-hgrc.d/access.rc \ |
26 src/init/conf/remote-hgrc.d/logging.rc |
29 src/init/conf/remote-hgrc.d/logging.rc \ |
|
30 $(DESTDIR)$(ETCDIR)/remote-hgrc.d |
27 $(INSTALL) -d $(DESTDIR)$(ETCDIR)/keys/root |
31 $(INSTALL) -d $(DESTDIR)$(ETCDIR)/keys/root |
28 $(INSTALL) -d $(DESTDIR)$(ETCDIR)/keys/users |
32 $(INSTALL) -d $(DESTDIR)$(ETCDIR)/keys/users |
29 |
33 |
30 installdoc: build/html/index.html |
34 installdoc: build/html/index.html |
31 $(INSTALL) -d $(DESTDIR)$(DOCDIR) |
35 $(INSTALL) -d $(DESTDIR)$(DOCDIR) |
41 fop -xml $^ -xsl $(DOCBOOK_XSL)/fo/docbook.xsl $@ |
45 fop -xml $^ -xsl $(DOCBOOK_XSL)/fo/docbook.xsl $@ |
42 |
46 |
43 pythonbuild: |
47 pythonbuild: |
44 python setup.py build |
48 python setup.py build |
45 |
49 |
46 pythoninstall: |
50 dot-mercurial: src/init/dot-mercurial-server.tmpl |
|
51 sed -e "s|_ETCDIR_|$(ETCDIR)|" \ |
|
52 src/init/dot-mercurial-server.tmpl \ |
|
53 > src/init/dot-mercurial-server |
|
54 |
|
55 pythoninstall: dot-mercurial |
47 python setup.py install \ |
56 python setup.py install \ |
48 --install-purelib=$(DESTDIR)$(LIBDIR) \ |
57 --install-purelib=$(DESTDIR)$(LIBDIR) \ |
49 --install-platlib=$(DESTDIR)$(LIBDIR) \ |
58 --install-platlib=$(DESTDIR)$(LIBDIR) \ |
50 --install-scripts=$(DESTDIR)$(LIBDIR) \ |
59 --install-scripts=$(DESTDIR)$(LIBDIR) \ |
51 --install-data=$(DESTDIR)$(LIBDIR) |
60 --install-data=$(DESTDIR)$(LIBDIR) |
52 |
61 |
53 installfiles: installetc installdoc pythoninstall |
62 installfiles: installetc installdoc pythoninstall |
54 |
63 |
55 adduser: |
64 adduser: |
56 adduser --system --shell /bin/sh --group --disabled-password \ |
65 adduser --system --shell /bin/sh --group --disabled-password \ |
57 --home /var/lib/mercurial-server \ |
66 --home $(HOMEDIR) \ |
58 --gecos "Mercurial repositories" $(NEWUSER) |
67 --gecos "Mercurial repositories" $(NEWUSER) |
59 |
68 |
60 # WARNING: this is experimental |
69 # WARNING: this is experimental |
61 useradd: |
70 useradd: |
62 useradd --system --shell /bin/sh \ |
71 useradd --system --shell /bin/sh \ |
63 --home /var/lib/mercurial-server --create-home \ |
72 --home $(HOMEDIR) --create-home \ |
64 --comment "Mercurial repositories" $(NEWUSER) |
73 --comment "Mercurial repositories" $(NEWUSER) |
65 |
74 |
|
75 bsduseradd: |
|
76 pw useradd $(NEWUSER) -c "Mercurial repositories" -m -s /bin/sh \ |
|
77 -d $(HOMEDIR) |
|
78 |
66 inituser: |
79 inituser: |
67 su -l -c "$(DESTDIR)$(LIBDIR)/init/hginit $(DESTDIR)$(LIBDIR)" $(NEWUSER) |
80 su $(NEWUSER) -c "$(DESTDIR)$(LIBDIR)/init/hginit $(DESTDIR)$(LIBDIR)" - |
68 |
81 |