debian swirl logo

Back to the packages list 4store

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010 Dave Beckett 
# Copyright © 2011-2012 Jonas Smedegaard 
# Description: Main Debian packaging script for 4store
#
# 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 of the License, 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 .

# This needs to run before inclusion of CDBS snippets
debian/control:: debian/control.in
DEB_PHONY_RULES += debian/control.in
debian/control.in::
		sed -e 's/__LIBPKGNAME__/$(libpkgname)/g' debian/control.in

-include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk

stem = 4store
abi = 0
libpkgname = lib$(stem)$(abi)
libname = lib$(stem)
pkgconfigfile = $(stem)-$(abi).pc

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

CDBS_BUILD_DEPENDS += , libpcre3-dev, libglib2.0-dev, ncurses-dev, libreadline-dev
CDBS_BUILD_DEPENDS += , libavahi-client-dev, libavahi-glib-dev, libstemmer-dev
CDBS_BUILD_DEPENDS += $(if $(DEB_NOEPOCH_VERSION:1.0%=),,$(comma) librasqal2-dev (<< 0.9.22)$(comma) libraptor1-dev)
CDBS_BUILD_DEPENDS += $(if $(DEB_NOEPOCH_VERSION:1.1%=),,$(comma) librasqal3-dev$(comma) libraptor2-dev)

DEB_UPSTREAM_URL = http://www.4store.org/download
DEB_UPSTREAM_TARBALL_BASENAME_MANGLE = s/-(\d)/-v$$1/
DEB_UPSTREAM_TARBALL_MD5 = e15773fa72bb885f2613a8778fcbb7b6

LDFLAGS += -Wl,-z,defs

# TODO: Enable when upstream supports overriding FS_STORE_ROOT
#DEB_MAKE_CHECK_TARGET = test

# Avoid installing virtually empty README, NEWS and ChangeLog files
DEB_INSTALL_DOCS_ALL = 
DEB_INSTALL_CHANGELOGS_ALL = 

DEB_DH_INSTALLINIT_ARGS = --no-start --update-rcd-params="defaults" --error-handler=installinit_error

# put aside upstream-shipped temp files during build but after copyright-check
upstreamtmpfiles = src/common/params.h \
			version.sh
pre-build:: debian/stamp-upstreamtmpstuff
debian/stamp-upstreamtmpstuff: debian/stamp-copyright-check
		for file in $(upstreamtmpfiles); do \
			[ ! -e $$file ] || [ -e $$file.upstream ] || cp $$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

# Let d-shlibs calculate development package dependencies
#  and handle shared library install
CDBS_BUILD_DEPENDS += , d-shlibs (>= 0.45~)
binary-post-install/$(libpkgname):: debian/stamp-local-shlibs-$(libname)
debian/stamp-local-shlibs-$(libname): binary-install/$(libpkgname)
		d-shlibmove --commit \
			--override s/libavahi-client.-dev/libavahi-client-dev/ \
			--override s/libavahi-common.-dev/libavahi-common-dev/ \
			--override s/libavahi-glib.-dev/libavahi-glib-dev/ \
			--movedev "debian/tmp/usr/include/*" usr/include/ \
			--movedev "debian/tmp/usr/lib/pkgconfig/$(pkgconfigfile)" usr/lib/pkgconfig/ \
			--devunversioned \
			--exclude-la \
			debian/tmp/usr/lib/$(libname).so
		touch $@
clean::
		rm -f debian/stamp-local-shlibs-$(libname)

Builds:

4store
rdf database storage and query engine -- database daemon
lib4store0
rdf database storage and query engine -- shared library
lib4store-dev
rdf database storage and query engine -- development files