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)
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/')
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
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
27
.sconsign_linux2.dblite \
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 - )
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 $$$$)
41
ifneq (,$(DEBIAN_TAG))
42
get-orig-source: TAG = $(NULL)
44
get-orig-source: TAG = -r $(shell svn log --limit 1 $(CHROMIUM_URL) | grep ^r | head -1 | sed -e 's/^r\([^ ]*\).*/\1/')
46
get-orig-source: gos-all
48
get-current-source: TAG = -r $(DEBIAN_REVISION)
49
get-current-source: gos-all
51
gos-all: gos-co gos-pack
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
60
cd $(TMP_DIR)/src && find . -type f \( -iname \*.exe -o -iname \*.dll -o -iname \*.pdb \) -exec rm -fv {} \; > REMOVED-bin_only.txt
62
ifneq (,$(DEBIAN_TAG))
63
gos-pack: VERSION = $(shell echo $(DEBIAN_TAG) | cut -d= -f2)
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)
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)
77
@echo "# Done (created $(DEBIAN_NAME)_$(VERSION).orig.tar.gz)"
78
@ls -l $(DEBIAN_NAME)_$(VERSION).orig.tar.gz