File: rules

package info (click to toggle)
psi-plus 0.16.330-1.3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 23,368 kB
  • ctags: 26,365
  • sloc: cpp: 193,961; ansic: 9,115; xml: 3,217; sh: 672; objc: 406; makefile: 301; python: 196; ruby: 171
file content (91 lines) | stat: -rwxr-xr-x 3,428 bytes parent folder | download
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
90
91
#!/usr/bin/make -f

Q_CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
Q_CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(Q_CPPFLAGS)
Q_CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(Q_CPPFLAGS)
Q_LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
export Q_CPPFLAGS Q_CFLAGS Q_CXXFLAGS Q_LDFLAGS

Q_OPTS = "QMAKE_CXXFLAGS += $(Q_CXXFLAGS)" \
         "QMAKE_CFLAGS_DEBUG += $(Q_CFLAGS)" \
         "QMAKE_CFLAGS_RELEASE += $(Q_CFLAGS)" \
         "QMAKE_LFLAGS += $(Q_LDFLAGS)"

PACKAGE = psi-plus

DEBIAN_PATH := $(abspath $(dir $(MAKEFILE_LIST)))
USCAN_REPORT = $(shell uscan --noconf --report --dehs $(DEBIAN_PATH))
CUR_VER = $(shell echo "$(USCAN_REPORT)" | sed -n 's/.*<upstream-version>\(.*\)<\/upstream-version>.*/\1/p')
CUR_URL = $(shell echo "$(USCAN_REPORT)" | sed -n 's/.*<upstream-url>\(.*\)<\/upstream-url>.*/\1/p')

QMAKE=qmake-qt4
QCONF=qt-qconf
CONF=--enable-plugins --enable-whiteboarding --debug --no-separate-debug-info

# Selecting all plugins
plugins_generic = $(notdir $(wildcard $(CURDIR)/src/plugins/generic/*plugin ) )
plugins_unix = $(notdir $(wildcard $(CURDIR)/src/plugins/unix/*plugin ) )

%:
	dh $@ --parallel

override_dh_auto_configure:
	#$(QCONF)
	./configure --prefix=/usr $(CONF)

override_dh_auto_build:
	dh_auto_build
	$(foreach plug,$(plugins_generic), cd $(CURDIR)/src/plugins/generic/$(plug) && $(QMAKE) $(Q_OPTS) && $(MAKE) || exit 1; )
	$(foreach plug,$(plugins_unix), cd $(CURDIR)/src/plugins/unix/$(plug) && $(QMAKE) $(Q_OPTS) && $(MAKE) || exit 1; )

override_dh_auto_install:
	$(MAKE) INSTALL_ROOT=$(CURDIR)/debian/psi-plus install
	# Making the same, but using webkit
	$(MAKE) clean
	sed -i 's| (|-webkit (|' version
	./configure --prefix=/usr $(CONF) --enable-webkit
	dh_auto_build
	$(MAKE) INSTALL_ROOT=$(CURDIR)/debian/psi-plus-webkit install
	sed -i 's|-webkit||' version
	rm $(CURDIR)/debian/psi-plus-webkit/usr/bin/psi-plus
	rm $(CURDIR)/debian/psi-plus-webkit/usr/share/applications/psi-plus.desktop
	cp $(CURDIR)/psi-plus $(CURDIR)/debian/psi-plus-webkit/usr/bin/psi-plus-webkit
	cp $(CURDIR)/debian/psi-plus-webkit.desktop $(CURDIR)/debian/psi-plus-webkit/usr/share/applications/
	# Deleting temporary files
	rm $(CURDIR)/debian/psi-plus/usr/share/psi-plus/COPYING
	rm $(CURDIR)/debian/psi-plus-webkit/usr/share/psi-plus/COPYING

override_dh_install:
	dh_install
	# Exporting all from psi-plus-common
	./debian/mergedups.sh
	# Deleting extra copy of sound files
	rm -r $(CURDIR)/debian/psi-plus-common/usr/share/psi-plus/sound/

override_dh_auto_clean:
	dh_clean
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f config.sub config.guess #configure

	rm -f psi-plus src/psi-plus src/config.h
	rm -f Makefile src/Makefile libpsi/psiwidgets/Makefile
	rm -f conf.pri extra.pri conf.log
	rm -f src/.qmake.internal.cache

	rm -rf iris/lib iris/conf.pri
	rm -rf .qconftemp

	$(foreach plug,$(plugins_generic), cd $(CURDIR)/src/plugins/generic/$(plug) && [ ! -f Makefile ] || $(MAKE) distclean; )
	$(foreach plug,$(plugins_unix), cd $(CURDIR)/src/plugins/unix/$(plug) && [ ! -f Makefile ] || $(MAKE) distclean; )

	rm -rf .pc_psi
	sed -i 's|-webkit||' version

override_dh_strip:
	dh_strip -ppsi-plus --dbg-package=psi-plus-dbg
	dh_strip -ppsi-plus-webkit --dbg-package=psi-plus-webkit-dbg
	dh_strip -ppsi-plus-plugins --dbg-package=psi-plus-plugins-dbg
	dh_strip --remaining-packages

get-orig-source:
	wget -c4 "$(CUR_URL)" -O "$(PACKAGE)_$(CUR_VER).orig.tar.gz"