Makefile
author Paul Crowley <paul@lshift.net>
Mon, 09 Nov 2009 15:52:32 +0000
changeset 169 6b34a5421330
parent 168 f9bf8f84df7f
child 171 7b69d1d86254
permissions -rw-r--r--
Make the build target default
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
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     3
PREFIX=/usr/local/share
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     4
LIBDIR=$(PREFIX)/mercurial-server
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     5
DOCDIR=$(PREFIX)/doc/mercurial-server
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     6
ETCDIR=/etc/mercurial-server
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     7
NEWUSER=hg
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     8
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
     9
INSTALL=install
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    10
169
6b34a5421330 Make the build target default
Paul Crowley <paul@lshift.net>
parents: 168
diff changeset
    11
build: build/html/index.html pythonbuild
6b34a5421330 Make the build target default
Paul Crowley <paul@lshift.net>
parents: 168
diff changeset
    12
168
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    13
setup-adduser: installfiles adduser inituser
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    14
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    15
# WARNING: this is experimental
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    16
setup-useradd: installfiles useradd inituser
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    17
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    18
installetc:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    19
	$(INSTALL) -d $(ETCDIR)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    20
	$(INSTALL) -m 644 -t $(ETCDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    21
	    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
    22
	$(INSTALL) -d $(ETCDIR)/keys/root
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    23
	$(INSTALL) -d $(ETCDIR)/keys/user
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    24
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    25
installdoc: build/html/index.html
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    26
	$(INSTALL) -d $(DOCDIR)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    27
	$(INSTALL) -m 644 -t $(DOCDIR) README build/html/index.html
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    28
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    29
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
    30
	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
    31
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    32
pythonbuild:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    33
	python setup.py build
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    34
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    35
pythoninstall:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    36
	python setup.py install \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    37
	    --install-purelib=$(LIBDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    38
	    --install-platlib=$(LIBDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    39
	    --install-scripts=$(LIBDIR) \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    40
	    --install-data=$(LIBDIR)
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
installfiles: installetc installdoc pythoninstall 
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    43
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    44
adduser:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    45
	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
    46
	    --home /var/lib/mercurial-server \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    47
	    --gecos  "Mercurial repositories" $(NEWUSER)
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
# WARNING: this is experimental
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    50
useradd:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    51
	useradd --system --shell /bin/sh \
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    52
	    --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
    53
	    --comment  "Mercurial repositories" $(NEWUSER)
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    54
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    55
inituser:
f9bf8f84df7f Kill install in favour of setup.py and Makefile
Paul Crowley <paul@lshift.net>
parents:
diff changeset
    56
	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
    57