File: rules

package info (click to toggle)
djvulibre 3.5.27.1-7
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,976 kB
  • ctags: 8,037
  • sloc: cpp: 65,455; xml: 5,723; ansic: 4,640; sh: 846; makefile: 315
file content (65 lines) | stat: -rwxr-xr-x 2,015 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

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

# extract library major version from source build system
libver0 := $(shell \
	egrep 'm4_define..lt_compat.,' configure.ac \
	 | head -1 \
	 | sed 's:m4_define::' \
	 | tr --delete --complement '[:digit:]')

# extract library major version expected by debian packaging
libver := $(shell egrep '^Package: libdjvulibre[0-9]+$$' debian/control \
		  | head -1 \
		  | sed 's/Package: libdjvulibre//')

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

configure_options += --enable-static
configure_options += --enable-shared
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
configure_options += --enable-debug
else ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
# consider modifying the autoconf scripts to accept a --disable-optimization flag
configure_options += --enable-debug
endif

override_dh_testdir:
	@echo "library major version: upstream $(libver0), debian $(libver)"
ifneq ($(libver0),$(libver))
	echo "error: inconsistent upstream and debian/control library major version"
	exit 1
endif
	dh_testdir

override_dh_auto_configure:
	dh_auto_configure -- $(configure_options)

override_dh_auto_install:
	dh_auto_install
	mkdir --parents debian/tmp/usr/lib/cgi-bin
	cp --preserve=mode,timestamps debian/djvuserve.sh \
		debian/tmp/usr/lib/cgi-bin/djvuserve

override_dh_install:
	dh_install --list-missing
	@echo remove from djvulibre-bin, already in djvuserve
	if test -d debian/djvulibre-bin; then find debian/djvulibre-bin -name djvuserve\* -print -delete; fi
# 	@echo "remove from djvulibre-bin, not in Debian: needs gsdjvu, direct complaints to AT&T"
# 	find debian/djvulibre-bin -name djvudigital\* -print -delete

override_dh_installchangelogs:
	dh_installchangelogs --keep NEWS

override_dh_compress:
	dh_compress --exclude=.djvu

override_dh_strip:
	dh_strip --dbg-package=djvulibre-dbg

override_dh_makeshlibs:
	dh_makeshlibs --version-info --exclude=/plugins