3
PKD = $(abspath $(dir $(MAKEFILE_LIST)))
4
PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
5
UVER = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
7
VER ?= $(subst $(DTYPE),,$(UVER))
9
export NODE_PATH=/usr/lib/nodejs/optparse
11
.PHONY: get-orig-source
13
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
16
$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
17
@echo "# Downloading..."
18
uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
19
$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
20
@echo "# Extracting..."
22
&& tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
23
|| $(RM) -r $(PKG)-$(VER)
24
@echo "# Cleaning-up..."
26
&& find . -depth -type f -name '*.min.js' -exec $(RM) -f {} \; -printf 'removed %p\n'
28
find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
29
| XZ_OPT="-9v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
30
&& $(RM) -r "$(PKG)-$(VER)"
32
# We cannot run the tests, we'd need sockjs-node for that.
33
override_dh_auto_test:
37
# Delete copyright-problematic files from the tests.
38
override_dh_auto_clean:
39
rm -f lib/json2.min.js tests/html/qunit.min.js
40
rm -f tests/html/static/jquery.min.js
43
override_dh_auto_configure:
44
ln -s /usr/share/javascript/json/json2.min.js lib/json2.min.js
47
override_dh_auto_build: