#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2009 Adrian Knoth <adi@drcomp.erfurt.thur.de>
# Copyright © 2010, 2012 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for calf
#
# 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 2, 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/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk

# suppress optional build-dependencies
CDBS_BUILD_DEPENDS_rules_upstream-tarball =
CDBS_BUILD_DEPENDS_rules_utils_copyright-check =
CDBS_BUILD_DEPENDS_rules_utils_buildinfo =

DEB_UPSTREAM_URL = http://downloads.sourceforge.net/calf

# Avoid useless linking
LDFLAGS += -Wl,--as-needed

# put aside upstream-shipped temp files during build but after copyright-check
upstreamtmpfiles = calf.desktop
pre-build:: debian/stamp-upstreamtmpstuff
debian/stamp-upstreamtmpstuff: debian/stamp-copyright-check
	for file in $(upstreamtmpfiles); do \
		[ ! -e $$file ] || [ -e $$file.upstream ] || mv $$file $$file.upstream; \
	done
	touch $@
clean::
	for file in $(upstreamtmpfiles); do \
		[ ! -e $$file.upstream ] || mv -f $$file.upstream $$file; \
	done
	rm -f debian/stamp-upstreamtmpstuff

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , libglib2.0-dev, libgtk2.0-dev, libreadline-dev, libexpat1-dev
CDBS_BUILD_DEPENDS += , libasound2-dev [linux-any]
CDBS_BUILD_DEPENDS += , ladspa-sdk, dssi-dev, libjack-dev, lv2-dev
CDBS_BUILD_DEPENDS += , libtool
