Include CDBS upstream-tarball.mk, replacing local get-orig-source target.
Jonas Smedegaard
8 years ago
6 | 6 | DEB_SUGAR_BRANCHES = 0.86 0.88 |
7 | 7 | DEB_PYTHON_SUGAR_PACKAGES = $(pkg) |
8 | 8 | |
9 | include /usr/share/cdbs/1/rules/upstream-tarball.mk | |
9 | 10 | include /usr/share/cdbs/1/rules/utils.mk |
10 | 11 | include /usr/share/cdbs/1/class/python-sugar.mk |
11 | 12 | include /usr/share/cdbs/1/rules/debhelper.mk |
13 | ||
14 | DEB_UPSTREAM_PACKAGE = Log | |
15 | DEB_UPSTREAM_URL = http://download.sugarlabs.org/sources/sucrose/fructose/$(DEB_UPSTREAM_PACKAGE) | |
16 | DEB_UPSTREAM_TARBALL_EXTENSION = tar.bz2 | |
12 | 17 | |
13 | 18 | # Suppress unneeded auto-resolved build-dependency on python-dev |
14 | 19 | CDBS_BUILD_DEPENDS_class_python-sugar_python = python$(cdbs_python_nondefault_version) |
23 | 28 | CDBS_CONFLICTS_$(pkg) = $(DEB_SUGAR_SOURCE_PKGBASE) |
24 | 29 | CDBS_REPLACES_$(pkg) = $(DEB_SUGAR_SOURCE_PKGBASE) |
25 | 30 | |
26 | # Rules for fetching the upstream tarball | |
27 | # | |
28 | # Define the git repo and package name. | |
29 | UPSTREAM_GIT=git://git.sugarlabs.org/log/mainline.git | |
30 | # TODO: Automatically figure this out from the package name | |
31 | PACKAGE_NAME=sugar-log-activity | |
32 | ||
33 | # NB: Don't touch this unless it's broken. | |
34 | CURRENT_TREEISH =$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*git.{9}([^-]+).*,\1,p') | |
35 | CURVER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p') | |
36 | ||
37 | SOURCE_DIR=$(PACKAGE_NAME)-$(CURVER) | |
38 | TARBALL=$(PACKAGE_NAME)_$(CURVER).orig.tar.gz | |
39 | ||
40 | $(SOURCE_DIR): | |
41 | git clone $(UPSTREAM_GIT) $(SOURCE_DIR) | |
42 | if [ x$(CURRENT_TREEISH) = x ]; then \ | |
43 | cd $(SOURCE_DIR) && git checkout v$(CURVER); \ | |
44 | else \ | |
45 | cd $(SOURCE_DIR) && git checkout $(CURRENT_TREEISH); \ | |
46 | fi | |
47 | cd $(SOURCE_DIR) && rm -rf .git* | |
48 | ||
49 | $(TARBALL): $(SOURCE_DIR) | |
50 | tar czvf $(TARBALL) $(SOURCE_DIR) | |
51 | ||
52 | get-orig-source: $(TARBALL) | |
53 | rm -rf $(SOURCE_DIR) $(SOURCE_DIR).temp | |
54 | ||
55 | 31 | clean:: |
56 | 32 | find -name *.mo -delete |
57 | 33 | find -name *.linfo -delete |