Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[32b64f]: debian / rules Maximize Restore History

Download this file

rules    138 lines (123 with data), 4.4 kB

#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

VENDOR ?= Debian

# Automatically use dpatch iff:
# [1] debian/patches/00list is present;
# [2] dpatch is build-depended upon.
# It is an error (potential FTBFS) for [1] to be true but [2] not.
ifeq ($(CURDIR)/debian/patches/00list, $(shell ls "$(CURDIR)/debian/patches/00list" 2>/dev/null || true))
ifeq (, $(shell grep -E '^Build-Depends:(.+,)?[ \t]*dpatch\b' "$(CURDIR)/debian/control"))
$(error dpatch is not build-depended upon)
else
include /usr/share/dpatch/dpatch.make
endif
else # dummy target
patch unpatch:
	@:
ifneq (, $(shell grep -E '^Build-Depends:(.+,)?[ \t]*dpatch\b' "$(CURDIR)/debian/control"))
$(warning dpatch is unnecessarily build-depended upon)
endif
endif

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  confflags = --build $(DEB_HOST_GNU_TYPE)
else
  confflags = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# Debugging & logging selection via the DEB_BUILD_OPTIONS env var.
# This variable contains a space-separated list of options.
# Available options are:
#   debug	build with debug info
#   noopt	build without optimisation options
#   log		build with extremely verbose trace output (you don't want this)
BUILD_TARGET := all
INSTALL_TARGET := install
CFLAGS := -Wall
LDFLAGS := -Wl,-z,defs
DH_STRIP = dh_strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	BUILD_TARGET := debug
	INSTALL_TARGET := install-debug
#	CFLAGS += -g
#	LDFLAGS += -g
	DH_STRIP =
else
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O2
endif
	INSTALL_PROGRAM += -s
endif
ifneq (,$(findstring log,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -DLOG
endif

configure: patch configure-stamp
configure-stamp:
	dh_testdir
	./configure $(confflags) \
		    --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc \
		    --disable-integration-wizard --enable-watchdog \
		    --with-logo-format=image \
		    VENDOR_PKG_VERSION="`dpkg-parsechangelog | sed -ne '/^Version:/ { s/^.* //; p }'`; $(VENDOR)" \
		    GSSCMD=/usr/bin/gnome-screensaver-command \
		    XSSCMD=/usr/bin/xscreensaver-command \
		    XDGSSCMD=/usr/bin/xdg-screensaver \
		    CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
	touch configure-stamp

build: patch build-stamp
build-stamp: configure
	dh_testdir
	$(MAKE) $(BUILD_TARGET)
	touch build-stamp

clean: clean-tree unpatch
clean-tree:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp config.log debian/gxine.postinst
	-$(MAKE) distclean
	-test -r /usr/share/misc/config.sub && \
	  cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
	  cp -f /usr/share/misc/config.guess config.guess
	dh_clean


install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) $(INSTALL_TARGET) DESTDIR="$(CURDIR)/debian/tmp"
	awk 'BEGIN { s = "%s;" } { printf s, $$1; s = "%s;" }' <mime.extra >$(CURDIR)/debian/tmp/usr/share/gxine/mime.extra

debian/gxine.postinst: debian/gxine.postinst.in debian/rules
	sed -e s^@XINE_LIST@^`pkg-config --variable=xine_list libxine`^g <$< >$@

# Build architecture-independent files here.
binary-indep:
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install debian/gxine.postinst
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples misc/lircrc
	dh_installmenu
	dh_installmime
	dh_installchangelogs ChangeLog
	rm -rf "$(CURDIR)/debian/gxineplugin/usr/share/doc/gxineplugin"
	dh_install --sourcedir="$(CURDIR)/debian/tmp"
	mkdir -p "$(CURDIR)/debian/gxine/var/lib/xine" "$(CURDIR)/debian/gxineplugin/usr/share/lintian/overrides"
	cp -a "$(CURDIR)/debian/gxineplugin.lintian" "$(CURDIR)/debian/gxineplugin/usr/share/lintian/overrides/gxineplugin"
	$(DH_STRIP)
	dh_compress
	dh_link
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean clean-tree binary-indep binary-arch binary install configure patch unpatch