Makefile
author Paul Crowley <paul@lshift.net>
Mon, 09 Nov 2009 17:36:33 +0000
branchdebian
changeset 183 6569a18b8a52
parent 173 ac7bd25849bd
child 184 ec3047e1dadc
permissions -rw-r--r--
Added tag debian_0.7 for changeset 95c9ab8e4bfc

#!/usr/bin/env make -f

TOPDIR=
PREFIX=$(TOPDIR)/usr/local/share
LIBDIR=$(PREFIX)/mercurial-server
DOCDIR=$(PREFIX)/doc/mercurial-server
ETCDIR=$(TOPDIR)/etc/mercurial-server
NEWUSER=hg

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 $(ETCDIR)
	$(INSTALL) -m 644 -t $(ETCDIR) \
	    src/init/conf/remote-hgrc src/init/conf/access.conf
	$(INSTALL) -d $(ETCDIR)/keys/root
	$(INSTALL) -d $(ETCDIR)/keys/users

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

build/html/index.html: doc/manual.docbook
	xsltproc -o $@ /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl $^

pythonbuild:
	python setup.py build

pythoninstall:
	python setup.py install \
	    --install-purelib=$(LIBDIR) \
	    --install-platlib=$(LIBDIR) \
	    --install-scripts=$(LIBDIR) \
	    --install-data=$(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 "$(LIBDIR)/init/hginit $(LIBDIR)" $(NEWUSER)