#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright 2013, Vasudev Kamath <kamathvasudev@gmail.com>
# Copyright 2013-2017, Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Catmandu
#
# 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/class/perl-build.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

# Needed by upstream build and (always/seldom) at runtime
perl-deps = any-uri-escape cgi-expand clone config-onion data-compare data-uuid
perl-deps += hash-merge-simple io-handle-util www list-moreutils
perl-deps += mime-types module-info moo moox-aliases
perl-deps += parser-mgc path-iterator-rule path-tiny sub-exporter
perl-deps += text-csv text-hogan throwable try-tiny-byclass
perl-deps += uri yaml-libyaml asa namespace-clean
deps = $(patsubst %,$(comma) lib%-perl, $(perl-deps))
deps +=, libapp-cmd-perl (>= 0.330)
deps +=, libcpanel-json-xs-perl (>= 3.0213)
deps +=, libdata-util-perl (>= 0.66)
deps +=, liburi-template-perl (>= 0.22)
deps-suggest = liblog-any-adapter-log4perl-perl, liblog-log4perl-perl

# Needed by upstream testsuite
deps-test = libtest-lwp-useragent-perl, libtest-pod-perl
deps-test +=, liblog-any-perl (>= 1.03)
deps-test +=, libtest-deep-perl
deps-test +=, libtest-exception-perl (>= 0.43)
deps-test +=, perl (>= 5.19.5) | libtest-simple-perl (>= 0.99)

# Needed (always) at runtime
depends = liblog-any-perl

CDBS_BUILD_DEPENDS +=, $(deps), $(deps-suggest), $(deps-test)
CDBS_DEPENDS_$(pkg) = $(deps), $(depends)
CDBS_SUGGESTS_$(pkg) = $(deps-suggest)

# drop empty man pages
binary-fixup/$(pkg)::
	find debian/$(pkg)/usr/share/man/man3 -type f -size 20c -delete
