Codebase list sugar-artwork / debian/0.107.1-1 debian / rules
debian/0.107.1-1

Tree @debian/0.107.1-1 (Download .tar.gz)

rules @debian/0.107.1-1raw · history · blame

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2008-2012, 2015 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for sugar-artwork
#
# 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 3, 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, see <http://www.gnu.org/licenses/>.

include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/autoreconf.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkgbranch = $(basename $(DEB_UPSTREAM_VERSION))
pkg = sugar-themes
pkg-icon = sugar-icon-theme
pkg-gtk2 = gtk2-engines-sugar

# Adapt packaging in maintainer mode when targeting experimental branch:
#  * Switch git packaging branch
#  * Track any release (else only current branch)
ifneq (,$(DEB_MAINTAINER_MODE))
experimental := $(strip $(if \
	$(shell dpkg-parsechangelog \
		| grep -x 'Distribution: \(experimental\|UNRELEASED\)'),\
	yes))
watch-limit = $(if $(experimental),,$(pkgbranch)\\.)
debian-branch = $(if $(experimental),master,master-$(pkgbranch))
clean::
	perl -i -pe 's/\([\d.\\]*\.\*\)/($(watch-limit).*)/' \
		debian/watch
	perl -i -pe 's/^debian-branch *= *\K.*/$(debian-branch)/' \
		debian/gbp.conf
endif

DEB_UPSTREAM_PACKAGE = $(DEB_SOURCE_PACKAGE)
DEB_UPSTREAM_URL = http://download.sugarlabs.org/sources/sucrose/glucose/$(DEB_UPSTREAM_PACKAGE)
DEB_UPSTREAM_TARBALL_EXTENSION = tar.xz

# Suppress copyright check of PNG files (in addition to defaults)
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(cursor/sugar/.*\.png|debian/(changelog|copyright(|_hints|_newhints)))$

# Build-depend unversioned on debhelper
#  TODO: Drop when adopted in cdbs
CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper

# Needed by upstream build process
bdeps = libgtk2.0-dev, libgtk-3-dev, libglib2.0-dev, libcairo2-dev
bdeps +=, python-empy, icon-slicer, icon-naming-utils

# Needed by our packaging
bdeps +=, dh-autoreconf, gnome-common

# Needed (always/often) at runtime
#  * librsvg2-common used with GTK3
depends = $(pkg-icon)
recommends = fonts-dejavu-core, librsvg2-common
suggests = $(pkg-gtk2)

# Transitional quirk: split into engine and theme packages
#  * needed only until Wheezy. TODO: Drop when Wheezy no longer supported
obsoletes = sugar-artwork-0.84 (<= 0.84.4-3)
obsoletes +=, sugar-artwork-0.88 (<= 0.88.1-4)
obsoletes +=, sugar-artwork-0.96 (<= 0.96.2-2)
obsoletes +=, sugar-artwork-0.98 (<= 0.98.4-2)
obsoletes +=, sugar-artwork-0.104 (<= 0.104.1-1)

CDBS_BUILD_DEPENDS +=, $(bdeps)
CDBS_DEPENDS_$(pkg) +=, $(depends)
CDBS_RECOMMENDS_$(pkg) = $(recommends)
CDBS_SUGGESTS_$(pkg) = $(suggests)

define sugar-relations

# Transitional quirk: split into engine and theme packages
#  * needed only until Wheezy. TODO: Drop when Wheezy no longer supported
CDBS_REPLACES_$($1) +=, $(obsoletes)
CDBS_BREAKS_$($1) +=, $(obsoletes)

endef
$(foreach p,pkg pkg-icon pkg-gtk2,$(eval $(call sugar-relations,$(value p))))

# Multiarch quirks
#  * TODO: Stop depend on multiarch-support when Wheezy no longer supported
CDBS_PREDEPENDS_$(pkg-lib) = $(if $(DEB_HOST_MULTIARCH),multiarch-support)
DEB_CONFIGURE_EXTRA_FLAGS += --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)

DEB_DH_INSTALL_ARGS_ALL = --autodest
DEB_DH_INSTALL_ARGS_$(pkg) = /usr/share/themes
DEB_DH_INSTALL_ARGS_$(pkg-icon) = usr/share/icons
DEB_DH_INSTALL_ARGS_$(pkg-gtk2) = usr/lib/$(DEB_HOST_MULTIARCH)/gtk-2.0/*/engines/*.so

# Register icons for optional caching
binary-post-install/$(pkg-icon)::
	dh_icons -p$(cdbs_curpkg)