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
|
#!/usr/bin/make -f
PKD = $(abspath $(dir $(MAKEFILE_LIST)))
PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
UVER = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
DTYPE = +dfsg
VER ?= $(subst $(DTYPE),,$(UVER))
export NODE_PATH=/usr/lib/nodejs/optparse
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
@
$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
@echo "# Downloading..."
uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
@echo "# Extracting..."
mkdir $(PKG)-$(VER) \
&& tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
|| $(RM) -r $(PKG)-$(VER)
@echo "# Cleaning-up..."
cd $(PKG)-$(VER) \
&& find . -depth -type f -name '*.min.js' -exec $(RM) -f {} \; -printf 'removed %p\n'
@echo "# Packing..."
find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
| XZ_OPT="-9v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
&& $(RM) -r "$(PKG)-$(VER)"
# We cannot run the tests, we'd need sockjs-node for that.
override_dh_auto_test:
# Delete copyright-problematic files from the tests.
override_dh_auto_clean:
rm -f lib/json2.min.js tests/html/qunit.min.js
rm -f tests/html/static/jquery.min.js
dh_auto_clean
override_dh_auto_configure:
ln -s /usr/share/javascript/json/json2.min.js lib/json2.min.js
dh_auto_configure
override_dh_auto_build:
make build
%:
dh $@
|