debian swirl logo

Back to the packages list kannel-sqlbox

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2009-2010, Jonas Smedegaard 
# Description: Main Debian packaging script for sqlbox
#
# 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 .

DEB_AUTO_UPDATE_LIBTOOL = pre
DEB_AUTO_UPDATE_AUTOCONF = 2.64
DEB_AUTO_UPDATE_ACLOCAL = 1.11
DEB_AUTO_UPDATE_AUTOMAKE = 1.11
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_PACKAGE = sqlbox
DEB_UPSTREAM_URL = http://www.kannel.org/~aguerrieri/SqlBox/Releases
DEB_UPSTREAM_TARBALL_MD5 = d8d20828f9bdc50c46bd7f14238520bf

# workaround for docs not built by default
DEB_CONFIGURE_EXTRA_FLAGS += --enable-docs
DEB_MAKE_BUILD_TARGET = all docs

# workaround for broken autotools OLDJADE/JADE detection
#DEB_MAKE_ENVVARS += JADE=openjade
DEB_MAKE_EXTRA_ARGS += JADE=openjade

# workaround for FreeTDS only expected elow /usr/local by default
#  TODO: Enable when actually used (not just detected by autotools)
#DEB_CONFIGURE_EXTRA_FLAGS += --with-mssql=/usr

# Avoid virtually empty NEWS
DEB_INSTALL_DOCS_ALL = README UPGRADE

DEB_INSTALL_DOCS_ALL += doc/userguide.html doc/userguide.pdf

# bootstrap autotools files (CDBS normally only updates them)
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^Makefile.in|gw/Makefile.in|aclocal.m4|autotools/(missing|depcomp|install-sh|ltmain.sh)|configure|debian/(changelog|copyright(|_hints|_newhints))$
DEB_MAKE_CLEAN_TARGET = distclean
DEB_AUTOMAKE_ARGS = --add-missing --copy
pre-build::
		touch aclocal.m4
clean::
		rm -f Makefile.in aclocal.m4 autotools/depcomp autotools/install-sh autotools/missing configure gw/Makefile.in
		rm -f doc/userguide.html doc/userguide.pdf doc/userguide.ps doc/userguide.rtf

# put aside stray upstream-shipped autotools file during build but after copyright-check
upstreamtmpfiles = autotools/ltmain.sh
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

# Install configfile both as sample and (like upstream rpm script) for real
DEB_INSTALL_EXAMPLES_kannel-sqlbox = example/sqlbox.conf.example
binary-install/kannel-sqlbox::
		install -D -m 0640 example/sqlbox.conf.example $(DEB_DESTDIR)/etc/kannel/sqlbox.conf

# Needed by upstream build process
#  TODO: Move indirect deps to kannel-dev: libssl-dev, libmysqlclient-dev, libpam0g-dev, libxml2-dev
#  TODO: have kannel link against libsqlite0-dev, libsqlite3-dev and libpq-dev too, or libsdb?!?
#  TODO: Add openjade fallback to jade, when autotools OLDJADE/JADE detection is fixed
#  TODO: Enable freetds-dev dep when actually used (not just detected by autotools)
CDBS_BUILD_DEPENDS += , kannel-dev (>= 1.4.3), kannel-dev (<< 1.4.4)
CDBS_BUILD_DEPENDS += , libssl-dev, libmysqlclient-dev, libpam0g-dev, libxml2-dev
#CDBS_BUILD_DEPENDS += , freetds-dev
CDBS_BUILD_DEPENDS += , openjade, jadetex, texlive-base-bin, transfig, imagemagick, docbook-dsssl

Builds:

kannel-sqlbox
sql helper application for kannel wap and sms gateway