#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2014 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Furl
#
# 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 = Furl
DEB_UPSTREAM_URL = http://www.cpan.org/authors/id/T/TO/TOKUHIROM

# Needed by upstream build
bdeps = perl (>= 5.13.10) | libcpan-meta-perl
bdeps +=, perl (>= 5.13.11) | libmodule-build-perl (>= 0.380000)

# Needed by upstream build and (always) at runtime
deps = libclass-accessor-lite-perl
deps +=, libhttp-parser-xs-perl (>= 0.11)

# Needed (optionally) by upstream testsuite and (often/seldom) at runtime
deps-test-opt-recommend = libhttp-cookiejar-perl, libio-socket-ssl-perl
deps-test-opt-recommend +=, libnet-idn-encode-perl
deps-test-opt-suggest = libhttp-message-perl

# Needed (always/optionally) by upstream testsuite
deps-test = libtest-requires-perl, libtest-tcp-perl
deps-test +=, perl (>= 5.13.4) | libtest-simple-perl (>= 0.96)
perl-deps-test-opt = http-proxy plack test-fake-httpd test-sharedfork uri
perl-deps-test-opt += test-valgrind plack-middleware-deflater io-callback
deps-test-opt = $(patsubst %,$(comma) lib%-perl,$(perl-deps-test-opt))
deps-test-opt +=, starlet

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