Makefile
author Paul Crowley <paul@lshift.net>
Tue, 10 Nov 2009 16:20:32 +0000
branchdebian
changeset 199 8b47b329815b
parent 194 b1ddf7ced7e7
child 202 8f15d7d90f08
permissions -rw-r--r--
Added tag debian_0.8-1 for changeset 1e4050abb96e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     1
#!/usr/bin/env make -f
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     2
171
7b69d1d86254 Add TOPDIR variable
Paul Crowley <paul@lshift.net>
parents: 169
diff changeset
     3
TOPDIR=
7b69d1d86254 Add TOPDIR variable
Paul Crowley <paul@lshift.net>
parents: 169
diff changeset
     4
PREFIX=$(TOPDIR)/usr/local/share
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     5
LIBDIR=$(PREFIX)/mercurial-server
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     6
DOCDIR=$(PREFIX)/doc/mercurial-server
171
7b69d1d86254 Add TOPDIR variable
Paul Crowley <paul@lshift.net>
parents: 169
diff changeset
     7
ETCDIR=$(TOPDIR)/etc/mercurial-server
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     8
NEWUSER=hg
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     9
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    10
INSTALL=install
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    11
169
6b34a5421330 Make the build target default
Paul Crowley <paul@lshift.net>
parents: 168
diff changeset
    12
build: build/html/index.html pythonbuild
6b34a5421330 Make the build target default
Paul Crowley <paul@lshift.net>
parents: 168
diff changeset
    13
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    14
setup-adduser: installfiles adduser inituser
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    15
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    16
# WARNING: this is experimental
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    17
setup-useradd: installfiles useradd inituser
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    18
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    19
installetc:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    20
	$(INSTALL) -d $(ETCDIR)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    21
	$(INSTALL) -m 644 -t $(ETCDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    22
	    src/init/conf/remote-hgrc src/init/conf/access.conf
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    23
	$(INSTALL) -d $(ETCDIR)/keys/root
173
ac7bd25849bd Fix directory creation
Paul Crowley <paul@lshift.net>
parents: 171
diff changeset
    24
	$(INSTALL) -d $(ETCDIR)/keys/users
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    25
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    26
installdoc: build/html/index.html
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    27
	$(INSTALL) -d $(DOCDIR)
194
b1ddf7ced7e7 Move html docs into their own directory
Paul Crowley <paul@lshift.net>
parents: 184
diff changeset
    28
	$(INSTALL) -m 644 -t $(DOCDIR) README 
b1ddf7ced7e7 Move html docs into their own directory
Paul Crowley <paul@lshift.net>
parents: 184
diff changeset
    29
	$(INSTALL) -d $(DOCDIR)/html
b1ddf7ced7e7 Move html docs into their own directory
Paul Crowley <paul@lshift.net>
parents: 184
diff changeset
    30
	$(INSTALL) -m 644 -t $(DOCDIR)/html build/html/index.html
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    31
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    32
build/html/index.html: doc/manual.docbook
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    33
	xsltproc -o $@ /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl $^
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    34
184
ec3047e1dadc Add PDF building to Makefile
Paul Crowley <paul@lshift.net>
parents: 173
diff changeset
    35
build/pdf/manual.pdf: doc/manual.docbook
ec3047e1dadc Add PDF building to Makefile
Paul Crowley <paul@lshift.net>
parents: 173
diff changeset
    36
	mkdir -p build/pdf
ec3047e1dadc Add PDF building to Makefile
Paul Crowley <paul@lshift.net>
parents: 173
diff changeset
    37
	fop -xml $^ -xsl /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl $@
ec3047e1dadc Add PDF building to Makefile
Paul Crowley <paul@lshift.net>
parents: 173
diff changeset
    38
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    39
pythonbuild:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    40
	python setup.py build
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    41
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    42
pythoninstall:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    43
	python setup.py install \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    44
	    --install-purelib=$(LIBDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    45
	    --install-platlib=$(LIBDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    46
	    --install-scripts=$(LIBDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    47
	    --install-data=$(LIBDIR)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    48
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    49
installfiles: installetc installdoc pythoninstall 
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    50
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    51
adduser:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    52
	adduser --system --shell /bin/sh --group --disabled-password \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    53
	    --home /var/lib/mercurial-server \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    54
	    --gecos  "Mercurial repositories" $(NEWUSER)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    55
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    56
# WARNING: this is experimental
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    57
useradd:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    58
	useradd --system --shell /bin/sh \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    59
	    --home /var/lib/mercurial-server --create-home \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    60
	    --comment  "Mercurial repositories" $(NEWUSER)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    61
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    62
inituser:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    63
	su -l -c "$(LIBDIR)/init/hginit $(LIBDIR)" $(NEWUSER)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    64