File: Makefile

package info (click to toggle)
mercurial-server 1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 280 kB
  • ctags: 60
  • sloc: python: 316; sh: 64; makefile: 59
file content (68 lines) | stat: -rw-r--r-- 1,992 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env make -f

PREFIX=/usr/local/share
LIBDIR=$(PREFIX)/mercurial-server
DOCDIR=$(PREFIX)/doc/mercurial-server
ETCDIR=/etc/mercurial-server
NEWUSER=hg
DOCBOOK_XSL=/usr/share/xml/docbook/stylesheet/nwalsh

INSTALL=install

build: build/html/index.html pythonbuild

setup-adduser: installfiles adduser inituser

# WARNING: this is experimental
setup-useradd: installfiles useradd inituser

installetc:
	$(INSTALL) -d $(DESTDIR)$(ETCDIR)
	$(INSTALL) -m 644 -t $(DESTDIR)$(ETCDIR) \
	    src/init/conf/access.conf
	$(INSTALL) -d $(DESTDIR)$(ETCDIR)/remote-hgrc.d
	$(INSTALL) -m 644 -t $(DESTDIR)$(ETCDIR)/remote-hgrc.d \
	    src/init/conf/remote-hgrc.d/access.rc \
	    src/init/conf/remote-hgrc.d/logging.rc
	$(INSTALL) -d $(DESTDIR)$(ETCDIR)/keys/root
	$(INSTALL) -d $(DESTDIR)$(ETCDIR)/keys/users

installdoc: build/html/index.html
	$(INSTALL) -d $(DESTDIR)$(DOCDIR)
	$(INSTALL) -m 644 -t $(DESTDIR)$(DOCDIR) README 
	$(INSTALL) -d $(DESTDIR)$(DOCDIR)/html
	$(INSTALL) -m 644 -t $(DESTDIR)$(DOCDIR)/html build/html/index.html

build/html/index.html: doc/manual.docbook
	xsltproc --nonet -o $@ $(DOCBOOK_XSL)/html/docbook.xsl $^

build/pdf/manual.pdf: doc/manual.docbook
	mkdir -p build/pdf
	fop -xml $^ -xsl $(DOCBOOK_XSL)/fo/docbook.xsl $@

pythonbuild:
	python setup.py build

pythoninstall:
	python setup.py install \
	    --install-purelib=$(DESTDIR)$(LIBDIR) \
	    --install-platlib=$(DESTDIR)$(LIBDIR) \
	    --install-scripts=$(DESTDIR)$(LIBDIR) \
	    --install-data=$(DESTDIR)$(LIBDIR)

installfiles: installetc installdoc pythoninstall 

adduser:
	adduser --system --shell /bin/sh --group --disabled-password \
	    --home /var/lib/mercurial-server \
	    --gecos  "Mercurial repositories" $(NEWUSER)

# WARNING: this is experimental
useradd:
	useradd --system --shell /bin/sh \
	    --home /var/lib/mercurial-server --create-home \
	    --comment  "Mercurial repositories" $(NEWUSER)

inituser:
	su -l -c "$(DESTDIR)$(LIBDIR)/init/hginit $(DESTDIR)$(LIBDIR)" $(NEWUSER)