~chromium-team/chromium-browser/artful-beta

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Fabien Tassin
  • Date: 2008-11-10 22:08:21 UTC
  • Revision ID: fta@ubuntu.com-20081110220821-bbe0gkgpu4kbobr4
* Initial revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# These are used for cross-compiling and for saving the configure script
 
4
# from having to guess our platform (since we know it already)
 
5
DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
6
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
7
DEB_BUILD_ARCH          ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 
8
 
 
9
DEBIAN_NAME             := chrome
 
10
DEBIAN_VERSION          := $(shell dpkg-parsechangelog | sed -n 's/^Version: *\(.*\)$$/\1/ p')
 
11
DEBIAN_UPSTREAM_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/^\(.*\)-[^-]*$$/\1/')
 
12
DEBIAN_REVISION         := $(shell echo $(DEBIAN_VERSION) | sed 's/^.*r\([^-]*\).*/\1/')
 
13
 
 
14
DEB_TAR_SRCDIR := $(DEBIAN_NAME)
 
15
SRC_DIR        := $(CURDIR)/build-tree/$(DEBIAN_NAME)
 
16
DEB_BUILDDIR   := $(SRC_DIR)/chrome
 
17
DEB_SCONS_ARGS := --site-dir=$(SRC_DIR)/site_scons
 
18
 
 
19
include /usr/share/cdbs/1/rules/tarball.mk
 
20
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 
21
include /usr/share/cdbs/1/rules/debhelper.mk
 
22
include $(CURDIR)/debian/cdbs/scons.mk
 
23
 
 
24
INSTALL_EXCLUDES = \
 
25
        lib \
 
26
        obj \
 
27
        .sconsign_linux2.dblite \
 
28
        $(NULL)
 
29
 
 
30
# Install: there's no install rules in scons yet, do it manually
 
31
binary-install/$(DEBIAN_NAME)::
 
32
        mkdir -p debian/$(DEBIAN_NAME)/usr/lib/$(DEBIAN_NAME)
 
33
        ( cd $(SRC_DIR)/chrome/Hammer ; tar $(foreach excl,$(INSTALL_EXCLUDES),--exclude=$(excl)) -cf - . ) | \
 
34
        ( cd debian/$(DEBIAN_NAME)/usr/lib/$(DEBIAN_NAME) ; tar xvf - )
 
35
 
 
36
# Tarball (get-orig-source & get-current-source)
 
37
GCLIENT_URL  := http://src.chromium.org/svn/trunk/depot_tools/linux
 
38
CHROMIUM_URL := http://src.chromium.org/svn/trunk/src
 
39
TMP_DIR      := $(DEBIAN_NAME)-$(shell echo $$$$)
 
40
 
 
41
ifneq (,$(DEBIAN_TAG))
 
42
get-orig-source: TAG  = $(NULL)
 
43
else
 
44
get-orig-source: TAG  = -r $(shell svn log --limit 1 $(CHROMIUM_URL) | grep ^r | head -1 | sed -e 's/^r\([^ ]*\).*/\1/')
 
45
endif
 
46
get-orig-source: gos-all
 
47
 
 
48
get-current-source: TAG = -r $(DEBIAN_REVISION)
 
49
get-current-source: gos-all
 
50
 
 
51
gos-all: gos-co gos-pack
 
52
gos-co:
 
53
        rm -rf $(TMP_DIR)
 
54
        mkdir $(TMP_DIR)
 
55
        # Checkout
 
56
        svn co $(GCLIENT_URL) $(TMP_DIR)/depot_tools
 
57
        cd $(TMP_DIR) && ./depot_tools/gclient config $(CHROMIUM_URL)
 
58
        cd $(TMP_DIR) && ./depot_tools/gclient sync
 
59
        # Remove binaries
 
60
        cd $(TMP_DIR)/src && find . -type f \( -iname \*.exe -o -iname \*.dll -o -iname \*.pdb \) -exec rm -fv {} \; > REMOVED-bin_only.txt
 
61
        
 
62
ifneq (,$(DEBIAN_TAG))
 
63
gos-pack: VERSION  = $(shell echo $(DEBIAN_TAG) | cut -d= -f2)
 
64
else
 
65
gos-pack: REVISION = $(shell cd $(TMP_DIR)/src && svn log --xml --limit 1 | grep -E '^( *revision=|<date>)' | tr -d '\n' | \
 
66
                     sed -e 's/.*"\([0-9]*\)".*>\(....\)-\(..\)-\(..\)T.*/\2\3\4r\1/')
 
67
gos-pack: VERSION  = $(shell cut -d= -f2 $(TMP_DIR)/src/chrome/VERSION | sed -e 's,$$,.,' | tr -d '\n' | sed -e 's/.$$//')~svn$(REVISION)
 
68
endif
 
69
gos-pack:
 
70
        # Pack
 
71
        mv $(TMP_DIR)/src $(TMP_DIR)/$(DEBIAN_NAME)
 
72
        cd $(TMP_DIR) && tar jcf $(DEBIAN_NAME)-$(VERSION)-source.tar.bz2 --exclude=.svn $(DEBIAN_NAME)
 
73
        mkdir $(TMP_DIR)/$(DEBIAN_NAME)-$(VERSION)
 
74
        mv $(TMP_DIR)/$(DEBIAN_NAME)-$(VERSION)-source.tar.bz2 $(TMP_DIR)/$(DEBIAN_NAME)-$(VERSION)
 
75
        cd $(TMP_DIR) && tar zcf ../$(DEBIAN_NAME)_$(VERSION).orig.tar.gz $(DEBIAN_NAME)-$(VERSION)
 
76
        rm -rf $(TMP_DIR)
 
77
        @echo "# Done (created $(DEBIAN_NAME)_$(VERSION).orig.tar.gz)"
 
78
        @ls -l $(DEBIAN_NAME)_$(VERSION).orig.tar.gz