File: rules

package info (click to toggle)
tupi 0.1%2Bgit12-6
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 38,308 kB
  • sloc: cpp: 68,390; ansic: 4,376; ruby: 938; xml: 514; python: 268; sh: 190; makefile: 45
file content (69 lines) | stat: -rwxr-xr-x 2,475 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
#!/usr/bin/make -f
# -*- makefile -*-

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

PDIR     := $(CURDIR)/debian/tupi
QM_FILES := $(patsubst %.ts, %.qm, $(wildcard src/shell/data/translations/*.ts))

export LFLAGS= -Wl,--as-needed $(LDFLAGS)
$(info LFLAGS=$(LFLAGS))

%:
	dh $@

$(QM_FILES):
	# rebuild translations
	lupdate tupi.pro -locations none -silent -ts $(@:.qm=.ts)
	lrelease $(@:.qm=.ts)

override_dh_auto_clean:
	# remove pre-generated binaries
	cd configure.tests \
	&& for dir in opengl ffmpeg aspell; do $(RM) $$dir/$$dir $$dir/*.o $$dir/Makefile; done
	$(RM) launcher/tupi launcher/tupi.desktop $(QM_FILES)
	# fix wrong upstream permissions
	chmod -R a-x+X . \
	&& chmod +x configure debian/rules
	dh_auto_clean

override_dh_auto_configure: $(QM_FILES)
	# arch-dependent patching
	cat debian/patches/series.$(DEB_HOST_ARCH_OS) >> debian/patches/series \
	&& $(RM) debian/patches/series.$(DEB_HOST_ARCH_OS) \
	&& dh_quilt_patch || return 0
	# override qonf/defaults.rb
	ruby configure.rb --debian-build=1 \
                      --with-debug \
                      --prefix=$(PDIR)/usr \
                      --bindir=$(PDIR)/usr/lib/tupi/bin \
                      --libdir=$(PDIR)/usr/lib/tupi \
                      --sharedir=$(PDIR)-data/usr/share/tupi \
                      --includedir=$(PDIR)-dev/usr/include/tupi
	# force qmake-generated Makefiles to respect dpkg-provided flags
	perl -pi -e 'local $$/; $$_=<>; s{((CX?X?|L)FLAGS\s*)=}{$$1+=}g;' `find . -name Makefile`

override_dh_auto_install:
	dh_auto_install
	$(RM) $(PDIR)/usr/share/man/man1/tupi.1.gz
	mv $(PDIR)/usr/lib/tupi/tupi/plugins/* $(PDIR)/usr/lib/tupi/plugins/ \
	&& $(RM) -r $(PDIR)/usr/lib/tupi/tupi
	convert launcher/icons/tupi_32x32.png $(PDIR)/usr/share/pixmaps/tupi_32x32.xpm
	# patch the launcher for the correct paths
	mkdir "$(PDIR)/usr/bin" && mv "$(PDIR)/usr/lib/tupi/bin/tupi" "$(PDIR)/usr/bin/"
	perl -pi -e 's{(/usr/lib)(?!/tupi)}{$$1/tupi}g; s{(export\s+TUPI_INCLUDE)}{#$$1}; s{/usr/bin}{/usr/lib/tupi/bin};' $(PDIR)/usr/bin/tupi
	# wipe empty dirs, if any
	find $(PDIR) -type d -empty -delete

override_dh_shlibdeps:
	LD_LIBRARY_PATH="$(PDIR)/usr/lib/tupi:$(PDIR)/usr/lib/tupi/plugins:$(LD_LIBRARY_PATH)" dh_shlibdeps

override_dh_makeshlibs:
	dh_makeshlibs --noscripts

override_dh_strip:
	dh_strip -v --dbg-package=tupi-dbg

get-orig-source:
	uscan --noconf --verbose --force-download --rename --repack --destdir=. --download-current-version