#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2013-2016 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for MooX::Options
#
# 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-build.mk
include /usr/share/cdbs/1/rules/debhelper.mk

pkg = $(DEB_SOURCE_PACKAGE)

DEB_UPSTREAM_PACKAGE = MooX-Options
DEB_UPSTREAM_URL = http://www.cpan.org/modules/by-module/MooX

# Needed by upstream build process
bdeps = libmodule-build-perl (>= 0.421100)

# Needed by upstream build process and (always/often) at runtime
#  TODO: Tighten (build-)dependency on libgetopt-long-perl when in Debian
perl-deps = data-record json-maybexs intl moox-configfromfile
perl-deps += regexp-common unicode-linebreak
deps = $(patsubst %,$(comma) lib%-perl,$(perl-deps))
#deps +=, libgetopt-long-perl (>= 2.43)
deps +=, libgetopt-long-descriptive-perl (>= 0.099)
deps +=, perl (>= 5.19.5) | libmodule-metadata-perl (>= 1.000019)
deps +=, libmoo-perl (>= 1.003001)
deps +=, libpath-class-perl (>= 0.32)
deps-recommend = libterm-size-any-perl
recommends = libintl-xs-perl

# Needed (always/optionally) by upstream testsuite
perl-deps-test = capture-tiny role-tiny test-requires test-trap
perl-deps-test += try-tiny namespace-clean
deps-test = $(patsubst %,$(comma) lib%-perl,$(perl-deps-test))
deps-test +=, perl (>= 5.11.1) | libtest-simple-perl (>= 0.94)
deps-test-opt = libmoose-perl, libmoox-cmd-perl

CDBS_BUILD_DEPENDS +=, $(bdeps), $(deps), $(deps-recommend), $(deps-test), $(deps-test-opt)
CDBS_DEPENDS_$(pkg) = $(deps)
CDBS_RECOMMENDS_$(pkg) = $(deps-recommend), $(recommends)
