contrib/debian/rules
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 06 Apr 2018 11:13:47 -0400
changeset 37766 925707ac2855
parent 34625 f1c2552c2de7
permissions -rwxr-xr-x
lfs: add the 'Authorization' property to the Batch API response, if present The client copies all of these properties under 'header' to the HTTP Headers of the subsequent GET or PUT request that it performs. That allows the Basic HTTP authentication used to authorize the Batch API request to also authorize the upload/download action. There's likely further work to do here. There's an 'authenticated' boolean key in the Batch API response that can be set, and there is an 'LFS-Authenticate' header that is used instead of 'WWW-Authenticate'[1]. (We likely need to support both, since some hosting solutions are likely to only respond with the latter.) In any event, this works with SCM Manager, so there is real world benefit. I'm limiting the headers returned to 'Basic', because that's all the lfs spec calls out. In practice, I've seen gitbucket emit custom header content[2]. [1] https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md#response-errors [2] https://github.com/gitbucket/gitbucket/blob/35655f33c7713f08515ed640ece0948acd6d6168/src/main/scala/gitbucket/core/servlet/GitRepositoryServlet.scala#L119
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26148
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
#!/usr/bin/make -f
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
# Uncomment this to turn on verbose mode.
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
# export DH_VERBOSE=1
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     5
CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l)
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     6
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
%:
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
	dh $@ --with python2
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
override_dh_auto_test:
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
	http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)"
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
override_dh_python2:
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
	dh_python2
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
	find debian/mercurial/usr/share -type d -empty -delete
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
override_dh_install:
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    18
	python$(PYVERS) setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
34406
0133ca39c688 deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents: 34405
diff changeset
    19
	# chg
0133ca39c688 deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents: 34405
diff changeset
    20
	make -C contrib/chg \
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    21
		DESTDIR="$(CURDIR)"/debian/mercurial \
34406
0133ca39c688 deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents: 34405
diff changeset
    22
		PREFIX=/usr \
0133ca39c688 deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents: 34405
diff changeset
    23
		clean install
26148
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    24
	# remove arch-independent python stuff
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    25
	find "$(CURDIR)"/debian/mercurial/usr/lib \
26148
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    26
		! -name '*.so' ! -type d -delete , \
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
		-type d -empty -delete
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    28
	python$(PYVERS) setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    29
	make install-doc PREFIX="$(CURDIR)"/debian/mercurial-common/usr
26148
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
	# remove arch-dependent python stuff
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    31
	find "$(CURDIR)"/debian/mercurial-common/usr/lib \
26148
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    32
		-name '*.so' ! -type d -delete , \
7f49efcaa9b4 debian: switch to using debhelper and dh_python2 to build debs
Augie Fackler <augie@google.com>
parents:
diff changeset
    33
		-type d -empty -delete
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    34
	cp contrib/hg-ssh "$(CURDIR)"/debian/mercurial-common/usr/bin
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    35
	mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    36
	cp contrib/hgk "$(CURDIR)"/debian/mercurial-common/usr/share/mercurial
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    37
	mkdir -p "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    38
	cp contrib/debian/*.rc "$(CURDIR)"/debian/mercurial-common/etc/mercurial/hgrc.d/
34406
0133ca39c688 deb: build and install chg
Kyle Lippincott <spectral@google.com>
parents: 34405
diff changeset
    39
	# completions
34625
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    40
	mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    41
	cp contrib/bash_completion "$(CURDIR)"/debian/mercurial-common/usr/share/bash-completion/completions/hg
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    42
	mkdir -p "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    43
	cp contrib/zsh_completion "$(CURDIR)"/debian/mercurial-common/usr/share/zsh/vendor-completions/_hg
f1c2552c2de7 build: "make deb" failed when the base path contained spaces
muxator <a.mux@inwind.it>
parents: 34406
diff changeset
    44
	rm "$(CURDIR)"/debian/mercurial-common/usr/bin/hg