aboutsummaryrefslogtreecommitdiff
path: root/tools/Linux/packaging/debian/rules.hardy
blob: a7e14c7765e7e22ad58fda1a0a9896e3c0071cb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

# 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)
#get the svnversion if the file exists
SVNVERSION ?= $(shell dpkg-parsechangelog | grep '^Version:' | grep 'svn' | sed 's/.*svn\([[:digit:]]*\).*/\1/')

ifeq "$(SVNVERSION)" ""
	SVNVERSION = $(shell cat debian/svnrevision)
endif


clean:
	dh clean
	rm -f build-arch-stamp build-indep-stamp config-stamp

build:
	dh_testdir
	# Add here commands to configure the package.
	./bootstrap
	dh_auto_configure -- --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr --enable-goom --enable-vdpau \
		--enable-avahi SVN_REV="$(SVNVERSION)"
	dh build --after dh_auto_configure

binary: binary-arch binary-indep

binary-indep:
	dh binary-indep --until dh_installdirs 
	$(MAKE) install-web install-datas install-livedatas prefix=$(CURDIR)/debian/tmp/usr/
	mkdir -p $(CURDIR)/debian/tmp/usr/share/applications $(CURDIR)/debian/tmp/usr/share/pixmaps
	cp $(CURDIR)/tools/Linux/xbmc.png $(CURDIR)/debian/tmp/usr/share/pixmaps/
	cp $(CURDIR)/tools/Linux/xbmc.desktop $(CURDIR)/debian/tmp/usr/share/applications/
	# xbmc Live files 
	mkdir -p $(CURDIR)/debian/tmp/etc/init/
	cp $(CURDIR)/tools/XBMCLive/xbmc-live.conf $(CURDIR)/debian/tmp/etc/init/
	dh_install -i --sourcedir=$(CURDIR)/debian/tmp -XLICENCE -XLiberationSans-Regular.ttf -XLicence.txt -XLicense.txt
	# XBMC WEB POC
	dh_install -pxbmc-web ../../web/poc_jsonrpc usr/share/xbmc/web
	dh_installdocs -i
	dh binary-indep --after dh_installdocs

binary-arch:
	dh binary-arch --until dh_installdirs 
	$(MAKE) install-binaries install-arch prefix=$(CURDIR)/debian/tmp/usr/
	find "debian/tmp/usr/share/xbmc" -regextype posix-extended \
		-type f -iregex \
		".*\.so|.*\.vis|.*\.xbs|.*xbmc\.bin|.*xbmc-xrandr" | \
		while read FILE; do \
		NEW_LOCATION="$$(echo $$FILE | sed -e 's|usr/share|usr/lib|')"; \
		install -D "$$FILE" "$$NEW_LOCATION"; \
		rm "$$FILE"; \
		done
	$(MAKE) eventclients prefix=$(CURDIR)/debian/tmp/usr installdir=/usr WII_EXTRA_OPTS=-DCWIID_OLD
	dh_install -a --sourcedir=$(CURDIR)/debian/tmp -XLICENCE -XLiberationSans-Regular.ttf -XLicence.txt -XLicense.txt
	dh binary-arch --after dh_install --until dh_link
	find "debian/xbmc-bin/usr/lib" -regextype posix-extended -type f | \
		while read FILE; do \
		LINK_TARGET="$$(echo "$$FILE" | sed -e 's|debian/xbmc-bin/||')"; \
		LINK_DESTINATION="$$(echo "$$FILE" | sed -e 's|debian/xbmc-bin/usr/lib|usr/share|')"; \
		dh_link -pxbmc-bin "$$LINK_TARGET" "$$LINK_DESTINATION"; \
		done
	dh binary-arch --after dh_link --before dh_strip
	dh_strip -a --dbg-package=xbmc-dbg
	# We don't install shared libraries in standard locations so don't edit
	# postinst/postrm scripts to call ldconfig
	dh_makeshlibs -a -n
	dh binary-arch --after dh_makeshlibs

.PHONY: build clean binary-indep binary-arch binary