#!/usr/bin/make -f
DEB_PYTHON_SYSTEM = pycentral
# workaround for broken DEB_SUGAR_BRANCHES expansion in cdbs <= 0.4.75
DEB_SUGAR_BRANCHES = 0.86 0.88
DEB_PYTHON_SUGAR_PACKAGES = sugar-log-activity-0.86
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/python-sugar.mk
include /usr/share/cdbs/1/rules/debhelper.mk
# Suppress unneeded auto-resolved build-dependency on python-dev
CDBS_BUILD_DEPENDS_class_python-sugar_python = python$(cdbs_python_nondefault_version)
# Needed (always/often) at runtime
CDBS_DEPENDS = $(call cdbs_sugar_anybranchdeps,python-sugar python-sugar-toolkit)
CDBS_DEPENDS += , python-hippocanvas, python-telepathy, python-gtk2, python-cjson
CDBS_RECOMMENDS = $(call cdbs_sugar_anybranchdeps,sugar)
# Ensure only one variant is installed at a time (Debian Policy 7.6.2)
CDBS_PROVIDES = $(DEB_SUGAR_SOURCE_PKGBASE)
CDBS_CONFLICTS = $(DEB_SUGAR_SOURCE_PKGBASE)
CDBS_REPLACES = $(DEB_SUGAR_SOURCE_PKGBASE)
# Rules for fetching the upstream tarball
#
# Define the git repo and package name.
UPSTREAM_GIT=git://git.sugarlabs.org/log/mainline.git
# TODO: Automatically figure this out from the package name
PACKAGE_NAME=sugar-log-activity
# NB: Don't touch this unless it's broken.
CURRENT_TREEISH =$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*git.{9}([^-]+).*,\1,p')
CURVER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
SOURCE_DIR=$(PACKAGE_NAME)-$(CURVER)
TARBALL=$(PACKAGE_NAME)_$(CURVER).orig.tar.gz
$(SOURCE_DIR):
git clone $(UPSTREAM_GIT) $(SOURCE_DIR)
if [ x$(CURRENT_TREEISH) = x ]; then \
cd $(SOURCE_DIR) && git checkout v$(CURVER); \
else \
cd $(SOURCE_DIR) && git checkout $(CURRENT_TREEISH); \
fi
cd $(SOURCE_DIR) && rm -rf .git*
$(TARBALL): $(SOURCE_DIR)
tar czvf $(TARBALL) $(SOURCE_DIR)
get-orig-source: $(TARBALL)
rm -rf $(SOURCE_DIR) $(SOURCE_DIR).temp
clean::
find -name *.mo -delete
find -name *.linfo -delete
rm -f MANIFEST
install/sugar-log-activity-0.86::
rm -f debian/sugar-log-activity-0.86/usr/share/sugar/activities/Log.activity/COPYING