File: rules

package info (click to toggle)
postfix-gld 1.7-8
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 480 kB
  • sloc: ansic: 1,447; sql: 169; sh: 112; makefile: 109
file content (73 lines) | stat: -rwxr-xr-x 2,221 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
66
67
68
69
70
71
72
73
#!/usr/bin/make -f

package = postfix-gld
docdir = debian/tmp/usr/share/doc/$(package)

BUILD_DATE := $(shell dpkg-parsechangelog -S Date)

DATABASE = mysql

CFLAGS := `dpkg-buildflags --get CFLAGS` -Wall
LDFLAGS := `dpkg-buildflags --get LDFLAGS`
CPPFLAGS := `dpkg-buildflags --get CPPFLAGS`
STRIP = true

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
  STRIP = strip --remove-section=.comment --remove-section=.note
endif

build:
	./configure --prefix=/usr --with-$(DATABASE)
	$(MAKE) CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
	touch build

clean:
	rm -f build
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f `find . -name "*~"`
	rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: build

binary-arch: build
	rm -rf debian/tmp
	install -d debian/tmp/DEBIAN $(docdir)
	cd debian/tmp && install -d etc/init.d usr/sbin usr/share/gld \
		etc/default usr/share/man/man8 etc/logcheck/ignore.d.server
	install -m 755 gld debian/tmp/usr/sbin
	install -m 644 debian/logcheck \
		debian/tmp/etc/logcheck/ignore.d.server/postfix-gld
	install -m 644 gld.conf debian/tmp/etc
	install -m 755 debian/gld.init debian/tmp/etc/init.d/gld
	install -m 644 debian/conffiles debian/tmp/DEBIAN
	install -m 755 debian/prerm debian/postinst debian/postrm \
		debian/tmp/DEBIAN
	cp -p debian/default debian/tmp/etc/default/gld
	cp -p tables.$(DATABASE)   debian/tmp/usr/share/gld
	cp -p table-whitelist.sql  debian/tmp/usr/share/gld
ifeq ($(DATABASE),pgsql)
	cp -p README-pgsql $(docdir)
endif
	install -m 644 debian/gld.8 debian/tmp/usr/share/man/man8
	cp -p debian/changelog $(docdir)/changelog.Debian
	cp -p HISTORY README debian/README.Debian $(docdir)
	cp -p debian/copyright $(docdir)
	cd $(docdir) && gzip -9n HISTORY changelog.Debian
	ln -s HISTORY.gz $(docdir)/changelog.gz
	gzip -r9n debian/tmp/usr/share/man
	$(STRIP) debian/tmp/usr/sbin/*
	dpkg-shlibdeps debian/tmp/usr/sbin/*
	dpkg-gencontrol
	chown -R 0:0 debian/tmp
	chmod -R go=rX debian/tmp
	find debian/tmp -newermt '$(BUILD_DATE)' -print0 |\
		xargs -0r touch -h --date='$(BUILD_DATE)'
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

build-arch: build

build-indep: build

.PHONY: binary binary-arch binary-indep clean