Makefile
branchdebian
changeset 172 5dd3698fad54
parent 171 7b69d1d86254
child 173 ac7bd25849bd
equal deleted inserted replaced
118:107906bfe2c6 172:5dd3698fad54
       
     1 #!/usr/bin/env make -f
       
     2 
       
     3 TOPDIR=
       
     4 PREFIX=$(TOPDIR)/usr/local/share
       
     5 LIBDIR=$(PREFIX)/mercurial-server
       
     6 DOCDIR=$(PREFIX)/doc/mercurial-server
       
     7 ETCDIR=$(TOPDIR)/etc/mercurial-server
       
     8 NEWUSER=hg
       
     9 
       
    10 INSTALL=install
       
    11 
       
    12 build: build/html/index.html pythonbuild
       
    13 
       
    14 setup-adduser: installfiles adduser inituser
       
    15 
       
    16 # WARNING: this is experimental
       
    17 setup-useradd: installfiles useradd inituser
       
    18 
       
    19 installetc:
       
    20 	$(INSTALL) -d $(ETCDIR)
       
    21 	$(INSTALL) -m 644 -t $(ETCDIR) \
       
    22 	    src/init/conf/remote-hgrc src/init/conf/access.conf
       
    23 	$(INSTALL) -d $(ETCDIR)/keys/root
       
    24 	$(INSTALL) -d $(ETCDIR)/keys/user
       
    25 
       
    26 installdoc: build/html/index.html
       
    27 	$(INSTALL) -d $(DOCDIR)
       
    28 	$(INSTALL) -m 644 -t $(DOCDIR) README build/html/index.html
       
    29 
       
    30 build/html/index.html: doc/manual.docbook
       
    31 	xsltproc -o $@ /usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl $^
       
    32 
       
    33 pythonbuild:
       
    34 	python setup.py build
       
    35 
       
    36 pythoninstall:
       
    37 	python setup.py install \
       
    38 	    --install-purelib=$(LIBDIR) \
       
    39 	    --install-platlib=$(LIBDIR) \
       
    40 	    --install-scripts=$(LIBDIR) \
       
    41 	    --install-data=$(LIBDIR)
       
    42 
       
    43 installfiles: installetc installdoc pythoninstall 
       
    44 
       
    45 adduser:
       
    46 	adduser --system --shell /bin/sh --group --disabled-password \
       
    47 	    --home /var/lib/mercurial-server \
       
    48 	    --gecos  "Mercurial repositories" $(NEWUSER)
       
    49 
       
    50 # WARNING: this is experimental
       
    51 useradd:
       
    52 	useradd --system --shell /bin/sh \
       
    53 	    --home /var/lib/mercurial-server --create-home \
       
    54 	    --comment  "Mercurial repositories" $(NEWUSER)
       
    55 
       
    56 inituser:
       
    57 	su -l -c "$(LIBDIR)/init/hginit $(LIBDIR)" $(NEWUSER)
       
    58