File: rules

package info (click to toggle)
tuxpaint 1:0.9.23-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 36,360 kB
  • sloc: ansic: 39,091; makefile: 1,199; sh: 514; php: 310; cpp: 119; python: 75
file content (176 lines) | stat: -rwxr-xr-x 5,963 bytes parent folder | download | duplicates (4)
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DH_ALWAYS_EXCLUDE=CVS

DPKG_EXPORT_BUILDFLAGS = 1
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)

ifeq ($(shell dpkg --print-architecture), x32)
   CFLAGS += -fPIC
   CXXFLAGS += -fPIC
   CPPFLAGS += -fPIC
endif

include /usr/share/dpkg/buildflags.mk

VER_DATE = $(shell date --utc --date="$$(dpkg-parsechangelog -SDate)" '+%Y-%m-%d')

# Needed for automatic dbgsym package
DEBUG_FLAGS += -g

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.

	touch configure-stamp


build-arch: configure-stamp build-arch-stamp
build-arch-stamp:
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE) clean
	dh_auto_build -- all PREFIX=/usr DEBUG_FLAGS="$(DEBUG_FLAGS)" VER_DATE="$(VER_DATE)"
	touch build-arch-stamp


build-indep: configure-stamp build-indep-stamp
build-indep-stamp:
	dh_testdir

	# Nothing to do here.

	touch build-indep-stamp


build: build-arch build-indep

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp configure-stamp

	$(MAKE) clean

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -A

	# tuxpaint:
	# - Note: install-icon is called here even though it seems
	#   it belongs in tuxpaint-data as it is needed for the menu
	#   icon.
	$(MAKE) install-bin install-kde install-icon \
	  install-importscript install-default-config install-bash-completion \
	  PREFIX=$(CURDIR)/debian/tuxpaint/usr \
	  CONFDIR=$(CURDIR)/debian/tuxpaint/etc/tuxpaint \
	  GNOME_PREFIX=$(CURDIR)/debian/tuxpaint/usr \
	  KDE_PREFIX=$(CURDIR)/debian/tuxpaint/usr/share/applnk \
	  X11_ICON_PREFIX=$(CURDIR)/debian/tuxpaint/usr/share/pixmaps/ \
	  COMPLETIONDIR=$(CURDIR)/debian/tuxpaint/usr/share/bash-completion/completions

	$(MAKE) install-magic-plugins \
	  PREFIX=$(CURDIR)/debian/tuxpaint-plugins-default/usr

	$(MAKE) install-magic-plugin-dev \
	  PREFIX=$(CURDIR)/debian/tuxpaint-dev/usr

	# tuxpaint-data:
	$(MAKE) install-data install-doc install-gettext install-kde-icons \
	  install-example-stamps install-example-starters install-example-templates \
	  install-im install-osk \
	  PREFIX=$(CURDIR)/debian/tuxpaint-data/usr \
	  KDE_ICON_PREFIX=$(CURDIR)/debian/tuxpaint-data/usr/share/icons \
	  GNOME_PREFIX=$(CURDIR)/debian/tuxpaint-data/usr \
	  DOC_PREFIX=$(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data

	# Cleanup after install-data, as we will symlink these fonts
	# to the ones provided by ttf-freefont and other font packages:
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/*.ttf
	rm -rf $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/*_docs/
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/ar.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/el.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/ka.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/ko.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/ta.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/te.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/th.ttf
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/fonts/locale/zh_TW.ttf

	# Cleanup after install-doc, removing extra changelog, license and install files.
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/CHANGES*
	rm -rf $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/COPYING*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/INSTALL*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/dejavu*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/*/COP*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/*/INSTAL*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/*/GNU*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/*/GPL*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/*/gpl*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/*/LICEN*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/de/ANBRINGEN*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/de/KOPIE*
	rm -f $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/sr/ojl*

	find $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data -name Makefile -exec rm -f {} \;
	rm -rf $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/magic-docs/src
	rm -rf $(CURDIR)/debian/tuxpaint-data/usr/share/doc/tuxpaint-data/nn

	# We already have an opendesktop-compliant desktop file, so this
	# one for KDE is redundant.
	rm -rf $(CURDIR)/debian/tuxpaint/usr/share/applnk

        # Add .desktop file
	cp ./src/tuxpaint.desktop $(CURDIR)/debian/tuxpaint/usr/share/applications

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_installmenu -i
	dh_installman -p tuxpaint-dev src/manpage/tp-magic-config.1
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	# remove unnecessary executable permission
	chmod 644 $(CURDIR)/debian/tuxpaint-data/usr/share/tuxpaint/starters/skyline-sf-dusk-back.jpeg
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	dh_installchangelogs -a docs/CHANGES.txt
	dh_installmenu -a
	dh_installcron -a
	dh_installman -a src/manpage/tuxpaint.1 src/manpage/tuxpaint-import.1
	dh_icons -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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