#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2009-2010, Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Pinot
#
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.

-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://download.berlios.de/pinot
DEB_UPSTREAM_TARBALL_MD5 = 873e34082e3cbe32b7fea3598c1c0514

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

# Explicitly enable >2TB file support (as added in upstream SVN r1635)
CPPFLAGS += -D_FILE_OFFSET_BITS=64

# Limit linking to actually used libs
LDFLAGS += -Wl,--as-needed

DEB_DH_MAKESHLIBS_ARGS = -Xusr/lib/pinot

binary-fixup/pinot::
	chmod a+x $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/pinot/*.sh

binary-install/pinot::
	rm -rf $(CURDIR)/debian/$(cdbs_curpkg)/usr/lib/deskbar-applet/
	dh_icons

# Needed by upstream build process
CDBS_BUILD_DEPENDS += , libcurl4-openssl-dev, libxapian-dev (>= 1.0.3), libboost-dev
CDBS_BUILD_DEPENDS += , libtextcat-dev, libtag1-dev (>= 1.4), libsqlite3-dev (>= 3.1)
CDBS_BUILD_DEPENDS += , libgmime-2.6-dev, libxml++2.6-dev (>= 2.12), libdbus-glib-1-dev
CDBS_BUILD_DEPENDS += , libsigc++-2.0-dev (>= 2.0), libglib2.0-dev (>= 2.6), libssl-dev (>= 0.9.7)
CDBS_BUILD_DEPENDS += , libglibmm-2.4-dev (>= 2.6), libgtkmm-2.4-dev (>= 2.10), shared-mime-info
CDBS_BUILD_DEPENDS += , desktop-file-utils, libexif-dev (>= 0.6), libattr1-dev

# Needed for our packaging
CDBS_BUILD_DEPENDS += , python-support
