File: rules

package info (click to toggle)
hugin 2016.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,072 kB
  • ctags: 11,979
  • sloc: cpp: 116,753; ansic: 6,335; python: 1,517; perl: 577; sh: 168; xml: 102; makefile: 64
file content (80 lines) | stat: -rwxr-xr-x 2,535 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
#!/usr/bin/make -f

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

export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed -Wl,-z,defs
export DEB_CFLAGS_MAINT_APPEND := -Wall
export DEB_CXXFLAGS_MAINT_APPEND := -Wall
export DEB_BUILD_MAINT_OPTIONS := hardening=+all
# Default python version.
PYTHONDEFVERSION := $(shell pyversions -d | sed -e 's/python\([0-9.]\+\)/\1/')

# Upstream version can be overriden so as to fetch newer revisions
# without having to modify the top-most changelog entry
UVERSION  ?= $(shell dpkg-parsechangelog | perl -ne 'print "$$1\n" if (/^Version: (.*?)(?:\+dfsg)?\-.*?$$/)')

# Where to store which manpages are generated (upstream keeps some manpages
# both under .pod and .1 formats).
GENERATED_MANPAGES := debian/generated-manpages

override_dh_auto_build:
	dh_auto_build --verbose -O--parallel
	# Build manpages.
	for i in doc/*.pod ; do \
		if [ ! -f $${i%%.pod}.1 ] ; then \
			pod2man --center "HUGIN TOOLS" \
				--release $(UVERSION) \
				$$i -o $${i%%.pod}.1 ; \
			echo $${i%%.pod}.1 >> $(GENERATED_MANPAGES) ; \
		fi ; \
	done

override_dh_makeshlibs:
	dh_makeshlibs --noscripts

override_dh_auto_install:
	dh_auto_install --verbose
	rm -vf debian/tmp/usr/share/hugin/xrc/data/help_en_EN/LICENCE.manual

override_dh_auto_clean:
	dh_auto_clean --verbose
	rm -vf src/celeste/Config.h
	# Clean generated manpages.
	if [ -f $(GENERATED_MANPAGES) ] ; then \
		for i in `cat $(GENERATED_MANPAGES)` ; do \
			rm -f $$i ; \
		done ; \
		rm -vf $(GENERATED_MANPAGES) ; \
	fi

override_dh_auto_configure:
	dh_auto_configure --verbose --\
		-DBUILD_HSI:BOOL=ON \
		-DPythonLibs_FIND_VERSION=$(PYTHONDEFVERSION)

override_dh_python2:
	dh_python2 -i /usr/share/hugin/data/plugins
	dh_python2 -a --no-guessing-versions

%:
	dh $@ --with python2 --parallel

get-orig-source:
	rm -rf  $(CURDIR)/debian/get-orig-source
	mkdir $(CURDIR)/debian/get-orig-source
	uscan --force-download --rename --download-version ${UVERSION} \
		--destdir $(CURDIR)/debian/get-orig-source
	cd $(CURDIR)/debian/get-orig-source && \
		if test -e hugin_${UVERSION}.orig.tar.gz ; then \
		tar xzf hugin_${UVERSION}.orig.tar.gz ; else \
		tar xjf hugin_${UVERSION}.orig.tar.bz2 ; fi && \
		cd hugin-* && \
		rm -rvf platforms/windows/ mac/*  \
		src/foreign/getopt/src/msvs/ platforms/mac/* \
		platforms/CMakeLists.txt &&\
		touch platforms/CMakeLists.txt && \
		find -name '*.vcproj' -delete && \
		cd .. && \
		tar -cJf $(CURDIR)/../hugin_$(UVERSION)+dfsg.orig.tar.xz hugin-*
	rm -rf  $(CURDIR)/debian/get-orig-source