debian swirl logo

Back to the packages list libgd-perl

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2013
# Jonas Smedegaard 
# Description: Main Debian packaging script for GD
#
# 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 .

include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/perl-makemaker.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

DEB_UPSTREAM_PACKAGE = GD
DEB_UPSTREAM_URL = http://www.cpan.org/authors/id/L/LD/LDS

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , libgd2-dev | libgd2-xpm-dev, libjpeg-dev
CDBS_BUILD_DEPENDS += , libpng12-dev, libz-dev, libfreetype6-dev
CDBS_BUILD_DEPENDS += , libxpm-dev, libx11-dev

# Transitional quirk: libgd-gd2-perl and libgd-gd2-noxpm-perl merged
# TODO: drop after Jessie+1 (was introduced before Jessie)
CDBS_PROVIDES_$(pkg) = libgd-gd2-perl, libgd-gd2-noxpm-perl
oldpkgs-versioned = libgd-gd2-perl (<= 1:2.46-3.1), libgd-gd2-noxpm-perl (<= 1:2.46-2.1)
CDBS_BREAKS_$(pkg) = $(oldpkgs-versioned)
CDBS_REPLACES_$(pkg) = $(oldpkgs-versioned)

# Suppress some graphics (in addition to default stuff)
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(demos/font_list\.png|t/test.out.*|debian/(changelog|copyright(|_hints|_newhints)))$

DEB_INSTALL_DOCS_ALL += README.unix README.QUICKDRAW
DEB_INSTALL_EXAMPLES_ALL = demos bdf_scripts qd.pl

# qd.pl and bdf2gdfont.pl are installed as example scripts instead
binary-post-install/$(pkg)::
		find "$(DEB_DESTDIR)" -type f '(' -name '*qd.pl*' -or -name '*bdf2gdfont.pl*' ')' '!' -path '*/usr/share/doc/*' -delete

# Remove stray empty dirs (due to MakeMaker stupidity and above cleanup)
binary-post-install/$(pkg)::
		find "$(DEB_DESTDIR)" -depth -type d -empty -delete
		find "$(DEB_DESTDIR)" -type f -exec sed -i 's,/usr/local/bin/perl,/usr/bin/perl,' '{}' ';'

# Manually clean leftovers
clean::
		rm -f GD.html pod2html* pod2htmd.tmp pod2htmi.tmp .config.cache GD/Image.pm bdf_scripts/bdf2gdfont.pl Makefile.old

Builds:

libgd-perl
perl module wrapper for libgd - gd2 variant