File: rules

package info (click to toggle)
jed 1%3A0.99.20~pre.178%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,428 kB
  • sloc: ansic: 49,369; sh: 3,250; makefile: 473
file content (111 lines) | stat: -rwxr-xr-x 3,283 bytes parent folder | download | duplicates (2)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/make -f

#export DH_VERBOSE=1

# Set architecture variables for cross-compiling and for saving the configure
# script from having to guess our platform (since we know it already)
# Also sets multiarch lib vars
include /usr/share/dpkg/architecture.mk

configure_flags = --prefix=/usr/share		\
                  --exec-prefix=/usr		\
                  --mandir=/usr/share/man	\
                  --with-x			\
                  --host=$(DEB_HOST_GNU_TYPE)

ifeq ($(DEB_HOST_ARCH_OS),linux)
  configure_flags += --enable-gpm
else
# libgpm is not supported by non-linux architectures: #345268 #95843
  configure_flags += --disable-gpm
endif
ifneq ($(DEB_HOST_ARCH_OS),hurd)
  configure_flags += --enable-xft
else
# The xrender extension is not supported on the hurd: #95843
  configure_flags += --disable-xft
endif

#to successfully build with a multiarch slang we need to explicitly specify
#include and library directories.
configure_flags += --with-slanglib=/usr/lib/$(DEB_HOST_MULTIARCH) --with-slanginc=/usr/include

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

debdir = $(CURDIR)/debian
comdir = $(debdir)/jed-common
shrdir = $(comdir)/usr/share
jeddir = $(shrdir)/jed
docdir = $(jeddir)/doc
tmpdir = $(debdir)/tmp
mandir = $(tmpdir)/usr/share/man/man1

export AUTOHEADER = true

%:
	dh $@ --no-parallel

execute_after_dh_autoreconf:
	mv autoconf/configure .

override_dh_auto_configure:
	dh_auto_configure -- $(configure_flags)

override_dh_auto_build-arch:
	dh_auto_build -- jed xjed

override_dh_auto_build-indep:
	mkdir -p html
	cp doc/manual/jed.tex html
	cd html ;					\
	    hevea -fix -o jed.hevea jed.tex ;		\
	    hacha jed.hevea ;				\
	    rm jed.hevea jed.haux jed.htoc jed.tex

override_dh_auto_install:
	# Empty target. The installation is done by the targets
	# override_dh_install-{arch,indep}

override_dh_install-arch:
	$(MAKE) -C src DESTDIR=$(tmpdir) install_bin
	dh_install -a
	# Create the manual page for xjed
	cp doc/manual/jed.1 doc/manual/xjed.1
	# Fix dh_missing
	rm -rf $(tmpdir)/usr/bin/jed-script

override_dh_install-indep:
	$(MAKE) -C src DESTDIR=$(tmpdir) JED_MAN_FILES= install_data
	dh_install -i
	mkdir -p $(jeddir)/compile
	install $(debdir)/compile $(jeddir)/compile/jed-common
	rm -rf $(docdir)/manual

execute_after_dh_installdocs-indep:
	# Fix package-contains-documentation-outside-usr-share-doc
	rm -f $(jeddir)/lib/colors/README

override_dh_compress:
	dh_compress --exclude=.txt

execute_after_dh_installinfo-indep:
	# Fix info-document-has-wrong-extension
	cd $(shrdir)/info && 						\
            for i in 1 2 3; do mv jed.$${i}in jed.info-$$i; done &&	\
            sed -i '/jed\..in/s/jed\.\([123]\)in/jed.info-\1/' jed.info

execute_after_dh_auto_test-arch:
	$(MAKE) -C src runtests

execute_before_dh_installdeb:
	for p in jed xjed ; do							\
	    priority_editor=$$(test $$p = jed && echo 42 || echo 35) ;		\
	    priority_jed_script=$$(test $$p = jed && echo 50 || echo 40) ;	\
	    for s in prerm postinst ; do					\
	        sed "s/#PROG#/$$p/g;						\
		     s/#PRIORITY-EDITOR#/$$priority_editor/g;			\
		     s/#PRIORITY-JED-SCRIPT#/$$priority_jed_script/g;"		\
	            < $(debdir)/$$s.in > $(debdir)/$$p.$$s ;			\
	    done ;								\
	    cp $(debdir)/triggers.in $(debdir)/$$p.triggers ;			\
	done