#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2009-2010 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for pyabiword
#
# 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_BUILDDIR = build
DEB_PYTHON_SYSTEM = pycentral
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include debian/cdbs/1/class/python-autotools.mk

DEB_UPSTREAM_URL = http://www.abisource.com/downloads/pyabiword/$(DEB_UPSTREAM_VERSION)
DEB_UPSTREAM_TARBALL_MD5 = 826ea3e4cdcdd11906ce8739d07e6c26

DEB_INSTALL_EXAMPLES_python-abiword = examples/*

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , libabiword-2.8-dev (>= 2.8.1-1.0), python-gtk2-dev

# workaround for missing build-dependencies of libabiword-2.8-dev
CDBS_BUILD_DEPENDS += , libfribidi-dev (>= 0.10.4), libglib2.0-dev (>= 2.6.0), libgsf-1-dev (>= 1.12), libwv-dev (>= 1.2.0), libenchant-dev (>= 1.2.0), libgoffice-0.8-dev, libgucharmap2-dev, libcairo-dev, libpango1.0-dev, libgtk2.0-dev (>= 2.12.0), librsvg2-dev (>= 2.16.0)

# force-clean builddir (cleanup bug in multiflavor routine?)
clean::
	rm -rf $(DEB_BUILDDIR)

# We need recent cdbs anyway, so can just as well include other
# backport-unfriendly features
CDBS_BUILD_DEPENDS += , devscripts (>= 2.10.7), dh-buildinfo

# Temporary cleanup of new dependencies not yet handled in main cdbs
CDBS_BUILD_DEPENDS := $(shell echo '$(CDBS_BUILD_DEPENDS)' | perl -pe '/\bcdbs \(>= 0\.4\.70~\)/ && s/\bcdbs *\(>= (0\.4\.63~|0\.4\.67~)\)/, /g')
