File: rules

package info (click to toggle)
phabricator 0~git20190207-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 71,728 kB
  • sloc: php: 552,244; sql: 16,997; ansic: 3,619; yacc: 2,503; sh: 754; xml: 519; lex: 488; cpp: 221; python: 186; makefile: 177; sed: 66
file content (62 lines) | stat: -rwxr-xr-x 2,514 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/make -f
# -*- Makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_ALWAYS_EXCLUDE=.gitignore:LICENSE

PKD   = $(abspath $(dir $(MAKEFILE_LIST)))
PKG   = "phabricator"
UVER  = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
DTYPE =
VER  ?= $(subst $(DTYPE),,$(UVER))

%:
	dh $@ -Nphabricator

override_dh_clean:
	debconf-updatepo
	dh_clean

ARCANIST = git://github.com/phacility/arcanist.git
LIBPHUTIL = git://github.com/phacility/libphutil.git
PHABRICATOR = git://github.com/phacility/phabricator.git
UDATE = $(shell date --rfc-3339=seconds --date='TZ="UTC" $(shell echo $(VER) | perl -ne 'print "$$1-$$2-$$3" if m/\+(?:git|svn|hg)(\d{4})(\d{2})(\d{2})/')')
get-orig-source: $(info I: UDATE=$(UDATE))
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Downloading..."
	mkdir -p phabricator-$(VER)/
	git clone $(ARCANIST) arcanist-$(VER)
	git clone $(LIBPHUTIL) libphutil-$(VER)
	git clone $(PHABRICATOR) phabricator-$(VER)/phabricator
	for P in arcanist-$(VER) libphutil-$(VER) phabricator-$(VER)/phabricator; do \
		cd $$P && git checkout $$(git log -n1 --format=%h --before="$(UDATE)") && cd -; \
	done
	echo "# Copying git revision number..."
	cd phabricator-$(VER); echo "based on git revision $$(git log -n1 --format=%H)." > phabricator/conf/local/VERSION; cd ..
	echo "# Cleaning-up..."
	$(RM) -r -v libphutil-$(VER)/src/parser/xhpast/bin/xhpast.exe
	$(RM) -r -v arcanist-$(VER)/bin/arc.bat
	@mv arcanist-$(VER)/resources/shell/bash-completion arcanist-$(VER)/resources/shell/arcanist.bash-completion
	cd phabricator-$(VER)/phabricator/ && \
	$(RM) -r -v externals/twilio-php/docs \
	    externals/wordlist \
	    webroot/rsrc/externals/font/fontawesome \
	    webroot/rsrc/externals/font/sourcesans \
	    webroot/rsrc/externals/d3
	$(RM) -r arcanist-$(VER)/.git* libphutil-$(VER)/.git* phabricator-$(VER)/phabricator/.git*
	@echo "# Packing..."
	XZ_OPT="-6v" tar -caf phabricator_$(VER).orig.tar.xz phabricator-$(VER)
	XZ_OPT="-6v" tar -caf phabricator_$(VER).orig-arcanist.tar.xz arcanist-$(VER)
	XZ_OPT="-6v" tar -caf phabricator_$(VER).orig-libphutil.tar.xz libphutil-$(VER)
	rm -rf phabricator-$(VER) arcanist-$(VER) libphutil-$(VER)

generate-manpage: debian/arc.1

debian/arc.pod: debian/arc.cat1
	debian/cat2pod < $< > $@

debian/arc.1: debian/arc.pod
	pod2man -r "" -c "User Commands" $< $@

.PHONY: override_dh_clean get-orig-source generate-manpage