#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright 2015 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Etoys
#
# 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/>.

DEB_AUTO_UPDATE_ACLOCAL = ,
DEB_AUTO_UPDATE_AUTOCONF = ,
DEB_AUTO_UPDATE_AUTOMAKE = ,

include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

DEB_MAKE_INSTALL_TARGET = install-etoys DESTDIR=$(cdbs_curdestdir)
DEB_INSTALL_DOCS_ALL := $(filter-out AUTHORS NEWS,$(DEB_INSTALL_DOCS_ALL))
DEB_INSTALL_DOCS_ALL += Content/NEWS

# Generate XPM application icon from SVG source
CDBS_BUILD_DEPENDS +=, librsvg2-bin, netpbm
build/$(pkg):: debian/activity-etoys.xpm
debian/activity-etoys.xpm: %.xpm:
	rsvg-convert -w 32 activity-etoys.svg > $*.png
	pngtopnm $*.png > $*.pgm
	pngtopnm -alpha $*.png > $*.alpha
	ppmtoxpm -alphamask=$*.alpha $*.pgm > $@
clean::
	rm -f debian/activity-etoys.*
