#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2009 Adrian Knoth <adi@drcomp.erfurt.thur.de>
# Copyright © 2010, 2012, 2013 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 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/>.

DEB_AUTO_UPDATE_AUTOCONF = 2.69

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

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

# Needed by upstream build process
libdev-deps = glib2.0 gtk2.0 readline expat1 jack fftw3 fluidsynth cairo2
deps = $(patsubst %,$(comma) lib%-dev,$(libdev-deps))
deps +=, libasound2-dev [linux-any], lv2-dev
deps +=, libtool

CDBS_BUILD_DEPENDS +=, $(deps)

# enable experimental plugins
DEB_CONFIGURE_EXTRA_FLAGS += --enable-experimental

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

# put aside upstream-shipped temp files during build but after copyright-check
DEB_UPSTREAM_CRUFT_MOVE = calf.desktop configure

install/calf-plugins::
	sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
