debian swirl logo

Back to the packages list sugar-moon-activity

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Portions Copyright © 2008-2010 Jonas Smedegaard 
# Description: Main Debian packaging script for PACKAGE_NAME
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.

DEB_SUGAR_BRANCHES = 0.86 0.88
DEB_PYTHON_SUGAR_PACKAGES = sugar-moon-activity
DEB_PYTHON2_MODULE_PACKAGES = sugar-moon-activity


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


# Needed (always/often) at runtime
CDBS_DEPENDS = $(call cdbs_sugar_anybranchdeps,python-sugar python-sugar-toolkit)
CDBS_DEPENDS += , python-telepathy, python-gtk2
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)

# Suppress unneeded auto-resolved build-dependency on python-dev
CDBS_BUILD_DEPENDS_class_python-sugar_python = python$(cdbs_python_nondefault_version)

# Rules for fetching the upstream tarball
# Define the git repo and package name.
UPSTREAM_GIT= git://git.sugarlabs.org/moon/mainline.git
# TODO: Automatically figure this out from the package name
PACKAGE_NAME= sugar-moon-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-moon-activity::
		rm -f debian/sugar-moon-activity/usr/share/sugar/activities/Moon.activity/COPYING
		rm -f debian/sugar-moon-activity/usr/share/sugar/activities/Moon.activity/port/COPYING

Builds:

sugar-moon-activity
sugar moon activity