File: rules

package info (click to toggle)
bogofilter 1.2.5-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 5,896 kB
  • sloc: ansic: 35,768; sh: 8,350; perl: 2,320; xml: 1,381; makefile: 751; lex: 483; lisp: 179; asm: 11
file content (85 lines) | stat: -rwxr-xr-x 2,666 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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export CONFIG_SHELL=/bin/bash

derives_from_ubuntu := $(shell (dpkg-vendor --derives-from ubuntu && echo yes) || echo no)
ifeq ($(derives_from_ubuntu),yes)
DO_TOKYOCABINET = no
export DH_OPTIONS := -Nbogofilter-tokyocabinet
else
DO_TOKYOCABINET = yes
endif

%:
	dh $@ --without autoreconf

override_dh_auto_configure:
	mkdir -p $(CURDIR)/obj-doc
	cd $(CURDIR)/obj-doc && ../configure
	mkdir $(CURDIR)/obj-db $(CURDIR)/obj-sqlite
	cd $(CURDIR)/obj-db && ../configure --with-database=db \
		--prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc \
		AWK=awk $(shell dpkg-buildflags --export=configure)
	cd $(CURDIR)/obj-sqlite && ../configure --with-database=sqlite \
		--program-suffix=-sqlite --prefix=/usr --mandir=\$${prefix}/share/man \
		--sysconfdir=/etc AWK=awk $(shell dpkg-buildflags --export=configure) && \
		sed -i 's/^INTEGRITY_TESTS.*/INTEGRITY_TESTS=t.lock1/' src/tests/Makefile
	if [ $(DO_TOKYOCABINET) = yes ]; then \
		mkdir $(CURDIR)/obj-tokyocabinet; \
		cd $(CURDIR)/obj-tokyocabinet && ../configure \
			--with-database=tokyocabinet --program-suffix=-tokyocabinet \
			--prefix=/usr --mandir=\$${prefix}/share/man --sysconfdir=/etc AWK=awk \
			$(shell dpkg-buildflags --export=configure); \
	fi

override_dh_auto_build:
	cd $(CURDIR)/obj-doc/doc && $(MAKE)
	cd $(CURDIR)/obj-db && $(MAKE)
	cd $(CURDIR)/obj-sqlite && $(MAKE)
	if [ $(DO_TOKYOCABINET) = yes ]; then \
		cd $(CURDIR)/obj-tokyocabinet && $(MAKE); \
	fi

override_dh_install:
	test -e obj-bdb || ln -s obj-db obj-bdb
	if [ $(DO_TOKYOCABINET) = yes ]; then \
                dh_install; \
	else dh_install -Xtokyocabinet; \
        fi

	dh_install

override_dh_installdocs:
	dh_installdocs --link-doc=bogofilter-common
	if [ -e debian/bogofilter-common/usr/share/doc/bogofilter-common/bogofilter-faq-bg.xhtml ]; then \
		mv debian/bogofilter-common/usr/share/doc/bogofilter-common/bogofilter-faq-bg.xhtml \
		   debian/bogofilter-common/usr/share/doc/bogofilter-common/bogofilter-faq-bg.html; \
	fi

override_dh_installchangelogs:
	dh_installchangelogs NEWS -pbogofilter-common

override_dh_compress:
	dh_compress -X.pl

override_dh_auto_clean:
	rm -fr obj-bdb obj-db obj-sqlite obj-doc
	if [ $(DO_TOKYOCABINET) = yes ];then \
		rm -rf obj-tokyocabinet; \
	fi

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq (,$(filter $(DEB_HOST_ARCH_OS), hurd))
override_dh_auto_test:
	cd $(CURDIR)/obj-db && $(MAKE) check
	cd $(CURDIR)/obj-sqlite && $(MAKE) check
	if [ $(DO_TOKYOCABINET) = yes ]; then \
		cd $(CURDIR)/obj-tokyocabinet && $(MAKE) check; \
	fi
endif
endif