Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # for DEB_HOST_MULTIARCH
4 include /usr/share/dpkg/default.mk
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6
7 %:
8 dh $@
9
10 # extract library major version from source build system
11 libver0 := $(shell \
12 egrep 'm4_define..lt_compat.,' configure.ac \
13 | head -1 \
14 | sed 's:m4_define::' \
15 | tr --delete --complement '[:digit:]')
16
17 # extract library major version expected by debian packaging
18 libver := $(shell egrep '^Package: libdjvulibre[0-9]+$$' debian/control \
19 | head -1 \
20 | sed 's/Package: libdjvulibre//')
21
22 configure_options += --enable-static
23 configure_options += --enable-shared
24 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
25 configure_options += --enable-debug
26 else ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
27 # consider modifying the autoconf scripts to accept a --disable-optimization flag
28 configure_options += --enable-debug
29 endif
30
31 override_dh_testdir:
32 @echo "library major version: upstream $(libver0), debian $(libver)"
33 ifneq ($(libver0),$(libver))
34 echo "error: inconsistent upstream and debian/control library major version"
35 exit 1
36 endif
37 dh_testdir
38
39 override_dh_auto_configure:
40 dh_auto_configure -- $(configure_options)
41
42 execute_after_dh_auto_install:
43 mkdir --parents debian/tmp/usr/lib/cgi-bin
44 cp --preserve=mode,timestamps debian/djvuserve.sh \
45 debian/tmp/usr/lib/cgi-bin/djvuserve
46
47 execute_after_dh_install:
48 @echo "remove from djvulibre-bin, already in djvuserve"
49 if test -d debian/djvulibre-bin; then find debian/djvulibre-bin -name djvuserve\* -print -delete; fi
50 # @echo "remove from djvulibre-bin, not in Debian: needs gsdjvu, direct complaints to AT&T"
51 # find debian/djvulibre-bin -name djvudigital\* -print -delete
52
53 override_dh_installchangelogs:
54 dh_installchangelogs --keep NEWS
55
56 override_dh_compress:
57 dh_compress --exclude=.djvu
58
59 override_dh_makeshlibs:
60 dh_makeshlibs --version-info --exclude=/plugins
61
62 override_dh_missing:
63 dh_missing --list-missing