rules 3.8 KB
Newer Older
1 2
#!/usr/bin/make -f

IOhannes zmölnig's avatar
IOhannes zmölnig committed
3 4 5
#enable hardening
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

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

IOhannes m zmoelnig's avatar
IOhannes m zmoelnig committed
9 10 11
## use hardening flags
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
12
include /usr/share/dpkg/architecture.mk
13
include /usr/share/dpkg/pkg-info.mk
IOhannes m zmoelnig's avatar
IOhannes m zmoelnig committed
14

15 16 17 18 19 20
DATE_FMT = %Y/%m/%d at %H:%M:%S UTC
ifdef SOURCE_DATE_EPOCH
    BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+$(DATE_FMT)" 2>/dev/null || date -u "+$(DATE_FMT)")
else
    BUILD_DATE ?= $(shell date "+$(DATE_FMT)")
endif
21

22 23 24 25
export PKGVERSION_CODENAME="Debian/$(DEB_VERSION)"

CPPFLAGS+=-DGEM_VERSION_CODENAME='"$(PKGVERSION_CODENAME)"'

26
ifeq ($(DEB_HOST_ARCH_CPU), ppc64el)
27 28
  CXXFLAGS+=-m64 -mcpu=powerpc
  CFLAGS+=-m64 -mcpu=powerpc
29 30
endif

31

32
archconfflags := \
33 34
	--libdir=\$${exec_prefix}/lib \
	--libexecdir=\$${exec_prefix}/lib \
35
	--with-pd=/usr/include/pd \
36
	--with-extension=pd_linux \
37
	--without-ALL \
IOhannes zmölnig's avatar
IOhannes zmölnig committed
38
	--with-glewmx \
39 40
	--with-glfw3 \
	--with-sdl \
41
	--with-ftgl \
IOhannes zmölnig's avatar
IOhannes zmölnig committed
42
	--with-fribidi \
43
	--with-ImageMagick \
44 45
	--with-jpeg \
	--with-tiff \
46 47
	--with-lqt \
	--with-libquicktime \
48
	--with-gmerlin_avdec \
49
	--with-libmpeg3 \
50 51
	--without-v4l \
	--without-libv4l1 \
52
	--with-v4l2 \
53
	--with-libv4l2 \
54 55
	--with-libdv \
	--with-libdc1394_2 \
56 57
	--with-libiec61883 \
	--with-libraw1394 \
58
	--with-unicap \
59
	--with-libunicap \
60 61 62 63
	--with-libvncclient \
	--with-libvlc \
	--with-DeckLink=local \
	--with-assimp \
64
	--with-build-date="on $(BUILD_DATE)" \
65
	--with-default-font=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
66

67 68 69 70 71 72
ifeq ($(DEB_HOST_ARCH_CPU), i386)
archconfflags += \
	--disable-mmx \
	$(empty)
endif

73 74 75 76 77 78
ifeq ($(DEB_HOST_ARCH_CPU), amd64)
archconfflags += \
	--enable-sse2 \
	$(empty)
endif

79 80 81 82 83 84
ifeq ($(DEB_HOST_ARCH_CPU), x32)
archconfflags += \
	--enable-sse2 \
	$(empty)
endif

85
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
86
	^\./\.git/.*|\./debian/|\./doc/manual/.*\.jpg|\./doc/manual/.*\.gif|\./examples/10\.glsl/.*\.jpg|\./examples/12\.multi_screen_projection\/.*\.jpg|\./examples/data/.*|.*\.pdf|\./build/osx-dmginstaller/DS_Store|.\/build/travis-ci/travisci.enc$
87

88
%:
89
	dh $@
90 91

override_dh_auto_configure:
92
	CXXFLAGS="$(CXXFLAGS)" CFLAGS="$(CFLAGS)" dh_auto_configure -- $(archconfflags)
93 94 95

override_dh_auto_test:
	# no actual 'make test' target
IOhannes m zmölnig's avatar
IOhannes m zmölnig committed
96

97 98
override_dh_install:
	dh_install
99
	# remove libtool files, they are not needed
100
	-find debian/gem-extra/usr/lib/ -name '*.la'  -delete
101
	# remove some assets
102 103 104 105
	-find debian/gem-doc/usr/share/ -name '*.ttf' -delete; \
	-find debian/gem-doc/usr/share/ -name '*.avi' -delete; \
	-find debian/gem-doc/usr/share/ -name '*.mov' -delete; \
	-find debian/gem-doc/usr/share/ -name '*.mpg' -delete; \
106 107
	# the following COPYING only contains license information for vera.ttf
	# which is not included in the Debian package
108
	-rm debian/gem-doc/usr/share/gem/examples/data/COPYING.txt
109
	# remove extra LICENSE files for gem-extra
110 111
	-rm -f debian/gem-extra/usr/lib/pd/extra/pix_mano/LICENSE.txt
	-rm -f debian/gem-extra/usr/lib/pd/extra/pix_drum/LICENSE.txt
112

IOhannes m zmoelnig's avatar
IOhannes m zmoelnig committed
113
# calculate proper dependencies (for .pd_linux files)
114
override_dh_shlibdeps:
115
	dh_shlibdeps
116
	-find debian/gem -name "*.pd_linux" -exec \
117
		dpkg-shlibdeps -Tdebian/gem.substvars {} +
118
	-find debian/gem-extra -name "*.pd_linux" -exec \
119 120 121 122
		dpkg-shlibdeps -Tdebian/gem-extra.substvars {} +

override_dh_strip:
	dh_strip
123
	-find debian -name "*.pd_linux" -exec \
124
		strip --remove-section=.comment --remove-section=.note --strip-unneeded {} +
125

126 127 128

override_dh_fixperms:
	dh_fixperms -Xpd-gem
129 130
	-chmod 0755 debian/gem/usr/bin/pd-gem
	-find debian -name '*.pd_linux' -exec \
131 132 133 134
		chmod 0644 {} +

override_dh_compress:
	dh_compress -X.pd -X.TIF -X.obj
135 136 137 138 139 140

licensecheck:
	licensecheck -i "$(DEB_COPYRIGHT_CHECK_IGNORE_REGEX)" --deb-machine -r . \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints