~ubuntu-branches/ubuntu/vivid/sockjs-client/vivid

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Tonnerre LOMBARD
  • Date: 2013-12-31 15:15:11 UTC
  • Revision ID: package-import@ubuntu.com-20131231151511-uu8p4vjsatmqjajm
Tags: 0.3.4+dfsg-1
Initial release. Closes: #733821

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
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+.*)};')
 
6
DTYPE = +dfsg
 
7
VER  ?= $(subst $(DTYPE),,$(UVER))
 
8
 
 
9
export NODE_PATH=/usr/lib/nodejs/optparse
 
10
 
 
11
.PHONY: get-orig-source
 
12
 
 
13
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
 
14
        @
 
15
 
 
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..."
 
21
        mkdir $(PKG)-$(VER) \
 
22
        && tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
 
23
        || $(RM) -r $(PKG)-$(VER)
 
24
        @echo "# Cleaning-up..."
 
25
        cd $(PKG)-$(VER) \
 
26
        && find . -depth -type f -name '*.min.js' -exec $(RM) -f {} \; -printf 'removed %p\n'
 
27
        @echo "# Packing..."
 
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)"
 
31
 
 
32
# We cannot run the tests, we'd need sockjs-node for that.
 
33
override_dh_auto_test:
 
34
 
 
35
 
 
36
 
 
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
 
41
        dh_auto_clean
 
42
 
 
43
override_dh_auto_configure:
 
44
        ln -s /usr/share/javascript/json/json2.min.js lib/json2.min.js
 
45
        dh_auto_configure
 
46
 
 
47
override_dh_auto_build:
 
48
        make build
 
49
 
 
50
%:
 
51
        dh $@