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 63
|
#!/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 $@
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 arcanist-$(VER)/src/parser/xhpast/bin/xhpast.exe
$(RM) -r -v arcanist-$(VER)/bin/arc.bat
@mv arcanist-$(VER)/support/shell/hooks/bash-completion.sh arcanist-$(VER)/support/shell/hooks/arcanist.bash-completion
chmod -x arcanist-$(VER)/support/unit/sleep.php
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
|