1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2002-2008, 2010-2011, 2013-2015 Jonas Smedegaard <dr@jones.dk>
# 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 <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/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
# TODO: drop libgd-dev fallback after Jessie+1 (was introduced before Jessie)
CDBS_BUILD_DEPENDS +=, libgd-dev (>= 2) | libgd2-xpm-dev, libjpeg-dev
CDBS_BUILD_DEPENDS +=, libpng-dev, libz-dev, libfreetype6-dev
CDBS_BUILD_DEPENDS +=, libxpm-dev, libx11-dev
# Build-depend unversioned on debhelper
# TODO: Drop when adopted in cdbs
CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper
# 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)
# extract metadata from images and fonts before copyright check
CDBS_BUILD_DEPENDS +=, libregexp-assemble-perl, libimage-exiftool-perl
CDBS_BUILD_DEPENDS +=, libfont-ttf-perl
CDBS_BUILD_DEPENDS +=, libextutils-pkgconfig-perl
local_inspection_regex = gif|jpeg|png|tif|ttf
local_inspection_exif_regex = jpeg-.*|png-.*
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^((.*/)?[^/]+\.($(local_inspection_regex)|$(local_inspection_exif_regex))|debian/(changelog|copyright(|_hints|_newhints)))$$
debian/stamp-copyright-check: debian/stamp-extract-copyright
debian/stamp-extract-copyright:
find * -type f -regextype posix-extended \
-regex '.*\.($(local_inspection_regex))' \
-print0 | perl -0 debian/license-miner
find * -type f -regextype posix-extended \
-regex '.*\.($(local_inspection_exif_regex))' \
-printf 'exif:%p\0' | perl -0 debian/license-miner
touch $@
pre-build:: clean-extracted-copyright-during-build
clean-extracted-copyright-during-build: debian/stamp-copyright-check
find -type f -name '*.metadata_dump' -delete
clean::
find -type f -name '*.metadata_dump' -delete
rm -f debian/stamp-extract-copyright
# put aside upstream shipped autogenerated file during build
DEB_UPSTREAM_CRUFT_MOVE += GD/Image.pm bdf_scripts/bdf2gdfont.pl Makefile.old
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
|