File: rules

package info (click to toggle)
nmh 1.7.1-6
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 7,220 kB
  • sloc: ansic: 48,455; sh: 20,755; makefile: 1,005; lex: 732; perl: 509; yacc: 256
file content (115 lines) | stat: -rwxr-xr-x 3,277 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
112
113
114
115
#!/usr/bin/make -f

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

TARGETDIR=./debian/nmh
BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')

export DEB_CFLAGS_MAINT_APPEND="-Wall"
export CFLAGS:= -Wall $(shell  dpkg-buildflags --get CFLAGS)
export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

INSTALL = install
INSTALL_FILE    = $(INSTALL) -p    -o root -g root  -m  644
INSTALL_PROGRAM = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_SCRIPT  = $(INSTALL) -p    -o root -g root  -m  755
INSTALL_DIR     = $(INSTALL) -p -d -o root -g root  -m  755

ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

build-stamp:
	dh_testdir
	dh_autoreconf
	dh_auto_configure -- \
	  --prefix= \
	  --bindir='$${prefix}/usr/bin/mh' \
	  --sysconfdir='$${prefix}/etc' \
	  --libdir='$${prefix}/usr/lib' \
	  --mandir='$${prefix}/usr/share/man' \
	  --docdir='$${prefix}/usr/share/doc/nmh' \
		--libexecdir='$${prefix}/usr/lib/mh' \
	  --with-tls \
	  --with-mts=sendmail/pipe \
	  --with-cyrus-sasl \
    --with-oauth
	$(MAKE) sendmailpath=/usr/sbin/sendmail
	touch build-stamp

build: build-stamp
build-arch: build
build-indep:

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	# generated file shouldn't end up in the debian diff
	rm -f sbr/dtimep.c
	rm -f config.log
	rm -f test/*/test-*.log test/*/test-*.trs test-suite.log test/*.log test/*.trs
	dh_autoreconf_clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	make install prefix=$(TARGETDIR)

# run the check *after* putting everything in its place,
# so that the required components and other files are found
# by the tests.
	[ -n "$(filter nocheck,$(DEB_BUILD_OPTIONS))" ] || $(MAKE) check

# upstream install file isn't wanted
	rm -f $(TARGETDIR)/usr/share/doc/nmh/INSTALL
# ditto for rpm build script and spec file
	rm -f $(TARGETDIR)/usr/share/doc/nmh/contrib/build_nmh $(TARGETDIR)/usr/share/doc/nmh/contrib/nmh.spec

	# definitely don't want the example script rmmproc.messageid in etc/nmh
	mv $(TARGETDIR)/etc/nmh/rmmproc.messageid $(TARGETDIR)/usr/share/doc/nmh/examples/

# now install the mime-support-aware mhn.defaults
	$(INSTALL_FILE) debian/mhn.defaults $(TARGETDIR)/etc/nmh/

# install bash-completions (newer location)
	$(INSTALL_DIR) $(TARGETDIR)/usr/share/bash-completion/completions
	$(INSTALL_FILE) debian/nmh.bash_completions $(TARGETDIR)/usr/share/bash-completion/completions/nmh

# don't want to fiddle with makefile.in too much, so i fix things here:
# install-mh manpage is in wrong section
	mv $(TARGETDIR)/usr/share/man/man1/install-mh.1mh $(TARGETDIR)/usr/share/man/man8/install-mh.8mh

binary-indep: build install
# nothing to do

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_strip_nondeterminism
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol

	find '$(TARGETDIR)' -depth -newermt '$(BUILD_DATE)' -print0 | \
	xargs -0r touch --no-dereference --date='$(BUILD_DATE)'

	dh_md5sums
	dh_builddeb

binary:	binary-arch

.PHONY: configure build clean install binary binary-arch binary-indep