usr/src/cmd/mercurial/Makefile.sfw
author Jon Tibble <meths@btinternet.com>
Mon, 04 May 2015 14:04:39 +0100
branchoi_151a
changeset 254 9c2a4ac793f0
parent 180 1d4f536bdb9d
permissions -rw-r--r--
Bash patch catchup including shellshock

#
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident	"@(#)Makefile.sfw	1.12	10/01/08 SMI"

PROG = hg

EXDEMOFILES = convert-repo dumprevlog hg-relink hg-ssh hgdiff hgk rewrite-log \
	simplemerge undumprevlog

DEMOFILES = $(EXDEMOFILES) \
	bash_completion \
	git-viz/git-cat-file \
	git-viz/git-diff-tree \
	git-viz/git-rev-list \
	git-viz/git-rev-tree \
	git-viz/hg-viz \
	hgsh/Makefile \
	hgsh/hgsh.c \
	hgwebdir.fcgi \
	hgwebdir.wsgi \
	logo-droplets.svg \
	mercurial.el \
	mergetools.hgrc \
	mq.el \
	perf.py \
	python-hook-examples.py \
	sample.hgrc \
	tcsh_completion \
	tcsh_completion_build.sh \
	tmplrewrite.py \
	vim/HGAnnotate.vim \
	vim/hg-menu.vim \
	vim/hgcommand.vim \
	vim/patchreview.txt \
	vim/patchreview.vim \
	zsh_completion

MAN1FILES = hg.1
MAN5FILES = hgignore.5 hgrc.5

HGEXTPYFILES = \
	__init__.py \
	acl.py \
	bookmarks.py \
	bugzilla.py \
	children.py \
	churn.py \
	color.py \
	convert/__init__.py \
	convert/bzr.py \
	convert/common.py \
	convert/convcmd.py \
	convert/cvs.py \
	convert/cvsps.py \
	convert/darcs.py \
	convert/filemap.py \
	convert/git.py \
	convert/gnuarch.py \
	convert/hg.py \
	convert/monotone.py \
	convert/p4.py \
	convert/subversion.py \
	convert/transport.py \
	extdiff.py \
	fetch.py \
	gpg.py \
	graphlog.py \
	hgcia.py \
	hgk.py \
	highlight/__init__.py \
	highlight/highlight.py \
	interhg.py \
	keyword.py \
	mq.py \
	notify.py \
	pager.py \
	parentrevspec.py \
	patchbomb.py \
	purge.py \
	rebase.py \
	record.py \
	share.py \
	transplant.py \
	win32mbcs.py \
	win32text.py \
	zeroconf/Zeroconf.py \
	zeroconf/__init__.py

MERCPYFILES = \
	__init__.py \
	__version__.py \
	ancestor.py \
	archival.py \
	bundlerepo.py \
	byterange.py \
	changegroup.py \
	changelog.py \
	cmdutil.py \
	commands.py \
	config.py \
	context.py \
	copies.py \
	demandimport.py \
	dirstate.py \
	dispatch.py \
	encoding.py \
	error.py \
	extensions.py \
	fancyopts.py \
	filelog.py \
	filemerge.py \
	graphmod.py \
	hbisect.py \
	help.py \
	hg.py \
	hgweb/__init__.py \
	hgweb/common.py \
	hgweb/hgweb_mod.py \
	hgweb/hgwebdir_mod.py \
	hgweb/protocol.py \
	hgweb/request.py \
	hgweb/server.py \
	hgweb/webcommands.py \
	hgweb/webutil.py \
	hgweb/wsgicgi.py \
	hook.py \
	httprepo.py \
	i18n.py \
	ignore.py \
	keepalive.py \
	localrepo.py \
	lock.py \
	lsprof.py \
	lsprofcalltree.py \
	mail.py \
	manifest.py \
	match.py \
	mdiff.py \
	merge.py \
	node.py \
	patch.py \
	posix.py \
	repair.py \
	repo.py \
	revlog.py \
	simplemerge.py \
	sshrepo.py \
	sshserver.py \
	statichttprepo.py \
	store.py \
	streamclone.py \
	strutil.py \
	subrepo.py \
	templatefilters.py \
	templater.py \
	transaction.py \
	ui.py \
	url.py \
	util.py \
	verify.py \
	win32.py \
	windows.py

PYFILES = $(HGEXTPYFILES:%=hgext/%) $(MERCPYFILES:%=mercurial/%)

PYCFILES = $(PYFILES:%.py=%.pyc)

PYSOFILES = mercurial/base85.so mercurial/bdiff.so mercurial/diffhelpers.so \
	    mercurial/mpatch.so mercurial/osutil.so mercurial/parsers.so

TEMPLATEFILES = \
	atom/changelog.tmpl \
	atom/changelogentry.tmpl \
	atom/error.tmpl \
	atom/filelog.tmpl \
	atom/header.tmpl \
	atom/map \
	atom/tagentry.tmpl \
	atom/tags.tmpl \
	coal/header.tmpl \
	coal/map \
	gitweb/branches.tmpl \
	gitweb/changelog.tmpl \
	gitweb/changelogentry.tmpl \
	gitweb/changeset.tmpl \
	gitweb/error.tmpl \
	gitweb/fileannotate.tmpl \
	gitweb/filediff.tmpl \
	gitweb/filelog.tmpl \
	gitweb/filerevision.tmpl \
	gitweb/footer.tmpl \
	gitweb/graph.tmpl \
	gitweb/header.tmpl \
	gitweb/index.tmpl \
	gitweb/manifest.tmpl \
	gitweb/map \
	gitweb/notfound.tmpl \
	gitweb/search.tmpl \
	gitweb/shortlog.tmpl \
	gitweb/summary.tmpl \
	gitweb/tags.tmpl \
	map-cmdline.changelog \
	map-cmdline.compact \
	map-cmdline.default \
	monoblue/branches.tmpl \
	monoblue/changelog.tmpl \
	monoblue/changelogentry.tmpl \
	monoblue/changeset.tmpl \
	monoblue/error.tmpl \
	monoblue/fileannotate.tmpl \
	monoblue/filediff.tmpl \
	monoblue/filelog.tmpl \
	monoblue/filerevision.tmpl \
	monoblue/footer.tmpl \
	monoblue/graph.tmpl \
	monoblue/header.tmpl \
	monoblue/index.tmpl \
	monoblue/manifest.tmpl \
	monoblue/map \
	monoblue/notfound.tmpl \
	monoblue/search.tmpl \
	monoblue/shortlog.tmpl \
	monoblue/summary.tmpl \
	monoblue/tags.tmpl \
	paper/branches.tmpl \
	paper/changeset.tmpl \
	paper/error.tmpl \
	paper/fileannotate.tmpl \
	paper/filediff.tmpl \
	paper/filelog.tmpl \
	paper/filelogentry.tmpl \
	paper/filerevision.tmpl \
	paper/footer.tmpl \
	paper/graph.tmpl \
	paper/header.tmpl \
	paper/index.tmpl \
	paper/manifest.tmpl \
	paper/map \
	paper/notfound.tmpl \
	paper/search.tmpl \
	paper/shortlog.tmpl \
	paper/shortlogentry.tmpl \
	paper/tags.tmpl \
	raw/changeset.tmpl \
	raw/error.tmpl \
	raw/fileannotate.tmpl \
	raw/filediff.tmpl \
	raw/index.tmpl \
	raw/manifest.tmpl \
	raw/map \
	raw/notfound.tmpl \
	rss/changelog.tmpl \
	rss/changelogentry.tmpl \
	rss/error.tmpl \
	rss/filelog.tmpl \
	rss/filelogentry.tmpl \
	rss/header.tmpl \
	rss/map \
	rss/tagentry.tmpl \
	rss/tags.tmpl \
	spartan/branches.tmpl \
	spartan/changelog.tmpl \
	spartan/changelogentry.tmpl \
	spartan/changeset.tmpl \
	spartan/error.tmpl \
	spartan/fileannotate.tmpl \
	spartan/filediff.tmpl \
	spartan/filelog.tmpl \
	spartan/filelogentry.tmpl \
	spartan/filerevision.tmpl \
	spartan/footer.tmpl \
	spartan/graph.tmpl \
	spartan/header.tmpl \
	spartan/index.tmpl \
	spartan/manifest.tmpl \
	spartan/map \
	spartan/notfound.tmpl \
	spartan/search.tmpl \
	spartan/shortlog.tmpl \
	spartan/shortlogentry.tmpl \
	spartan/tags.tmpl \
	static/background.png \
	static/coal-file.png \
	static/coal-folder.png \
	static/excanvas.js \
	static/graph.js \
	static/hgicon.png \
	static/hglogo.png \
	static/style-coal.css \
	static/style-gitweb.css \
	static/style-monoblue.css \
	static/style-paper.css \
	static/style.css \
	template-vars.txt

PYTHON26LIB= /usr/lib/python2.6/vendor-packages

ROOTPYTHON26LIB= $(ROOT)$(PYTHON26LIB)

ROOTDEMOFILES = $(DEMOFILES:%=$(ROOTUSRDEMO)/mercurial/%)
ROOTEXDEMOFILES = $(EXDEMOFILES:%=$(ROOTUSRDEMO)/mercurial/%)

ROOTPY26FILES = $(PYFILES:%=$(ROOTPYTHON26LIB)/%)
ROOTPYFILES = $(ROOTPY26FILES)
ROOTPYC26FILES = $(PYCFILES:%=$(ROOTPYTHON26LIB)/%)
ROOTPYCFILES = $(ROOTPYC26FILES)
ROOTPYSO26FILES = $(PYSOFILES:%=$(ROOTPYTHON26LIB)/%)
ROOTPYSOFILES = $(ROOTPYSO26FILES)
ROOTTEMPLATE26FILES = $(TEMPLATEFILES:%=$(ROOTPYTHON26LIB)/mercurial/templates/%)
ROOTTEMPLATEFILES = $(ROOTTEMPLATE26FILES)

include ../Makefile.cmd

$(ROOTDEMOFILES) := FILEMODE= 0444
$(ROOTEXDEMOFILES) := FILEMODE= 0555
$(ROOTPYFILES) := FILEMODE= 0444
$(ROOTPYCFILES) := FILEMODE= 0444
$(ROOTPYSOFILES) := FILEMODE= 0555
$(ROOTTEMPLATEFILES) := FILEMODE= 0444

VER=mercurial-$(COMPONENT_VERSION:sh)
TARBALL=$(VER).tar.gz

all: $(VER)/build/proto

$(VER)/build/scripts-2.6/hg: $(VER)/setup.py
	cd $(VER); env CC=$(CC) $(PYTHON26) setup.py build \
		--executable=$(PYTHON26)

$(VER)/build/proto: $(VER)/build/scripts-2.6/hg
	cd $(VER); env CC=$(CC) $(PYTHON26) setup.py install --root=build/proto \
		--install-lib=$(PYTHON26LIB)

$(VER)/setup.py: $(VER)/.patched

test: install
	cd $(VER)/tests; \
	env PYTHONPATH=$(VER)/build/proto \
	$(PYTHON26) run-tests.py

install: all .WAIT $(ROOTPROG) \
	$(ROOTMAN1FILES) $(ROOTMAN5FILES) $(ROOTDEMOFILES) \
	$(ROOTPYFILES) $(ROOTPYCFILES) $(ROOTTEMPLATEFILES) $(ROOTPYSOFILES)

clean:
	-rm -rf $(VER) sunman

include ../Makefile.targ

# We touch the source file to zero out the low bits of the timestamp so future
# install runs don't re-install into the proto area.
INS.pyfile = $(INSTALL) -m $(FILEMODE) $< $@

$(ROOTBIN)/%: $(VER)/build/proto/usr/bin/%
	env PYTHON=$(PYTHON26) $(INS.pyfile)

$(ROOTUSRDEMO)/mercurial/%: $(VER)/contrib/%
	$(INS.pyfile)

$(ROOTUSRDEMO)/mercurial/%: $(VER)/%
	$(INS.pyfile)

$(ROOTPYTHON26LIB)/%.so: $(VER)/build/proto/$(PYTHON26LIB)/%.so
	$(SRC)/tools/post_process_so $<
	$(INS.pyfile)

$(ROOTPYTHON26LIB)/%: $(VER)/build/proto/$(PYTHON26LIB)/%
	$(INS.pyfile)

$(ROOTMAN1)/% $(ROOTMAN5)/%: sunman/%
	$(INS.pyfile)

sunman:
	mkdir -p sunman

SEDSCRIPTS = sunman.sed

sunman/hg.1 sunman/hgrc.5 := SEDSCRIPTS += $(@F).sed

sunman/%: sunman.sed sunman $(VER)/doc/%
	$(SED) $(SEDSCRIPTS:%=-f %) $< > $@