#!/usr/bin/make -f
# [debian/rules] for xserver-xorg-video-geode
#
# COPYRIGHT © 2007-2011 Martin-Éric Racine <martin-eric.racine@iki.fi>
#
# LICENSE
# This package 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 of the License or (at
# your option) any later version.
#
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/autotools.mk

DEB_CONFIGURE_EXTRA_FLAGS += --disable-static --with-pic

DEB_DBG_PACKAGE_ALL := xserver-xorg-video-geode-dbg
DEB_DH_STRIP_ARGS := --dbg-package=xserver-xorg-video-geode-dbg

# Check for xserver-xorg-dev (<< 1.7) Depends: xserver-xorg-core.
XMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
# Check for xserver-xorg-dev (<< 1.9) Provides: ABI.
VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
# Check for xserver-xorg-dev (>= 1.8) Depends: ABI, xserver-xorg-core.
VIDEODEP = $(shell cat /usr/share/xserver-xorg/videodrvdep 2>/dev/null)

.PHONY: xdepends
xdepends:
ifneq ($(XMINVERS),)
	# Building against xserver-xorg-dev (<< 1.7) Depends: xserver-xorg-core.
	echo "xserver:Depends=xserver-xorg-core (>= $(XMINVERS))" >> debian/xserver-xorg-video-geode.substvars
endif
ifneq ($(VIDEOABI),)
	# Building against xserver-xorg-dev (<< 1.9) Provides: ABI.
	echo "xserver:Provides=xserver-xorg-video-$(VIDEOABI)" >> debian/xserver-xorg-video-geode.substvars
endif
ifneq ($(VIDEODEP),)
	# Building against xserver-xorg-dev (>= 1.8) Depends: ABI, xserver-xorg-core.
	echo "xserver:Depends=$(VIDEODEP)" >> debian/xserver-xorg-video-geode.substvars
endif

install/xserver-xorg-video-geode:: xdepends

common-binary-post-install-arch common-binary-post-install-indep:: list-missing

#EOF
